19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_RESOURCE_SLOT_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_RESOURCE_SLOT_H_
26 #include "net/instaweb/rewriter/input_info.pb.h"
36 namespace net_instaweb {
38 class HtmlResourceSlot;
44 typedef RefCountedPtr<ResourceSlot> ResourceSlotPtr;
45 typedef RefCountedPtr<HtmlResourceSlot> HtmlResourceSlotPtr;
46 typedef std::vector<ResourceSlotPtr> ResourceSlotVector;
57 : resource_(resource),
58 preserve_urls_(
false),
59 disable_rendering_(
false),
60 should_delete_element_(
false),
61 disable_further_processing_(
false),
62 was_optimized_(
false),
63 need_aggregate_input_info_(
false) {
88 bool preserve_urls()
const {
return preserve_urls_; }
94 bool disable_rendering()
const {
return disable_rendering_; }
103 should_delete_element_ =
true;
104 disable_further_processing_ =
true;
106 bool should_delete_element()
const {
return should_delete_element_; }
127 disable_further_processing_ = x;
130 bool disable_further_processing()
const {
131 return disable_further_processing_;
137 need_aggregate_input_info_ = x;
140 bool need_aggregate_input_info()
const {
141 return need_aggregate_input_info_;
144 void ReportInput(
const InputInfo& input);
147 const std::vector<InputInfo>*
inputs()
const {
return inputs_.get(); }
154 virtual void Render() = 0;
206 std::unique_ptr<std::vector<InputInfo>> inputs_;
208 bool disable_rendering_;
209 bool should_delete_element_;
210 bool disable_further_processing_;
212 bool need_aggregate_input_info_;
288 int begin_line_number_;
289 int end_line_number_;
virtual void Finished()
Definition: resource_slot.h:159
class GoogleUrl
Definition: google_url.h:58
Definition: html_element.h:66
void set_disable_rendering(bool x)
Definition: resource_slot.h:93
bool was_optimized() const
Definition: resource_slot.h:114
Definition: vector_deque.h:47
virtual GoogleString LocationString() const
Definition: resource_slot.h:228
virtual HtmlElement * element() const
Return HTML element associated with slot, or NULL if none (CSS, IPRO)
Definition: resource_slot.h:226
void SetResource(const ResourcePtr &resource)
Definition: ref_counted_ptr.h:41
static GoogleString RelativizeOrPassthrough(const RewriteOptions *options, StringPiece url, UrlRelativity url_relativity, const GoogleUrl &base_url)
Definition: resource_slot.h:54
virtual GoogleString LocationString() const
Definition: html_element.h:42
virtual bool DirectSetUrl(const StringPiece &url)
void set_need_aggregate_input_info(bool x)
Definition: resource_slot.h:136
virtual bool CanDirectSetUrl()
Definition: resource_slot.h:175
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: resource_slot.h:259
virtual HtmlElement * element() const
Return HTML element associated with slot, or NULL if none (CSS, IPRO)
Definition: resource_slot.h:266
void RequestDeleteElement()
Definition: resource_slot.h:102
virtual HtmlElement * element() const
Return HTML element associated with slot, or NULL if none (CSS, IPRO)
Definition: resource_slot.h:247
virtual GoogleString LocationString() const
void set_disable_further_processing(bool x)
Definition: resource_slot.h:126
UrlRelativity url_relativity() const
Definition: resource_slot.h:276
Definition: resource_slot.h:242
Definition: rewrite_driver.h:100
UrlRelativity
namespace url
Definition: google_url.h:51
RewriteContext * LastContext() const
void AddContext(RewriteContext *context)
Adds a new context to this slot.
Definition: resource_slot.h:182
Definition: resource_slot.h:223
virtual bool DirectSetUrl(const StringPiece &url)
Definition: rewrite_context.h:155
virtual GoogleString LocationString() const =0
virtual bool CanDirectSetUrl()
Definition: resource_slot.h:272
Definition: resource_slot.h:294
virtual void Render()
Definition: resource_slot.h:227
const std::vector< InputInfo > * inputs() const
may be nullptr.
Definition: resource_slot.h:147
Definition: rewrite_options.h:84
void DetachContext(RewriteContext *context)
virtual HtmlElement * element() const =0
Return HTML element associated with slot, or NULL if none (CSS, IPRO)
void set_was_optimized(bool x)
Marks the slot as having been optimized.
Definition: resource_slot.h:117
void set_preserve_urls(bool x)
Definition: resource_slot.h:87