OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 virtual bool shouldIgnoreAttribute(const Attribute&) = 0; | 69 virtual bool shouldIgnoreAttribute(const Attribute&) = 0; |
70 }; | 70 }; |
71 | 71 |
72 PageSerializer(Vector<SerializedResource>*, PassOwnPtr<Delegate>); | 72 PageSerializer(Vector<SerializedResource>*, PassOwnPtr<Delegate>); |
73 | 73 |
74 // Initiates the serialization of the frame's page. All serialized content a
nd retrieved | 74 // Initiates the serialization of the frame's page. All serialized content a
nd retrieved |
75 // resources are added to the Vector passed to the constructor. The first re
source in that | 75 // resources are added to the Vector passed to the constructor. The first re
source in that |
76 // vector is the top frame serialized content. | 76 // vector is the top frame serialized content. |
77 void serialize(Page*); | 77 void serialize(Page*); |
78 | 78 |
| 79 void registerRewriteURL(const String& from, const String& to); |
| 80 void setRewriteURLFolder(const String&); |
| 81 |
79 KURL urlForBlankFrame(LocalFrame*); | 82 KURL urlForBlankFrame(LocalFrame*); |
80 | 83 |
81 Delegate* delegate(); | 84 Delegate* delegate(); |
82 | 85 |
83 private: | 86 private: |
84 void serializeFrame(LocalFrame*); | 87 void serializeFrame(LocalFrame*); |
85 | 88 |
86 // Serializes the stylesheet back to text and adds it to the resources if UR
L is not-empty. | 89 // Serializes the stylesheet back to text and adds it to the resources if UR
L is not-empty. |
87 // It also adds any resources included in that stylesheet (including any imp
orted stylesheets and their own resources). | 90 // It also adds any resources included in that stylesheet (including any imp
orted stylesheets and their own resources). |
88 void serializeCSSStyleSheet(CSSStyleSheet&, const KURL&); | 91 void serializeCSSStyleSheet(CSSStyleSheet&, const KURL&); |
89 | 92 |
90 // Serializes the css rule (including any imported stylesheets), adding refe
renced resources. | 93 // Serializes the css rule (including any imported stylesheets), adding refe
renced resources. |
91 void serializeCSSRule(CSSRule*); | 94 void serializeCSSRule(CSSRule*); |
92 | 95 |
93 bool shouldAddURL(const KURL&); | 96 bool shouldAddURL(const KURL&); |
94 | 97 |
95 void addToResources(Resource *, PassRefPtr<SharedBuffer>, const KURL&); | 98 void addToResources(Resource *, PassRefPtr<SharedBuffer>, const KURL&); |
96 void addImageToResources(ImageResource*, LayoutObject*, const KURL&); | 99 void addImageToResources(ImageResource*, LayoutObject*, const KURL&); |
97 void addFontToResources(FontResource*); | 100 void addFontToResources(FontResource*); |
98 | 101 |
99 void retrieveResourcesForProperties(const StylePropertySet*, Document&); | 102 void retrieveResourcesForProperties(const StylePropertySet*, Document&); |
100 void retrieveResourcesForCSSValue(CSSValue*, Document&); | 103 void retrieveResourcesForCSSValue(CSSValue*, Document&); |
101 | 104 |
102 Vector<SerializedResource>* m_resources; | 105 Vector<SerializedResource>* m_resources; |
103 ListHashSet<KURL> m_resourceURLs; | 106 ListHashSet<KURL> m_resourceURLs; |
104 | 107 |
105 using BlankFrameURLMap = WillBeHeapHashMap<RawPtrWillBeMember<LocalFrame>, K
URL>; | 108 using BlankFrameURLMap = WillBeHeapHashMap<RawPtrWillBeMember<LocalFrame>, K
URL>; |
106 BlankFrameURLMap m_blankFrameURLs; | 109 BlankFrameURLMap m_blankFrameURLs; |
| 110 HashMap<String, String> m_rewriteURLs; |
| 111 String m_rewriteFolder; |
107 unsigned m_blankFrameCounter; | 112 unsigned m_blankFrameCounter; |
108 | 113 |
109 OwnPtr<Delegate> m_delegate; | 114 OwnPtr<Delegate> m_delegate; |
110 }; | 115 }; |
111 | 116 |
112 } // namespace blink | 117 } // namespace blink |
113 | 118 |
114 #endif // PageSerializer_h | 119 #endif // PageSerializer_h |
OLD | NEW |