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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 class Attribute; | 45 class Attribute; |
46 class CSSRule; | 46 class CSSRule; |
47 class CSSStyleSheet; | 47 class CSSStyleSheet; |
48 class CSSValue; | 48 class CSSValue; |
49 class Document; | 49 class Document; |
50 class Element; | 50 class Element; |
51 class FontResource; | 51 class FontResource; |
52 class ImageResourceContent; | 52 class ImageResourceContent; |
53 class LocalFrame; | 53 class LocalFrame; |
| 54 class Node; |
54 class SharedBuffer; | 55 class SharedBuffer; |
55 class StylePropertySet; | 56 class StylePropertySet; |
56 | 57 |
57 struct SerializedResource; | 58 struct SerializedResource; |
58 | 59 |
59 // This class is used to serialize frame's contents back to text (typically | 60 // This class is used to serialize frame's contents back to text (typically |
60 // HTML). It serializes frame's document and resources such as images and CSS | 61 // HTML). It serializes frame's document and resources such as images and CSS |
61 // stylesheets. | 62 // stylesheets. |
62 class CORE_EXPORT FrameSerializer final { | 63 class CORE_EXPORT FrameSerializer final { |
63 STACK_ALLOCATED(); | 64 STACK_ALLOCATED(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Tells whether to skip serialization of a subresource. | 101 // Tells whether to skip serialization of a subresource. |
101 virtual bool ShouldSkipResource(ResourceHasCacheControlNoStoreHeader) { | 102 virtual bool ShouldSkipResource(ResourceHasCacheControlNoStoreHeader) { |
102 return false; | 103 return false; |
103 } | 104 } |
104 | 105 |
105 // Returns custom attributes that need to add in order to serialize the | 106 // Returns custom attributes that need to add in order to serialize the |
106 // element. | 107 // element. |
107 virtual Vector<Attribute> GetCustomAttributes(const Element&) { | 108 virtual Vector<Attribute> GetCustomAttributes(const Element&) { |
108 return Vector<Attribute>(); | 109 return Vector<Attribute>(); |
109 } | 110 } |
| 111 |
| 112 // Visits a node during serialization. |
| 113 virtual void VisitNode(const Node*) {} |
110 }; | 114 }; |
111 | 115 |
112 // Constructs a serializer that will write output to the given deque of | 116 // Constructs a serializer that will write output to the given deque of |
113 // SerializedResources and uses the Delegate for controlling some | 117 // SerializedResources and uses the Delegate for controlling some |
114 // serialization aspects. Callers need to ensure that both arguments stay | 118 // serialization aspects. Callers need to ensure that both arguments stay |
115 // alive until the FrameSerializer gets destroyed. | 119 // alive until the FrameSerializer gets destroyed. |
116 FrameSerializer(Deque<SerializedResource>&, Delegate&); | 120 FrameSerializer(Deque<SerializedResource>&, Delegate&); |
117 | 121 |
118 // Initiates the serialization of the frame. All serialized content and | 122 // Initiates the serialization of the frame. All serialized content and |
119 // retrieved resources are added to the Deque passed to the constructor. | 123 // retrieved resources are added to the Deque passed to the constructor. |
(...skipping 29 matching lines...) Expand all Loading... |
149 HashSet<KURL> resource_urls_; | 153 HashSet<KURL> resource_urls_; |
150 | 154 |
151 bool is_serializing_css_; | 155 bool is_serializing_css_; |
152 | 156 |
153 Delegate& delegate_; | 157 Delegate& delegate_; |
154 }; | 158 }; |
155 | 159 |
156 } // namespace blink | 160 } // namespace blink |
157 | 161 |
158 #endif // FrameSerializer_h | 162 #endif // FrameSerializer_h |
OLD | NEW |