21 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_SRCSET_SLOT_H_
22 #define NET_INSTAWEB_REWRITER_PUBLIC_SRCSET_SLOT_H_
37 namespace net_instaweb {
69 int num_image_candidates() {
return candidates_.size(); }
73 const GoogleString& url(
int idx) {
return candidates_[idx].url; }
75 candidates_[idx].url = new_url;
78 return candidates_[idx].descriptor;
81 HtmlElement* element()
const {
return element_; }
82 HtmlElement::Attribute* attribute()
const {
return attribute_; }
88 int begin_line_number()
const {
return begin_line_number_; }
89 int end_line_number()
const {
return end_line_number_; }
99 static void ParseSrcSet(StringPiece input, std::vector<ImageCandidate>* out);
101 static GoogleString Serialize(
const std::vector<ImageCandidate>& in);
108 std::vector<ImageCandidate> candidates_;
109 RewriteDriver* driver_;
110 HtmlElement* element_;
111 HtmlElement::Attribute* attribute_;
112 CommonFilter* filter_;
113 int begin_line_number_;
114 int end_line_number_;
119 typedef RefCountedPtr<SrcSetSlotCollection> SrcSetSlotCollectionPtr;
HtmlElement * element() const override
Return HTML element associated with slot, or NULL if none (CSS, IPRO)
Definition: srcset_slot.h:134
Definition: common_filter.h:47
Definition: html_element.h:66
GoogleString LocationString() const override
Definition: srcset_slot.h:47
Definition: srcset_slot.h:132
Definition: ref_counted_ptr.h:41
Definition: resource_slot.h:54
Definition: html_element.h:42
Definition: ref_counted_ptr.h:69
SrcSetSlotCollection(RewriteDriver *driver, HtmlElement *element, HtmlElement::Attribute *attribute)
Definition: srcset_slot.h:45
static void ParseSrcSet(StringPiece input, std::vector< ImageCandidate > *out)
CommonFilter * filter() const
The first filter that created this slot collection. There may be others.
Definition: srcset_slot.h:85
SrcSetSlot * slot(int idx)
may be nullptr.
Definition: srcset_slot.h:72
void Initialize(CommonFilter *filter)
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: rewrite_driver.h:100
UrlRelativity
namespace url
Definition: google_url.h:51
Note: this is non-deterministic between executions.
Definition: srcset_slot.h:122
SrcSetSlot * slot
Definition: srcset_slot.h:55
#define REFCOUNT_FRIEND_DECLARATION(class_name)
Definition: ref_counted_ptr.h:209