19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_CSS_INLINE_FILTER_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_CSS_INLINE_FILTER_H_
24 #include "net/instaweb/rewriter/cached_result.pb.h"
36 namespace net_instaweb {
44 static const char kNumCssInlined[];
50 virtual void StartElementImpl(
HtmlElement* element);
52 virtual const char*
Name()
const {
return "InlineCss"; }
58 return driver()->
options()->HasInlineUnauthorizedResourceType(
59 semantic_type::kStylesheet) ?
60 RewriteDriver::kInlineUnauthorizedResources :
61 RewriteDriver::kInlineOnlyAuthorizedResources;
66 static bool HasClosingStyleTag(StringPiece contents);
71 void set_id(
const char*
id) { id_ = id; }
77 void set_size_threshold_bytes(
size_t size) { size_threshold_bytes_ = size; }
83 bool ShouldInline(
const ResourcePtr& resource,
84 const StringPiece& attrs_attribute,
86 void RenderInline(
const ResourcePtr& resource,
const CachedResult& cached,
87 const GoogleUrl&
base_url,
const StringPiece& text,
88 HtmlElement* element);
91 size_t size_threshold_bytes_;
95 Variable* num_css_inlined_;
Definition: common_filter.h:47
virtual bool IntendedForInlining() const
Definition: css_inline_filter.h:63
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
Definition: html_element.h:42
virtual const char * Name() const
The name of this filter – used for logging and debugging.
Definition: css_inline_filter.h:52
virtual void StartDocumentImpl()
void set_id(const char *id)
Definition: css_inline_filter.h:71
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: rewrite_driver.h:100
InlineAuthorizationPolicy
See CreateInputResource.
Definition: rewrite_driver.h:137
Inline small CSS files.
Definition: css_inline_filter.h:42
virtual RewriteDriver::InlineAuthorizationPolicy AllowUnauthorizedDomain() const
Definition: css_inline_filter.h:56
virtual ResourcePtr CreateResource(const char *url, bool *is_authorized)
const GoogleUrl & base_url() const
Getters.
const RewriteOptions * options() const
Return the options used for this RewriteDriver.
Definition: rewrite_driver.h:496