Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameSerializer.h

Issue 2886943003: [Offline Pages] Adding missing image/CSS detection in FrameSerializer. (Closed)
Patch Set: Addressed comments from lucasza@ and holte@. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // Tells whether to skip serialization of a subresource. 100 // Tells whether to skip serialization of a subresource.
101 virtual bool ShouldSkipResource(ResourceHasCacheControlNoStoreHeader) { 101 virtual bool ShouldSkipResource(ResourceHasCacheControlNoStoreHeader) {
102 return false; 102 return false;
103 } 103 }
104 104
105 // Returns custom attributes that need to add in order to serialize the 105 // Returns custom attributes that need to add in order to serialize the
106 // element. 106 // element.
107 virtual Vector<Attribute> GetCustomAttributes(const Element&) { 107 virtual Vector<Attribute> GetCustomAttributes(const Element&) {
108 return Vector<Attribute>(); 108 return Vector<Attribute>();
109 } 109 }
110
111 virtual bool ShouldCollectProblemMetric() { return false; }
110 }; 112 };
111 113
112 // Constructs a serializer that will write output to the given deque of 114 // Constructs a serializer that will write output to the given deque of
113 // SerializedResources and uses the Delegate for controlling some 115 // SerializedResources and uses the Delegate for controlling some
114 // serialization aspects. Callers need to ensure that both arguments stay 116 // serialization aspects. Callers need to ensure that both arguments stay
115 // alive until the FrameSerializer gets destroyed. 117 // alive until the FrameSerializer gets destroyed.
116 FrameSerializer(Deque<SerializedResource>&, Delegate&); 118 FrameSerializer(Deque<SerializedResource>&, Delegate&);
117 119
118 // Initiates the serialization of the frame. All serialized content and 120 // Initiates the serialization of the frame. All serialized content and
119 // retrieved resources are added to the Deque passed to the constructor. 121 // retrieved resources are added to the Deque passed to the constructor.
(...skipping 24 matching lines...) Expand all
144 146
145 void RetrieveResourcesForProperties(const StylePropertySet*, Document&); 147 void RetrieveResourcesForProperties(const StylePropertySet*, Document&);
146 void RetrieveResourcesForCSSValue(const CSSValue&, Document&); 148 void RetrieveResourcesForCSSValue(const CSSValue&, Document&);
147 149
148 Deque<SerializedResource>* resources_; 150 Deque<SerializedResource>* resources_;
149 HashSet<KURL> resource_urls_; 151 HashSet<KURL> resource_urls_;
150 152
151 bool is_serializing_css_; 153 bool is_serializing_css_;
152 154
153 Delegate& delegate_; 155 Delegate& delegate_;
156
157 // Variables for problem detection during serialization.
158 int total_image_count_;
159 int loaded_image_count_;
160 int total_css_count_;
161 int loaded_css_count_;
162 bool should_collect_problem_metric_;
154 }; 163 };
155 164
156 } // namespace blink 165 } // namespace blink
157 166
158 #endif // FrameSerializer_h 167 #endif // FrameSerializer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698