19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_DOMAIN_REWRITE_FILTER_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_DOMAIN_REWRITE_FILTER_H_
37 namespace net_instaweb {
52 static const char kStickyRedirectHeader[];
59 virtual void StartElementImpl(
HtmlElement* element);
60 virtual void EndElementImpl(
HtmlElement* element) {}
62 virtual const char*
Name()
const {
return "DomainRewrite"; }
79 typedef std::vector<std::pair<StringPiece, StringPiece> > SetCookieAttributes;
88 static RewriteResult
Rewrite(
const StringPiece& input_url,
90 const ServerContext* server_context,
91 const RewriteOptions* options,
93 bool apply_domain_suffix,
104 const ServerContext* server_context,
105 const RewriteOptions* options,
106 ResponseHeaders* headers);
112 const ServerContext* server_context,
113 const RewriteOptions* options,
115 StringPiece value_in,
120 const ServerContext* server_context,
121 const RewriteOptions* options,
122 StringPiece value_in,
143 StringPiece* cookie_string,
144 SetCookieAttributes* attributes);
147 static void TryUpdateOneHttpDomainHeader(
const GoogleUrl&
base_url,
148 const ServerContext* server_context,
149 const RewriteOptions* options,
151 ResponseHeaders* headers);
154 Variable* rewrite_count_;
Definition: common_filter.h:47
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
static RewriteResult Rewrite(const StringPiece &input_url, const GoogleUrl &base_url, const ServerContext *server_context, const RewriteOptions *options, bool apply_sharding, bool apply_domain_suffix, GoogleString *output_url)
Definition: html_element.h:42
static bool UpdateOneDomainHeader(HeaderSource src, const GoogleUrl &base_url, const ServerContext *server_context, const RewriteOptions *options, StringPiece name, StringPiece value_in, GoogleString *out)
static bool UpdateSetCookieHeader(const GoogleUrl &base_url, const ServerContext *server_context, const RewriteOptions *options, StringPiece value_in, GoogleString *out)
Like UpdateOneDomainHeader, but specifically for Set-Cookie.
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual const char * Name() const
The name of this filter – used for logging and debugging.
Definition: domain_rewrite_filter.h:62
ScriptUsage
Describes a filter's relationship with scripts.
Definition: html_filter.h:38
static bool ParseRefreshContent(StringPiece input, StringPiece *before, StringPiece *url, StringPiece *after)
Definition: rewrite_driver.h:100
virtual void EndDocument()
RewriteResult
Definition: rewrite_result.h:27
ScriptUsage GetScriptUsage() const override
Definition: domain_rewrite_filter.h:66
Definition: html_filter.h:49
const GoogleUrl & base_url() const
Getters.
static void ParseSetCookieAttributes(StringPiece input, StringPiece *cookie_string, SetCookieAttributes *attributes)
Definition: domain_rewrite_filter.h:50
virtual void StartDocumentImpl()
static void UpdateDomainHeaders(const GoogleUrl &base_url, const ServerContext *server_context, const RewriteOptions *options, ResponseHeaders *headers)