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

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

Issue 2653673006: Move loadType() to DocumentLoader (Closed)
Patch Set: Move loadType() to DocumentLoader Created 3 years, 10 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, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
4 * (http://www.torchmobile.com/) 4 * (http://www.torchmobile.com/)
5 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
6 * Copyright (C) 2011 Google Inc. All rights reserved. 6 * Copyright (C) 2011 Google Inc. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 return m_provisionalDocumentLoader.get(); 122 return m_provisionalDocumentLoader.get();
123 } 123 }
124 124
125 void loadFailed(DocumentLoader*, const ResourceError&); 125 void loadFailed(DocumentLoader*, const ResourceError&);
126 126
127 bool isLoadingMainFrame() const; 127 bool isLoadingMainFrame() const;
128 128
129 bool shouldTreatURLAsSameAsCurrent(const KURL&) const; 129 bool shouldTreatURLAsSameAsCurrent(const KURL&) const;
130 bool shouldTreatURLAsSrcdocDocument(const KURL&) const; 130 bool shouldTreatURLAsSrcdocDocument(const KURL&) const;
131 131
132 FrameLoadType loadType() const;
133 void setLoadType(FrameLoadType loadType) { m_loadType = loadType; }
134
135 FrameLoaderClient* client() const; 132 FrameLoaderClient* client() const;
136 133
137 void setDefersLoading(bool); 134 void setDefersLoading(bool);
138 135
139 void didExplicitOpen(); 136 void didExplicitOpen();
140 137
141 // Callbacks from DocumentWriter 138 // Callbacks from DocumentWriter
142 void didInstallNewDocument(bool dispatchWindowObjectAvailable); 139 void didInstallNewDocument(bool dispatchWindowObjectAvailable);
143 140
144 void didBeginDocument(); 141 void didBeginDocument();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 void saveScrollState(); 200 void saveScrollState();
204 201
205 void restoreScrollPositionAndViewState(); 202 void restoreScrollPositionAndViewState();
206 203
207 bool shouldContinueForNavigationPolicy(const ResourceRequest&, 204 bool shouldContinueForNavigationPolicy(const ResourceRequest&,
208 const SubstituteData&, 205 const SubstituteData&,
209 DocumentLoader*, 206 DocumentLoader*,
210 ContentSecurityPolicyDisposition, 207 ContentSecurityPolicyDisposition,
211 NavigationType, 208 NavigationType,
212 NavigationPolicy, 209 NavigationPolicy,
213 bool shouldReplaceCurrentEntry, 210 FrameLoadType,
214 bool isClientRedirect, 211 bool isClientRedirect,
215 HTMLFormElement*); 212 HTMLFormElement*);
216 213
217 // PlzNavigate: Navigations handled by the client are treated as 214 // PlzNavigate: Navigations handled by the client are treated as
218 // provisional navigations. 215 // provisional navigations.
219 bool hasProvisionalNavigation() const { 216 bool hasProvisionalNavigation() const {
220 return provisionalDocumentLoader() || m_isNavigationHandledByClient; 217 return provisionalDocumentLoader() || m_isNavigationHandledByClient;
221 } 218 }
222 219
223 DECLARE_TRACE(); 220 DECLARE_TRACE();
224 221
225 static void setReferrerForFrameRequest(FrameLoadRequest&); 222 static void setReferrerForFrameRequest(FrameLoadRequest&);
226 223
227 private: 224 private:
228 void checkTimerFired(TimerBase*); 225 void checkTimerFired(TimerBase*);
229 226
230 bool prepareRequestForThisFrame(FrameLoadRequest&); 227 bool prepareRequestForThisFrame(FrameLoadRequest&);
231 FrameLoadType determineFrameLoadType(const FrameLoadRequest&); 228 FrameLoadType determineFrameLoadType(const FrameLoadRequest&);
232 229
233 SubstituteData defaultSubstituteDataForURL(const KURL&); 230 SubstituteData defaultSubstituteDataForURL(const KURL&);
234 231
235 bool shouldPerformFragmentNavigation(bool isFormSubmission, 232 bool shouldPerformFragmentNavigation(bool isFormSubmission,
236 const String& httpMethod, 233 const String& httpMethod,
237 FrameLoadType, 234 FrameLoadType,
238 const KURL&); 235 const KURL&);
239 void processFragment(const KURL&, LoadStartType); 236 void processFragment(const KURL&, FrameLoadType, LoadStartType);
240 237
241 void startLoad(FrameLoadRequest&, FrameLoadType, NavigationPolicy); 238 void startLoad(FrameLoadRequest&, FrameLoadType, NavigationPolicy);
242 239
243 enum class HistoryNavigationType { DifferentDocument, Fragment, HistoryApi }; 240 enum class HistoryNavigationType { DifferentDocument, Fragment, HistoryApi };
244 void setHistoryItemStateForCommit(FrameLoadType, 241 void setHistoryItemStateForCommit(FrameLoadType,
245 HistoryCommitType, 242 HistoryCommitType,
246 HistoryNavigationType); 243 HistoryNavigationType);
247 244
248 void loadInSameDocument(const KURL&, 245 void loadInSameDocument(const KURL&,
249 PassRefPtr<SerializedScriptValue> stateObject, 246 PassRefPtr<SerializedScriptValue> stateObject,
250 FrameLoadType, 247 FrameLoadType,
251 HistoryLoadType, 248 HistoryLoadType,
252 ClientRedirectPolicy, 249 ClientRedirectPolicy,
253 Document*); 250 Document*);
251 void restoreScrollPositionAndViewStateForLoadType(FrameLoadType);
254 252
255 void scheduleCheckCompleted(); 253 void scheduleCheckCompleted();
256 254
257 void detachDocumentLoader(Member<DocumentLoader>&); 255 void detachDocumentLoader(Member<DocumentLoader>&);
258 256
259 void upgradeInsecureRequest(ResourceRequest&, Document*) const; 257 void upgradeInsecureRequest(ResourceRequest&, Document*) const;
260 258
261 std::unique_ptr<TracedValue> toTracedValue() const; 259 std::unique_ptr<TracedValue> toTracedValue() const;
262 void takeObjectSnapshot() const; 260 void takeObjectSnapshot() const;
263 261
264 Member<LocalFrame> m_frame; 262 Member<LocalFrame> m_frame;
265 AtomicString m_requiredCSP; 263 AtomicString m_requiredCSP;
266 264
267 // FIXME: These should be std::unique_ptr<T> to reduce build times and 265 // FIXME: These should be std::unique_ptr<T> to reduce build times and
268 // simplify header dependencies unless performance testing proves otherwise. 266 // simplify header dependencies unless performance testing proves otherwise.
269 // Some of these could be lazily created for memory savings on devices. 267 // Some of these could be lazily created for memory savings on devices.
270 mutable FrameLoaderStateMachine m_stateMachine; 268 mutable FrameLoaderStateMachine m_stateMachine;
271 269
272 Member<ProgressTracker> m_progressTracker; 270 Member<ProgressTracker> m_progressTracker;
273 271
274 FrameLoadType m_loadType;
275
276 // Document loaders for the three phases of frame loading. Note that while a 272 // Document loaders for the three phases of frame loading. Note that while a
277 // new request is being loaded, the old document loader may still be 273 // new request is being loaded, the old document loader may still be
278 // referenced. E.g. while a new request is in the "policy" state, the old 274 // referenced. E.g. while a new request is in the "policy" state, the old
279 // document loader may be consulted in particular as it makes sense to imply 275 // document loader may be consulted in particular as it makes sense to imply
280 // certain settings on the new loader. 276 // certain settings on the new loader.
281 Member<DocumentLoader> m_documentLoader; 277 Member<DocumentLoader> m_documentLoader;
282 Member<DocumentLoader> m_provisionalDocumentLoader; 278 Member<DocumentLoader> m_provisionalDocumentLoader;
283 279
284 Member<HistoryItem> m_currentItem; 280 Member<HistoryItem> m_currentItem;
285 Member<HistoryItem> m_provisionalItem; 281 Member<HistoryItem> m_provisionalItem;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 SandboxFlags m_forcedSandboxFlags; 318 SandboxFlags m_forcedSandboxFlags;
323 319
324 bool m_dispatchingDidClearWindowObjectInMainWorld; 320 bool m_dispatchingDidClearWindowObjectInMainWorld;
325 bool m_protectProvisionalLoader; 321 bool m_protectProvisionalLoader;
326 bool m_isNavigationHandledByClient; 322 bool m_isNavigationHandledByClient;
327 }; 323 };
328 324
329 } // namespace blink 325 } // namespace blink
330 326
331 #endif // FrameLoader_h 327 #endif // FrameLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698