19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_COMMON_FILTER_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_COMMON_FILTER_H_
35 namespace net_instaweb {
65 HtmlElement* noscript_element()
const {
return noscript_element_; }
85 virtual void EndElement(HtmlElement* element);
90 virtual void Characters(HtmlCharactersNode* characters);
102 bool* is_authorized);
110 HtmlElement* element);
114 void ResolveUrl(StringPiece input_url, GoogleUrl* out_url);
116 bool IsRelativeUrlLoadPermittedByCsp(StringPiece url,
CspDirective role);
164 const {
return RewriteDriver::kInlineOnlyAuthorizedResources; }
176 ServerContext* server_context()
const {
return server_context_; }
177 const RewriteOptions* rewrite_options() {
return rewrite_options_; }
183 virtual void StartElementImpl(HtmlElement* element) = 0;
184 virtual void EndElementImpl(HtmlElement* element) = 0;
class GoogleUrl
Definition: google_url.h:58
Definition: common_filter.h:47
virtual void StartElement(HtmlElement *element)
virtual RewriteDriver::InlineAuthorizationPolicy AllowUnauthorizedDomain() const
Definition: common_filter.h:163
virtual void StartDocumentImpl()=0
bool DebugMode() const
Definition: common_filter.h:128
void AddJsToElement(StringPiece js, HtmlElement *script)
Definition: empty_html_filter.h:37
void InsertNodeAtBodyEnd(HtmlNode *data)
virtual const char * LoggingId()
Definition: common_filter.h:188
ResourcePtr CreateInputResourceOrInsertDebugComment(StringPiece input_url, RewriteDriver::InputRole role, HtmlElement *element)
bool CanAddPagespeedOnloadToImage(const HtmlElement &)
bool DebugMode() const
Definition: rewrite_driver.h:1137
Definition: html_element.h:42
CspDirective
Definition: csp_directive.h:37
virtual void Characters(HtmlCharactersNode *characters)
InputRole
Definition: rewrite_driver.h:611
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual void LogFilterModifiedContent()
bool BaseUrlIsValid() const
void ResolveUrl(StringPiece input_url, GoogleUrl *out_url)
Definition: rewrite_driver.h:100
Definition: server_context.h:99
static const char kCreateResourceFailedDebugMsg[]
Debug message to be inserted when resource creation fails.
Definition: common_filter.h:50
InlineAuthorizationPolicy
See CreateInputResource.
Definition: rewrite_driver.h:137
const GoogleUrl & decoded_base_url() const
virtual void StartDocument()
Note: Don't overload these methods, overload the implementers instead!
virtual const char * Name() const =0
The name of this filter – used for logging and debugging.
const GoogleUrl & base_url() const
Getters.
virtual bool IntendedForInlining() const
Definition: common_filter.h:169
Definition: rewrite_options.h:84
static bool ExtractMetaTagDetails(const HtmlElement &element, const ResponseHeaders *headers, GoogleString *content, GoogleString *mime_type, GoogleString *charset)
ResourcePtr CreateInputResource(StringPiece input_url, RewriteDriver::InputRole role, bool *is_authorized)