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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.h

Issue 2488743003: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Addressed comments (@alexmos #2) Created 3 years, 12 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) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 struct InitialScrollState { 161 struct InitialScrollState {
162 DISALLOW_NEW(); 162 DISALLOW_NEW();
163 InitialScrollState() 163 InitialScrollState()
164 : wasScrolledByUser(false), didRestoreFromHistory(false) {} 164 : wasScrolledByUser(false), didRestoreFromHistory(false) {}
165 165
166 bool wasScrolledByUser; 166 bool wasScrolledByUser;
167 bool didRestoreFromHistory; 167 bool didRestoreFromHistory;
168 }; 168 };
169 InitialScrollState& initialScrollState() { return m_initialScrollState; } 169 InitialScrollState& initialScrollState() { return m_initialScrollState; }
170 170
171 void setWasBlockedAfterXFrameOptionsOrCSP() { 171 void setWasBlockedAfterCSP() { m_wasBlockedAfterCSP = true; }
172 m_wasBlockedAfterXFrameOptionsOrCSP = true; 172 bool wasBlockedAfterCSP() { return m_wasBlockedAfterCSP; }
173 }
174 bool wasBlockedAfterXFrameOptionsOrCSP() {
175 return m_wasBlockedAfterXFrameOptionsOrCSP;
176 }
177 173
178 void dispatchLinkHeaderPreloads(ViewportDescriptionWrapper*, 174 void dispatchLinkHeaderPreloads(ViewportDescriptionWrapper*,
179 LinkLoader::MediaPreloadPolicy); 175 LinkLoader::MediaPreloadPolicy);
180 176
181 Resource* startPreload(Resource::Type, FetchRequest&); 177 Resource* startPreload(Resource::Type, FetchRequest&);
182 178
183 DECLARE_VIRTUAL_TRACE(); 179 DECLARE_VIRTUAL_TRACE();
184 180
185 protected: 181 protected:
186 DocumentLoader(LocalFrame*, 182 DocumentLoader(LocalFrame*,
(...skipping 19 matching lines...) Expand all
206 202
207 FrameLoader* frameLoader() const; 203 FrameLoader* frameLoader() const;
208 204
209 void commitIfReady(); 205 void commitIfReady();
210 void commitData(const char* bytes, size_t length); 206 void commitData(const char* bytes, size_t length);
211 void clearMainResourceHandle(); 207 void clearMainResourceHandle();
212 208
213 bool maybeCreateArchive(); 209 bool maybeCreateArchive();
214 210
215 void finishedLoading(double finishTime); 211 void finishedLoading(double finishTime);
216 void cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceResponse&); 212 void cancelLoadAfterCSPDenied(const ResourceResponse&);
217 bool redirectReceived(Resource*, 213 bool redirectReceived(Resource*,
218 const ResourceRequest&, 214 const ResourceRequest&,
219 const ResourceResponse&) final; 215 const ResourceResponse&) final;
220 void responseReceived(Resource*, 216 void responseReceived(Resource*,
221 const ResourceResponse&, 217 const ResourceResponse&,
222 std::unique_ptr<WebDataConsumerHandle>) final; 218 std::unique_ptr<WebDataConsumerHandle>) final;
223 void dataReceived(Resource*, const char* data, size_t length) final; 219 void dataReceived(Resource*, const char* data, size_t length) final;
224 void processData(const char* data, size_t length); 220 void processData(const char* data, size_t length);
225 void notifyFinished(Resource*) final; 221 void notifyFinished(Resource*) final;
226 String debugName() const override { return "DocumentLoader"; } 222 String debugName() const override { return "DocumentLoader"; }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 DocumentLoadTiming m_documentLoadTiming; 258 DocumentLoadTiming m_documentLoadTiming;
263 259
264 double m_timeOfLastDataReceived; 260 double m_timeOfLastDataReceived;
265 261
266 Member<ApplicationCacheHost> m_applicationCacheHost; 262 Member<ApplicationCacheHost> m_applicationCacheHost;
267 263
268 Member<ContentSecurityPolicy> m_contentSecurityPolicy; 264 Member<ContentSecurityPolicy> m_contentSecurityPolicy;
269 ClientHintsPreferences m_clientHintsPreferences; 265 ClientHintsPreferences m_clientHintsPreferences;
270 InitialScrollState m_initialScrollState; 266 InitialScrollState m_initialScrollState;
271 267
272 bool m_wasBlockedAfterXFrameOptionsOrCSP; 268 bool m_wasBlockedAfterCSP;
273 269
274 enum State { 270 enum State {
275 NotStarted, 271 NotStarted,
276 Provisional, 272 Provisional,
277 Committed, 273 Committed,
278 MainResourceDone, 274 MainResourceDone,
279 SentDidFinishLoad 275 SentDidFinishLoad
280 }; 276 };
281 State m_state; 277 State m_state;
282 278
283 // Used to protect against reentrancy into dataReceived(). 279 // Used to protect against reentrancy into dataReceived().
284 bool m_inDataReceived; 280 bool m_inDataReceived;
285 RefPtr<SharedBuffer> m_dataBuffer; 281 RefPtr<SharedBuffer> m_dataBuffer;
286 }; 282 };
287 283
288 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader); 284 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader);
289 285
290 } // namespace blink 286 } // namespace blink
291 287
292 #endif // DocumentLoader_h 288 #endif // DocumentLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698