19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_CRITICAL_CSS_BEACON_FILTER_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_CRITICAL_CSS_BEACON_FILTER_H_
40 namespace net_instaweb {
52 static const char kInitializePageSpeedJs[];
56 static const char kCriticalCssNoBeaconDueToMissingData[];
57 static const char kCriticalCssSkippedDueToCharset[];
64 virtual const char*
Name()
const {
return "CriticalCssBeacon"; }
65 virtual const char* id()
const {
return "cb"; }
73 return driver()->
options()->HasInlineUnauthorizedResourceType(
74 semantic_type::kStylesheet) ?
75 RewriteDriver::kInlineUnauthorizedResources :
76 RewriteDriver::kInlineOnlyAuthorizedResources;
85 virtual void Summarize(Css::Stylesheet* stylesheet,
92 static void FindSelectorsFromRuleset(
const Css::Ruleset& ruleset,
93 StringSet* selectors);
95 static void FindSelectorsFromStylesheet(
const Css::Stylesheet& css,
96 StringSet* selectors);
99 void AppendSelectorsInitJs(
GoogleString* script,
const StringSet& selectors);
105 Variable* critical_css_beacon_added_count_;
108 Variable* critical_css_no_beacon_due_to_missing_data_;
111 Variable* critical_css_skipped_due_to_charset_;
virtual bool MustSummarize(HtmlElement *element) const
Definition: statistics.h:43
virtual const char * Name() const
The name of this filter – used for logging and debugging.
Definition: critical_css_beacon_filter.h:64
virtual void DetermineEnabled(GoogleString *disabled_reason)
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
virtual void Summarize(Css::Stylesheet *stylesheet, GoogleString *out) const
virtual bool IntendedForInlining() const
Selectors are inlined into javascript.
Definition: critical_css_beacon_filter.h:80
virtual void SummariesDone()
Definition: html_element.h:42
virtual RewriteDriver::InlineAuthorizationPolicy AllowUnauthorizedDomain() const
Definition: critical_css_beacon_filter.h:71
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
ScriptUsage
Describes a filter's relationship with scripts.
Definition: html_filter.h:38
Definition: critical_css_beacon_filter.h:50
Definition: rewrite_driver.h:100
static const char kCriticalCssBeaconAddedCount[]
Statistics:
Definition: critical_css_beacon_filter.h:55
ScriptUsage GetScriptUsage() const override
Definition: critical_css_beacon_filter.h:81
InlineAuthorizationPolicy
See CreateInputResource.
Definition: rewrite_driver.h:137
Definition: html_filter.h:43
const RewriteOptions * options() const
Return the options used for this RewriteDriver.
Definition: rewrite_driver.h:496
Definition: css_summarizer_base.h:52