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

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

Issue 2321503002: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Ugh. Created 4 years, 3 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 : wasScrolledByUser(false) 138 : wasScrolledByUser(false)
139 , didRestoreFromHistory(false) 139 , didRestoreFromHistory(false)
140 { 140 {
141 } 141 }
142 142
143 bool wasScrolledByUser; 143 bool wasScrolledByUser;
144 bool didRestoreFromHistory; 144 bool didRestoreFromHistory;
145 }; 145 };
146 InitialScrollState& initialScrollState() { return m_initialScrollState; } 146 InitialScrollState& initialScrollState() { return m_initialScrollState; }
147 147
148 void setWasBlockedAfterXFrameOptionsOrCSP() { m_wasBlockedAfterXFrameOptions OrCSP = true; } 148 void setWasBlockedAfterCSP() { m_wasBlockedAfterCSP = true; }
149 bool wasBlockedAfterXFrameOptionsOrCSP() { return m_wasBlockedAfterXFrameOpt ionsOrCSP; } 149 bool wasBlockedAfterCSP() { return m_wasBlockedAfterCSP; }
150 150
151 void dispatchLinkHeaderPreloads(ViewportDescriptionWrapper*, LinkLoader::Med iaPreloadPolicy); 151 void dispatchLinkHeaderPreloads(ViewportDescriptionWrapper*, LinkLoader::Med iaPreloadPolicy);
152 152
153 Resource* startPreload(Resource::Type, FetchRequest&); 153 Resource* startPreload(Resource::Type, FetchRequest&);
154 154
155 DECLARE_VIRTUAL_TRACE(); 155 DECLARE_VIRTUAL_TRACE();
156 156
157 protected: 157 protected:
158 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData&); 158 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData&);
159 159
160 void didRedirect(const KURL& oldURL, const KURL& newURL); 160 void didRedirect(const KURL& oldURL, const KURL& newURL);
161 161
162 Vector<KURL> m_redirectChain; 162 Vector<KURL> m_redirectChain;
163 163
164 private: 164 private:
165 static DocumentWriter* createWriterFor(const DocumentInit&, const AtomicStri ng& mimeType, const AtomicString& encoding, bool dispatchWindowObjectAvailable, ParserSynchronizationPolicy, const KURL& overridingURL = KURL()); 165 static DocumentWriter* createWriterFor(const DocumentInit&, const AtomicStri ng& mimeType, const AtomicString& encoding, bool dispatchWindowObjectAvailable, ParserSynchronizationPolicy, const KURL& overridingURL = KURL());
166 166
167 void ensureWriter(const AtomicString& mimeType, const KURL& overridingURL = KURL()); 167 void ensureWriter(const AtomicString& mimeType, const KURL& overridingURL = KURL());
168 void endWriting(DocumentWriter*); 168 void endWriting(DocumentWriter*);
169 169
170 FrameLoader* frameLoader() const; 170 FrameLoader* frameLoader() const;
171 171
172 void commitIfReady(); 172 void commitIfReady();
173 void commitData(const char* bytes, size_t length); 173 void commitData(const char* bytes, size_t length);
174 void clearMainResourceHandle(); 174 void clearMainResourceHandle();
175 175
176 bool maybeCreateArchive(); 176 bool maybeCreateArchive();
177 177
178 void finishedLoading(double finishTime); 178 void finishedLoading(double finishTime);
179 void cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceResponse&); 179 void cancelLoadAfterCSPDenied(const ResourceResponse&);
180 void redirectReceived(Resource*, ResourceRequest&, const ResourceResponse&) final; 180 void redirectReceived(Resource*, ResourceRequest&, const ResourceResponse&) final;
181 void responseReceived(Resource*, const ResourceResponse&, std::unique_ptr<We bDataConsumerHandle>) final; 181 void responseReceived(Resource*, const ResourceResponse&, std::unique_ptr<We bDataConsumerHandle>) final;
182 void dataReceived(Resource*, const char* data, size_t length) final; 182 void dataReceived(Resource*, const char* data, size_t length) final;
183 void processData(const char* data, size_t length); 183 void processData(const char* data, size_t length);
184 void notifyFinished(Resource*) final; 184 void notifyFinished(Resource*) final;
185 String debugName() const override { return "DocumentLoader"; } 185 String debugName() const override { return "DocumentLoader"; }
186 186
187 bool maybeLoadEmpty(); 187 bool maybeLoadEmpty();
188 188
189 bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse&); 189 bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse&);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 DocumentLoadTiming m_documentLoadTiming; 221 DocumentLoadTiming m_documentLoadTiming;
222 222
223 double m_timeOfLastDataReceived; 223 double m_timeOfLastDataReceived;
224 224
225 Member<ApplicationCacheHost> m_applicationCacheHost; 225 Member<ApplicationCacheHost> m_applicationCacheHost;
226 226
227 Member<ContentSecurityPolicy> m_contentSecurityPolicy; 227 Member<ContentSecurityPolicy> m_contentSecurityPolicy;
228 ClientHintsPreferences m_clientHintsPreferences; 228 ClientHintsPreferences m_clientHintsPreferences;
229 InitialScrollState m_initialScrollState; 229 InitialScrollState m_initialScrollState;
230 230
231 bool m_wasBlockedAfterXFrameOptionsOrCSP; 231 bool m_wasBlockedAfterCSP;
232 232
233 enum State { 233 enum State {
234 NotStarted, 234 NotStarted,
235 Provisional, 235 Provisional,
236 Committed, 236 Committed,
237 MainResourceDone, 237 MainResourceDone,
238 SentDidFinishLoad 238 SentDidFinishLoad
239 }; 239 };
240 State m_state; 240 State m_state;
241 241
242 // Used to protect against reentrancy into dataReceived(). 242 // Used to protect against reentrancy into dataReceived().
243 bool m_inDataReceived; 243 bool m_inDataReceived;
244 RefPtr<SharedBuffer> m_dataBuffer; 244 RefPtr<SharedBuffer> m_dataBuffer;
245 }; 245 };
246 246
247 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader); 247 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader);
248 248
249 } // namespace blink 249 } // namespace blink
250 250
251 #endif // DocumentLoader_h 251 #endif // DocumentLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698