Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
inline_resource_slot.h
1 /*
2  * Copyright 2014 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_INLINE_RESOURCE_SLOT_H_
18 #define NET_INSTAWEB_REWRITER_PUBLIC_INLINE_RESOURCE_SLOT_H_
19 
21 
22 namespace net_instaweb {
23 
31  public:
33  InlineResourceSlot(const ResourcePtr& resource,
34  HtmlCharactersNode* char_node,
35  StringPiece location);
36 
39  virtual HtmlElement* element() const { return char_node_->parent(); }
40 
41  virtual void Render();
42  virtual GoogleString LocationString() const;
43 
44  protected:
45  REFCOUNT_FRIEND_DECLARATION(InlineResourceSlot);
46  virtual ~InlineResourceSlot();
47 
48  private:
49  HtmlCharactersNode* char_node_;
50  const GoogleString location_;
51 
52 
53 };
54 
55 typedef RefCountedPtr<InlineResourceSlot> InlineResourceSlotPtr;
56 
58  public:
59  bool operator()(const InlineResourceSlotPtr& p,
60  const InlineResourceSlotPtr& q) const;
61 };
62 
63 typedef std::set<InlineResourceSlotPtr,
64  InlineResourceSlotComparator> InlineResourceSlotSet;
65 
66 }
67 
68 #endif
Definition: inline_resource_slot.h:30
virtual HtmlElement * element() const
Definition: inline_resource_slot.h:39
Leaf node representing raw characters in HTML.
Definition: html_node.h:167
Definition: resource_slot.h:54
Definition: html_element.h:42
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual GoogleString LocationString() const
InlineResourceSlot(const ResourcePtr &resource, HtmlCharactersNode *char_node, StringPiece location)
Definition: inline_resource_slot.h:57