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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h

Issue 2642733002: Prerender: Disable prefetch if there's an appcache. (Closed)
Patch Set: clarifying comment Created 3 years, 11 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2010 Google Inc. All Rights Reserved. 3 * Copyright (C) 2010 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 static std::unique_ptr<CachedDocumentParameters> create() { 64 static std::unique_ptr<CachedDocumentParameters> create() {
65 return WTF::wrapUnique(new CachedDocumentParameters); 65 return WTF::wrapUnique(new CachedDocumentParameters);
66 } 66 }
67 67
68 bool doHtmlPreloadScanning; 68 bool doHtmlPreloadScanning;
69 bool doDocumentWritePreloadScanning; 69 bool doDocumentWritePreloadScanning;
70 Length defaultViewportMinWidth; 70 Length defaultViewportMinWidth;
71 bool viewportMetaZeroValuesQuirk; 71 bool viewportMetaZeroValuesQuirk;
72 bool viewportMetaEnabled; 72 bool viewportMetaEnabled;
73 bool isPrefetchOnly;
73 ReferrerPolicy referrerPolicy; 74 ReferrerPolicy referrerPolicy;
74 75
75 private: 76 private:
76 explicit CachedDocumentParameters(Document*); 77 explicit CachedDocumentParameters(Document*);
77 CachedDocumentParameters() = default; 78 CachedDocumentParameters() = default;
78 }; 79 };
79 80
80 class TokenPreloadScanner { 81 class TokenPreloadScanner {
81 WTF_MAKE_NONCOPYABLE(TokenPreloadScanner); 82 WTF_MAKE_NONCOPYABLE(TokenPreloadScanner);
82 USING_FAST_MALLOC(TokenPreloadScanner); 83 USING_FAST_MALLOC(TokenPreloadScanner);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 bool* isCSPMetaTag, 125 bool* isCSPMetaTag,
125 bool* likelyDocumentWriteScript); 126 bool* likelyDocumentWriteScript);
126 127
127 template <typename Token> 128 template <typename Token>
128 void updatePredictedBaseURL(const Token&); 129 void updatePredictedBaseURL(const Token&);
129 130
130 struct Checkpoint { 131 struct Checkpoint {
131 Checkpoint(const KURL& predictedBaseElementURL, 132 Checkpoint(const KURL& predictedBaseElementURL,
132 bool inStyle, 133 bool inStyle,
133 bool inScript, 134 bool inScript,
135 bool isAppCacheEnabled,
134 size_t templateCount) 136 size_t templateCount)
135 : predictedBaseElementURL(predictedBaseElementURL), 137 : predictedBaseElementURL(predictedBaseElementURL),
136 inStyle(inStyle), 138 inStyle(inStyle),
137 inScript(inScript), 139 inScript(inScript),
140 isAppCacheEnabled(isAppCacheEnabled),
138 templateCount(templateCount) {} 141 templateCount(templateCount) {}
139 142
140 KURL predictedBaseElementURL; 143 KURL predictedBaseElementURL;
141 bool inStyle; 144 bool inStyle;
142 bool inScript; 145 bool inScript;
146 bool isAppCacheEnabled;
143 size_t templateCount; 147 size_t templateCount;
144 }; 148 };
145 149
146 struct PictureData { 150 struct PictureData {
147 PictureData() : sourceSize(0.0), sourceSizeSet(false), picked(false) {} 151 PictureData() : sourceSize(0.0), sourceSizeSet(false), picked(false) {}
148 String sourceURL; 152 String sourceURL;
149 float sourceSize; 153 float sourceSize;
150 bool sourceSizeSet; 154 bool sourceSizeSet;
151 bool picked; 155 bool picked;
152 }; 156 };
153 157
154 CSSPreloadScanner m_cssScanner; 158 CSSPreloadScanner m_cssScanner;
155 const KURL m_documentURL; 159 const KURL m_documentURL;
156 KURL m_predictedBaseElementURL; 160 KURL m_predictedBaseElementURL;
157 bool m_inStyle; 161 bool m_inStyle;
158 bool m_inPicture; 162 bool m_inPicture;
159 bool m_inScript; 163 bool m_inScript;
164 bool m_isAppCacheEnabled;
160 PictureData m_pictureData; 165 PictureData m_pictureData;
161 size_t m_templateCount; 166 size_t m_templateCount;
162 std::unique_ptr<CachedDocumentParameters> m_documentParameters; 167 std::unique_ptr<CachedDocumentParameters> m_documentParameters;
163 Persistent<MediaValuesCached> m_mediaValues; 168 Persistent<MediaValuesCached> m_mediaValues;
164 ClientHintsPreferences m_clientHintsPreferences; 169 ClientHintsPreferences m_clientHintsPreferences;
165 170
166 bool m_didRewind = false; 171 bool m_didRewind = false;
167 172
168 Vector<Checkpoint> m_checkpoints; 173 Vector<Checkpoint> m_checkpoints;
169 }; 174 };
(...skipping 27 matching lines...) Expand all
197 202
198 TokenPreloadScanner m_scanner; 203 TokenPreloadScanner m_scanner;
199 SegmentedString m_source; 204 SegmentedString m_source;
200 HTMLToken m_token; 205 HTMLToken m_token;
201 std::unique_ptr<HTMLTokenizer> m_tokenizer; 206 std::unique_ptr<HTMLTokenizer> m_tokenizer;
202 }; 207 };
203 208
204 } // namespace blink 209 } // namespace blink
205 210
206 #endif 211 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698