19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_CSS_SUMMARIZER_BASE_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_CSS_SUMMARIZER_BASE_H_
38 namespace net_instaweb {
41 class HtmlCharactersNode;
54 static const char kNumCssUsedForCriticalCssComputation[];
55 static const char kNumCssNotUsedForCriticalCssComputation[];
136 virtual void Summarize(Css::Stylesheet* stylesheet,
158 bool* is_element_deleted);
191 int NumStyles()
const {
return static_cast<int>(summaries_.size()); }
199 return summaries_.at(pos);
206 virtual void StartElementImpl(
HtmlElement* element);
221 void ReportSummariesDone();
237 Context* CreateContextAndSummaryInfo(
const HtmlElement* element,
241 StringPiece base_for_resources,
247 std::vector<SummaryInfo> summaries_;
250 int outstanding_rewrites_;
251 bool saw_end_of_document_;
252 std::vector<int> canceled_summaries_;
259 Variable* num_css_used_for_critical_css_computation_;
260 Variable* num_css_not_used_for_critical_css_computation_;
virtual void EndDocument()
Definition: html_element.h:66
GoogleString location
Definition: css_summarizer_base.h:99
Definition: statistics.h:43
const SummaryInfo & GetSummaryForStyle(int pos) const
Definition: css_summarizer_base.h:198
Leaf node representing raw characters in HTML.
Definition: html_node.h:167
Slot got removed by an another optimization.
Definition: css_summarizer_base.h:81
virtual void RenderDone()
virtual GoogleString CacheKeySuffix() const
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
CSS parse error we can't recover from.
Definition: css_summarizer_base.h:71
Definition: html_element.h:42
virtual void Summarize(Css::Stylesheet *stylesheet, GoogleString *out) const =0
Definition: ref_counted_ptr.h:69
Definition: css_summarizer_base.h:84
Fetch result unusable, either error or not cacheable.
Definition: css_summarizer_base.h:78
bool is_inside_noscript
True if the style was included inside a noscript section.
Definition: css_summarizer_base.h:114
virtual void StartDocumentImpl()
Definition: scoped_ptr.h:30
Computation/Fetches ongoing, we don't have a result yet.
Definition: css_summarizer_base.h:68
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
GoogleString rel
If it's an external stylesheet, the value of the rel attribute.
Definition: css_summarizer_base.h:108
All OK!
Definition: css_summarizer_base.h:65
bool is_external
True if it's a <link rel=stylesheet href=>, false for <style>
Definition: css_summarizer_base.h:111
Definition: css_summarizer_base.h:75
Definition: rewrite_filter.h:35
SummaryState state
State of computation of 'data'.
Definition: css_summarizer_base.h:95
Definition: rewrite_driver.h:100
int NumStyles() const
Definition: css_summarizer_base.h:191
Definition: rewrite_context.h:155
virtual void SummariesDone()
SummaryState
Definition: css_summarizer_base.h:63
virtual void Characters(HtmlCharactersNode *characters)
virtual void WillNotRenderSummary(int pos, HtmlElement *element, HtmlCharactersNode *char_node)
virtual void RenderSummary(int pos, HtmlElement *element, HtmlCharactersNode *char_node, bool *is_element_deleted)
GoogleString media_from_html
CSS media there were applied to the resource by the HTML.
Definition: css_summarizer_base.h:105
GoogleString base
Base to use for resolving links in the CSS resource.
Definition: css_summarizer_base.h:102
virtual bool MustSummarize(HtmlElement *element) const
Definition: css_summarizer_base.h:125
virtual RewriteContext * MakeRewriteContext()
GoogleString data
Definition: css_summarizer_base.h:92
Definition: css_summarizer_base.h:52