71 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_DELAY_IMAGES_FILTER_H_
72 #define NET_INSTAWEB_REWRITER_PUBLIC_DELAY_IMAGES_FILTER_H_
82 namespace net_instaweb {
88 static const char kDelayImagesSuffix[];
89 static const char kDelayImagesInlineSuffix[];
90 static const char kImageOnloadCode[];
91 static const char kImageOnloadJsSnippet[];
97 virtual void StartElementImpl(
HtmlElement* element) { }
102 virtual const char*
Name()
const {
return "DelayImages"; }
106 static void InitStats(
Statistics* statistics);
107 static void Terminate();
113 void MaybeAddImageOnloadJsSnippet(
HtmlElement* element);
116 void InsertLowResImagesAndJs(
HtmlElement* element,
bool insert_after_element);
123 bool ShouldRewriteInplace()
const;
125 int num_low_res_inlined_images_;
126 StringStringMap low_res_data_map_;
131 bool insert_low_res_images_inplace_;
137 bool lazyload_highres_images_;
139 bool is_script_inserted_;
141 bool added_image_onload_js_;
Definition: common_filter.h:47
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
virtual const char * Name() const
The name of this filter – used for logging and debugging.
Definition: delay_images_filter.h:102
virtual void DetermineEnabled(GoogleString *disabled_reason)
Definition: html_element.h:42
virtual void EndDocument()
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: rewrite_driver.h:100
Definition: html_filter.h:43
ScriptUsage GetScriptUsage() const override
Definition: delay_images_filter.h:108
virtual void StartDocumentImpl()
Definition: delay_images_filter.h:86