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

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

Issue 2187193002: Dont bail out of preload scanning if a appcache manifest is found (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 bool shouldEvaluateForDocumentWrite(const String& source); 96 bool shouldEvaluateForDocumentWrite(const String& source);
97 bool shouldEvaluateForDocumentWrite(const HTMLToken::DataVector& source) { r eturn false; } 97 bool shouldEvaluateForDocumentWrite(const HTMLToken::DataVector& source) { r eturn false; }
98 98
99 template <typename Token> 99 template <typename Token>
100 inline void scanCommon(const Token&, const SegmentedString&, PreloadRequestS tream& requests, ViewportDescriptionWrapper*, bool* likelyDocumentWriteScript); 100 inline void scanCommon(const Token&, const SegmentedString&, PreloadRequestS tream& requests, ViewportDescriptionWrapper*, bool* likelyDocumentWriteScript);
101 101
102 template<typename Token> 102 template<typename Token>
103 void updatePredictedBaseURL(const Token&); 103 void updatePredictedBaseURL(const Token&);
104 104
105 struct Checkpoint { 105 struct Checkpoint {
106 Checkpoint(const KURL& predictedBaseElementURL, bool inStyle, bool inScr ipt, bool isAppCacheEnabled, bool isCSPEnabled, size_t templateCount) 106 Checkpoint(const KURL& predictedBaseElementURL, bool inStyle, bool inScr ipt, bool isCSPEnabled, size_t templateCount)
107 : predictedBaseElementURL(predictedBaseElementURL) 107 : predictedBaseElementURL(predictedBaseElementURL)
108 , inStyle(inStyle) 108 , inStyle(inStyle)
109 , inScript(inScript) 109 , inScript(inScript)
110 , isAppCacheEnabled(isAppCacheEnabled)
111 , isCSPEnabled(isCSPEnabled) 110 , isCSPEnabled(isCSPEnabled)
112 , templateCount(templateCount) 111 , templateCount(templateCount)
113 { 112 {
114 } 113 }
115 114
116 KURL predictedBaseElementURL; 115 KURL predictedBaseElementURL;
117 bool inStyle; 116 bool inStyle;
118 bool inScript; 117 bool inScript;
119 bool isAppCacheEnabled;
120 bool isCSPEnabled; 118 bool isCSPEnabled;
121 size_t templateCount; 119 size_t templateCount;
122 }; 120 };
123 121
124 struct PictureData { 122 struct PictureData {
125 PictureData() 123 PictureData()
126 : sourceSize(0.0) 124 : sourceSize(0.0)
127 , sourceSizeSet(false) 125 , sourceSizeSet(false)
128 , picked(false) 126 , picked(false)
129 { 127 {
130 } 128 }
131 String sourceURL; 129 String sourceURL;
132 float sourceSize; 130 float sourceSize;
133 bool sourceSizeSet; 131 bool sourceSizeSet;
134 bool picked; 132 bool picked;
135 }; 133 };
136 134
137 CSSPreloadScanner m_cssScanner; 135 CSSPreloadScanner m_cssScanner;
138 const KURL m_documentURL; 136 const KURL m_documentURL;
139 KURL m_predictedBaseElementURL; 137 KURL m_predictedBaseElementURL;
140 bool m_inStyle; 138 bool m_inStyle;
141 bool m_inPicture; 139 bool m_inPicture;
142 bool m_inScript; 140 bool m_inScript;
143 bool m_isAppCacheEnabled;
144 bool m_isCSPEnabled; 141 bool m_isCSPEnabled;
145 PictureData m_pictureData; 142 PictureData m_pictureData;
146 size_t m_templateCount; 143 size_t m_templateCount;
147 std::unique_ptr<CachedDocumentParameters> m_documentParameters; 144 std::unique_ptr<CachedDocumentParameters> m_documentParameters;
148 Persistent<MediaValuesCached> m_mediaValues; 145 Persistent<MediaValuesCached> m_mediaValues;
149 ClientHintsPreferences m_clientHintsPreferences; 146 ClientHintsPreferences m_clientHintsPreferences;
150 147
151 bool m_didRewind = false; 148 bool m_didRewind = false;
152 149
153 Vector<Checkpoint> m_checkpoints; 150 Vector<Checkpoint> m_checkpoints;
(...skipping 18 matching lines...) Expand all
172 169
173 TokenPreloadScanner m_scanner; 170 TokenPreloadScanner m_scanner;
174 SegmentedString m_source; 171 SegmentedString m_source;
175 HTMLToken m_token; 172 HTMLToken m_token;
176 std::unique_ptr<HTMLTokenizer> m_tokenizer; 173 std::unique_ptr<HTMLTokenizer> m_tokenizer;
177 }; 174 };
178 175
179 } // namespace blink 176 } // namespace blink
180 177
181 #endif 178 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698