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

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 (@clamy). Created 4 years 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 struct InitialScrollState { 160 struct InitialScrollState {
161 DISALLOW_NEW(); 161 DISALLOW_NEW();
162 InitialScrollState() 162 InitialScrollState()
163 : wasScrolledByUser(false), didRestoreFromHistory(false) {} 163 : wasScrolledByUser(false), didRestoreFromHistory(false) {}
164 164
165 bool wasScrolledByUser; 165 bool wasScrolledByUser;
166 bool didRestoreFromHistory; 166 bool didRestoreFromHistory;
167 }; 167 };
168 InitialScrollState& initialScrollState() { return m_initialScrollState; } 168 InitialScrollState& initialScrollState() { return m_initialScrollState; }
169 169
170 void setWasBlockedAfterXFrameOptionsOrCSP() { 170 void setWasBlockedAfterCSP() { m_wasBlockedAfterCSP = true; }
171 m_wasBlockedAfterXFrameOptionsOrCSP = true; 171 bool wasBlockedAfterCSP() { return m_wasBlockedAfterCSP; }
172 }
173 bool wasBlockedAfterXFrameOptionsOrCSP() {
174 return m_wasBlockedAfterXFrameOptionsOrCSP;
175 }
176 172
177 void dispatchLinkHeaderPreloads(ViewportDescriptionWrapper*, 173 void dispatchLinkHeaderPreloads(ViewportDescriptionWrapper*,
178 LinkLoader::MediaPreloadPolicy); 174 LinkLoader::MediaPreloadPolicy);
179 175
180 Resource* startPreload(Resource::Type, FetchRequest&); 176 Resource* startPreload(Resource::Type, FetchRequest&);
181 177
182 DECLARE_VIRTUAL_TRACE(); 178 DECLARE_VIRTUAL_TRACE();
183 179
184 protected: 180 protected:
185 DocumentLoader(LocalFrame*, 181 DocumentLoader(LocalFrame*,
(...skipping 19 matching lines...) Expand all
205 201
206 FrameLoader* frameLoader() const; 202 FrameLoader* frameLoader() const;
207 203
208 void commitIfReady(); 204 void commitIfReady();
209 void commitData(const char* bytes, size_t length); 205 void commitData(const char* bytes, size_t length);
210 void clearMainResourceHandle(); 206 void clearMainResourceHandle();
211 207
212 bool maybeCreateArchive(); 208 bool maybeCreateArchive();
213 209
214 void finishedLoading(double finishTime); 210 void finishedLoading(double finishTime);
215 void cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceResponse&); 211 void cancelLoadAfterCSPDenied(const ResourceResponse&);
216 bool redirectReceived(Resource*, 212 bool redirectReceived(Resource*,
217 const ResourceRequest&, 213 const ResourceRequest&,
218 const ResourceResponse&) final; 214 const ResourceResponse&) final;
219 void responseReceived(Resource*, 215 void responseReceived(Resource*,
220 const ResourceResponse&, 216 const ResourceResponse&,
221 std::unique_ptr<WebDataConsumerHandle>) final; 217 std::unique_ptr<WebDataConsumerHandle>) final;
222 void dataReceived(Resource*, const char* data, size_t length) final; 218 void dataReceived(Resource*, const char* data, size_t length) final;
223 void processData(const char* data, size_t length); 219 void processData(const char* data, size_t length);
224 void notifyFinished(Resource*) final; 220 void notifyFinished(Resource*) final;
225 String debugName() const override { return "DocumentLoader"; } 221 String debugName() const override { return "DocumentLoader"; }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 DocumentLoadTiming m_documentLoadTiming; 257 DocumentLoadTiming m_documentLoadTiming;
262 258
263 double m_timeOfLastDataReceived; 259 double m_timeOfLastDataReceived;
264 260
265 Member<ApplicationCacheHost> m_applicationCacheHost; 261 Member<ApplicationCacheHost> m_applicationCacheHost;
266 262
267 Member<ContentSecurityPolicy> m_contentSecurityPolicy; 263 Member<ContentSecurityPolicy> m_contentSecurityPolicy;
268 ClientHintsPreferences m_clientHintsPreferences; 264 ClientHintsPreferences m_clientHintsPreferences;
269 InitialScrollState m_initialScrollState; 265 InitialScrollState m_initialScrollState;
270 266
271 bool m_wasBlockedAfterXFrameOptionsOrCSP; 267 bool m_wasBlockedAfterCSP;
272 268
273 enum State { 269 enum State {
274 NotStarted, 270 NotStarted,
275 Provisional, 271 Provisional,
276 Committed, 272 Committed,
277 MainResourceDone, 273 MainResourceDone,
278 SentDidFinishLoad 274 SentDidFinishLoad
279 }; 275 };
280 State m_state; 276 State m_state;
281 277
282 // Used to protect against reentrancy into dataReceived(). 278 // Used to protect against reentrancy into dataReceived().
283 bool m_inDataReceived; 279 bool m_inDataReceived;
284 RefPtr<SharedBuffer> m_dataBuffer; 280 RefPtr<SharedBuffer> m_dataBuffer;
285 }; 281 };
286 282
287 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader); 283 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader);
288 284
289 } // namespace blink 285 } // namespace blink
290 286
291 #endif // DocumentLoader_h 287 #endif // DocumentLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698