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

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

Issue 1617043002: Introduce AncestorThrottle, which will process 'X-Frame-Options' headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@block-response
Patch Set: DCHECK. Created 4 years, 7 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 : wasScrolledByUser(false) 129 : wasScrolledByUser(false)
130 , didRestoreFromHistory(false) 130 , didRestoreFromHistory(false)
131 { 131 {
132 } 132 }
133 133
134 bool wasScrolledByUser; 134 bool wasScrolledByUser;
135 bool didRestoreFromHistory; 135 bool didRestoreFromHistory;
136 }; 136 };
137 InitialScrollState& initialScrollState() { return m_initialScrollState; } 137 InitialScrollState& initialScrollState() { return m_initialScrollState; }
138 138
139 void setWasBlockedAfterXFrameOptionsOrCSP() { m_wasBlockedAfterXFrameOptions OrCSP = true; } 139 void setWasBlockedAfterCSP() { m_wasBlockedAfterCSP = true; }
140 bool wasBlockedAfterXFrameOptionsOrCSP() { return m_wasBlockedAfterXFrameOpt ionsOrCSP; } 140 bool wasBlockedAfterCSP() { return m_wasBlockedAfterCSP; }
141 141
142 Resource* startPreload(Resource::Type, FetchRequest&); 142 Resource* startPreload(Resource::Type, FetchRequest&);
143 143
144 DECLARE_VIRTUAL_TRACE(); 144 DECLARE_VIRTUAL_TRACE();
145 145
146 protected: 146 protected:
147 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData&); 147 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData&);
148 148
149 Vector<KURL> m_redirectChain; 149 Vector<KURL> m_redirectChain;
150 150
151 private: 151 private:
152 static DocumentWriter* createWriterFor(const DocumentInit&, const AtomicStri ng& mimeType, const AtomicString& encoding, bool dispatchWindowObjectAvailable, ParserSynchronizationPolicy, const KURL& overridingURL = KURL()); 152 static DocumentWriter* createWriterFor(const DocumentInit&, const AtomicStri ng& mimeType, const AtomicString& encoding, bool dispatchWindowObjectAvailable, ParserSynchronizationPolicy, const KURL& overridingURL = KURL());
153 153
154 void ensureWriter(const AtomicString& mimeType, const KURL& overridingURL = KURL()); 154 void ensureWriter(const AtomicString& mimeType, const KURL& overridingURL = KURL());
155 void endWriting(DocumentWriter*); 155 void endWriting(DocumentWriter*);
156 156
157 FrameLoader* frameLoader() const; 157 FrameLoader* frameLoader() const;
158 158
159 void commitIfReady(); 159 void commitIfReady();
160 void commitData(const char* bytes, size_t length); 160 void commitData(const char* bytes, size_t length);
161 ResourceLoader* mainResourceLoader() const; 161 ResourceLoader* mainResourceLoader() const;
162 void clearMainResourceHandle(); 162 void clearMainResourceHandle();
163 163
164 bool maybeCreateArchive(); 164 bool maybeCreateArchive();
165 165
166 void finishedLoading(double finishTime); 166 void finishedLoading(double finishTime);
167 void cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceResponse&); 167 void cancelLoadAfterCSPDenied(const ResourceResponse&);
168 void redirectReceived(Resource*, ResourceRequest&, const ResourceResponse&) final; 168 void redirectReceived(Resource*, ResourceRequest&, const ResourceResponse&) final;
169 void responseReceived(Resource*, const ResourceResponse&, PassOwnPtr<WebData ConsumerHandle>) final; 169 void responseReceived(Resource*, const ResourceResponse&, PassOwnPtr<WebData ConsumerHandle>) final;
170 void dataReceived(Resource*, const char* data, size_t length) final; 170 void dataReceived(Resource*, const char* data, size_t length) final;
171 void processData(const char* data, size_t length); 171 void processData(const char* data, size_t length);
172 void notifyFinished(Resource*) final; 172 void notifyFinished(Resource*) final;
173 String debugName() const override { return "DocumentLoader"; } 173 String debugName() const override { return "DocumentLoader"; }
174 174
175 bool maybeLoadEmpty(); 175 bool maybeLoadEmpty();
176 176
177 bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse&); 177 bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse&);
(...skipping 29 matching lines...) Expand all
207 DocumentLoadTiming m_documentLoadTiming; 207 DocumentLoadTiming m_documentLoadTiming;
208 208
209 double m_timeOfLastDataReceived; 209 double m_timeOfLastDataReceived;
210 210
211 Member<ApplicationCacheHost> m_applicationCacheHost; 211 Member<ApplicationCacheHost> m_applicationCacheHost;
212 212
213 Member<ContentSecurityPolicy> m_contentSecurityPolicy; 213 Member<ContentSecurityPolicy> m_contentSecurityPolicy;
214 ClientHintsPreferences m_clientHintsPreferences; 214 ClientHintsPreferences m_clientHintsPreferences;
215 InitialScrollState m_initialScrollState; 215 InitialScrollState m_initialScrollState;
216 216
217 bool m_wasBlockedAfterXFrameOptionsOrCSP; 217 bool m_wasBlockedAfterCSP;
218 218
219 enum State { 219 enum State {
220 NotStarted, 220 NotStarted,
221 Provisional, 221 Provisional,
222 Committed, 222 Committed,
223 DataReceived, 223 DataReceived,
224 MainResourceDone, 224 MainResourceDone,
225 SentDidFinishLoad 225 SentDidFinishLoad
226 }; 226 };
227 State m_state; 227 State m_state;
228 228
229 // Used to protect against reentrancy into dataReceived(). 229 // Used to protect against reentrancy into dataReceived().
230 bool m_inDataReceived; 230 bool m_inDataReceived;
231 RefPtr<SharedBuffer> m_dataBuffer; 231 RefPtr<SharedBuffer> m_dataBuffer;
232 }; 232 };
233 233
234 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader); 234 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader);
235 235
236 } // namespace blink 236 } // namespace blink
237 237
238 #endif // DocumentLoader_h 238 #endif // DocumentLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698