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

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

Issue 2694013005: Cleanup blink-side PlzNavigate logic (Closed)
Patch Set: Rebase Created 3 years, 9 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 PassRefPtr<SerializedScriptValue>, 195 PassRefPtr<SerializedScriptValue>,
196 HistoryScrollRestorationType, 196 HistoryScrollRestorationType,
197 FrameLoadType, 197 FrameLoadType,
198 Document*); 198 Document*);
199 199
200 HistoryItem* currentItem() const { return m_currentItem.get(); } 200 HistoryItem* currentItem() const { return m_currentItem.get(); }
201 void saveScrollState(); 201 void saveScrollState();
202 202
203 void restoreScrollPositionAndViewState(); 203 void restoreScrollPositionAndViewState();
204 204
205 bool shouldContinueForNavigationPolicy(const ResourceRequest&, 205 // The navigation should only be continued immediately in this frame if this
206 const SubstituteData&, 206 // returns NavigationPolicyCurrentTab.
207 DocumentLoader*, 207 NavigationPolicy shouldContinueForNavigationPolicy(
208 ContentSecurityPolicyDisposition, 208 const ResourceRequest&,
209 NavigationType, 209 const SubstituteData&,
210 NavigationPolicy, 210 DocumentLoader*,
211 FrameLoadType, 211 ContentSecurityPolicyDisposition,
212 bool isClientRedirect, 212 NavigationType,
213 HTMLFormElement*); 213 NavigationPolicy,
214 FrameLoadType,
215 bool isClientRedirect,
216 HTMLFormElement*);
214 217
215 // PlzNavigate: Navigations handled by the client are treated as 218 // Note: When a PlzNavigtate navigation is handled by the client, we will
216 // provisional navigations. 219 // have created a dummy provisional DocumentLoader, so this will return true
217 bool hasProvisionalNavigation() const { 220 // while the client handles the navigation.
218 return provisionalDocumentLoader() || m_isNavigationHandledByClient; 221 bool hasProvisionalNavigation() const { return provisionalDocumentLoader(); }
219 }
220
221 void clearNavigationHandledByClient();
222 222
223 DECLARE_TRACE(); 223 DECLARE_TRACE();
224 224
225 static void setReferrerForFrameRequest(FrameLoadRequest&); 225 static void setReferrerForFrameRequest(FrameLoadRequest&);
226 226
227 private: 227 private:
228 void checkTimerFired(TimerBase*); 228 void checkTimerFired(TimerBase*);
229 229
230 bool prepareRequestForThisFrame(FrameLoadRequest&); 230 bool prepareRequestForThisFrame(FrameLoadRequest&);
231 FrameLoadType determineFrameLoadType(const FrameLoadRequest&); 231 FrameLoadType determineFrameLoadType(const FrameLoadRequest&);
232 232
233 SubstituteData defaultSubstituteDataForURL(const KURL&); 233 SubstituteData defaultSubstituteDataForURL(const KURL&);
234 234
235 bool shouldPerformFragmentNavigation(bool isFormSubmission, 235 bool shouldPerformFragmentNavigation(bool isFormSubmission,
236 const String& httpMethod, 236 const String& httpMethod,
237 FrameLoadType, 237 FrameLoadType,
238 const KURL&); 238 const KURL&);
239 void processFragment(const KURL&, FrameLoadType, LoadStartType); 239 void processFragment(const KURL&, FrameLoadType, LoadStartType);
240 240
241 bool checkLoadCanStart(FrameLoadRequest&, 241 NavigationPolicy checkLoadCanStart(FrameLoadRequest&,
242 FrameLoadType, 242 FrameLoadType,
243 NavigationPolicy, 243 NavigationPolicy,
244 NavigationType); 244 NavigationType);
245 void startLoad(FrameLoadRequest&, FrameLoadType, NavigationPolicy); 245 void startLoad(FrameLoadRequest&, FrameLoadType, NavigationPolicy);
246 246
247 enum class HistoryNavigationType { DifferentDocument, Fragment, HistoryApi }; 247 enum class HistoryNavigationType { DifferentDocument, Fragment, HistoryApi };
248 void setHistoryItemStateForCommit(FrameLoadType, 248 void setHistoryItemStateForCommit(FrameLoadType,
249 HistoryCommitType, 249 HistoryCommitType,
250 HistoryNavigationType); 250 HistoryNavigationType);
251 251
252 void loadInSameDocument(const KURL&, 252 void loadInSameDocument(const KURL&,
253 PassRefPtr<SerializedScriptValue> stateObject, 253 PassRefPtr<SerializedScriptValue> stateObject,
254 FrameLoadType, 254 FrameLoadType,
255 HistoryLoadType, 255 HistoryLoadType,
256 ClientRedirectPolicy, 256 ClientRedirectPolicy,
257 Document*); 257 Document*);
258 void restoreScrollPositionAndViewStateForLoadType(FrameLoadType); 258 void restoreScrollPositionAndViewStateForLoadType(FrameLoadType);
259 259
260 void scheduleCheckCompleted(); 260 void scheduleCheckCompleted();
261 261
262 void detachDocumentLoader(Member<DocumentLoader>&); 262 void detachDocumentLoader(Member<DocumentLoader>&);
263 263
264 void upgradeInsecureRequest(ResourceRequest&, Document*) const; 264 void upgradeInsecureRequest(ResourceRequest&, Document*) const;
265 265
266 std::unique_ptr<TracedValue> toTracedValue() const; 266 std::unique_ptr<TracedValue> toTracedValue() const;
267 void takeObjectSnapshot() const; 267 void takeObjectSnapshot() const;
268 268
269 DocumentLoader* createDocumentLoader(const ResourceRequest&, 269 DocumentLoader* createDocumentLoader(const ResourceRequest&,
270 const FrameLoadRequest&, 270 const FrameLoadRequest&,
271 FrameLoadType, 271 FrameLoadType,
272 NavigationType); 272 NavigationType);
273 273
274 void setNavigationHandledByClient();
275
276 Member<LocalFrame> m_frame; 274 Member<LocalFrame> m_frame;
277 AtomicString m_requiredCSP; 275 AtomicString m_requiredCSP;
278 276
279 // FIXME: These should be std::unique_ptr<T> to reduce build times and 277 // FIXME: These should be std::unique_ptr<T> to reduce build times and
280 // simplify header dependencies unless performance testing proves otherwise. 278 // simplify header dependencies unless performance testing proves otherwise.
281 // Some of these could be lazily created for memory savings on devices. 279 // Some of these could be lazily created for memory savings on devices.
282 mutable FrameLoaderStateMachine m_stateMachine; 280 mutable FrameLoaderStateMachine m_stateMachine;
283 281
284 Member<ProgressTracker> m_progressTracker; 282 Member<ProgressTracker> m_progressTracker;
285 283
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 Member<DeferredHistoryLoad> m_deferredHistoryLoad; 324 Member<DeferredHistoryLoad> m_deferredHistoryLoad;
327 325
328 bool m_inStopAllLoaders; 326 bool m_inStopAllLoaders;
329 327
330 TaskRunnerTimer<FrameLoader> m_checkTimer; 328 TaskRunnerTimer<FrameLoader> m_checkTimer;
331 329
332 SandboxFlags m_forcedSandboxFlags; 330 SandboxFlags m_forcedSandboxFlags;
333 331
334 bool m_dispatchingDidClearWindowObjectInMainWorld; 332 bool m_dispatchingDidClearWindowObjectInMainWorld;
335 bool m_protectProvisionalLoader; 333 bool m_protectProvisionalLoader;
336 bool m_isNavigationHandledByClient;
337 }; 334 };
338 335
339 } // namespace blink 336 } // namespace blink
340 337
341 #endif // FrameLoader_h 338 #endif // FrameLoader_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698