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

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

Issue 215533004: Revert of Make start/stop loading notifications per-frame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/FrameFetchContext.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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. (http://www.t orchmobile.com/) 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
4 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
5 * Copyright (C) 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2011 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 class DOMWrapperWorld; 53 class DOMWrapperWorld;
54 class DocumentLoader; 54 class DocumentLoader;
55 class Event; 55 class Event;
56 class FetchContext; 56 class FetchContext;
57 class FormState; 57 class FormState;
58 class FormSubmission; 58 class FormSubmission;
59 class FrameLoaderClient; 59 class FrameLoaderClient;
60 class IconController; 60 class IconController;
61 class NavigationAction; 61 class NavigationAction;
62 class Page; 62 class Page;
63 class ProgressTracker;
64 class ResourceError; 63 class ResourceError;
65 class ResourceResponse; 64 class ResourceResponse;
66 class SecurityOrigin; 65 class SecurityOrigin;
67 class SerializedScriptValue; 66 class SerializedScriptValue;
68 class SubstituteData; 67 class SubstituteData;
69 68
70 struct FrameLoadRequest; 69 struct FrameLoadRequest;
71 struct WindowFeatures; 70 struct WindowFeatures;
72 71
73 bool isBackForwardLoadType(FrameLoadType); 72 bool isBackForwardLoadType(FrameLoadType);
74 73
75 class FrameLoader { 74 class FrameLoader {
76 WTF_MAKE_NONCOPYABLE(FrameLoader); 75 WTF_MAKE_NONCOPYABLE(FrameLoader);
77 public: 76 public:
78 FrameLoader(LocalFrame*, FrameLoaderClient*); 77 FrameLoader(LocalFrame*, FrameLoaderClient*);
79 ~FrameLoader(); 78 ~FrameLoader();
80 79
81 void init(); 80 void init();
82 81
83 LocalFrame* frame() const { return m_frame; } 82 LocalFrame* frame() const { return m_frame; }
84 83
85 MixedContentChecker* mixedContentChecker() const { return &m_mixedContentChe cker; } 84 MixedContentChecker* mixedContentChecker() const { return &m_mixedContentChe cker; }
86 ProgressTracker& progress() const { return *m_progressTracker; }
87 85
88 // These functions start a load. All eventually call into loadWithNavigation Action() or loadInSameDocument(). 86 // These functions start a load. All eventually call into loadWithNavigation Action() or loadInSameDocument().
89 void load(const FrameLoadRequest&); // The entry point for non-reload, non-h istory loads. 87 void load(const FrameLoadRequest&); // The entry point for non-reload, non-h istory loads.
90 void reload(ReloadPolicy = NormalReload, const KURL& overrideURL = KURL(), c onst AtomicString& overrideEncoding = nullAtom); 88 void reload(ReloadPolicy = NormalReload, const KURL& overrideURL = KURL(), c onst AtomicString& overrideEncoding = nullAtom);
91 void loadHistoryItem(HistoryItem*, HistoryLoadType = HistoryDifferentDocumen tLoad, ResourceRequestCachePolicy = UseProtocolCachePolicy); // The entry point for all back/forward loads 89 void loadHistoryItem(HistoryItem*, HistoryLoadType = HistoryDifferentDocumen tLoad, ResourceRequestCachePolicy = UseProtocolCachePolicy); // The entry point for all back/forward loads
92 90
93 static void reportLocalLoadFailed(LocalFrame*, const String& url); 91 static void reportLocalLoadFailed(LocalFrame*, const String& url);
94 92
95 // FIXME: These are all functions which stop loads. We have too many. 93 // FIXME: These are all functions which stop loads. We have too many.
96 // Warning: stopAllLoaders can and will detach the LocalFrame out from under you. All callers need to either protect the LocalFrame 94 // Warning: stopAllLoaders can and will detach the LocalFrame out from under you. All callers need to either protect the LocalFrame
97 // or guarantee they won't in any way access the LocalFrame after stopAllLoa ders returns. 95 // or guarantee they won't in any way access the LocalFrame after stopAllLoa ders returns.
98 void stopAllLoaders(); 96 void stopAllLoaders();
99 void stopLoading(); 97 void stopLoading();
100 bool closeURL(); 98 bool closeURL();
101 // FIXME: clear() is trying to do too many things. We should break it down i nto smaller functions. 99 // FIXME: clear() is trying to do too many things. We should break it down i nto smaller functions.
102 void clear(); 100 void clear();
103 101
104 // Sets a timer to notify the client that the initial empty document has 102 // Sets a timer to notify the client that the initial empty document has
105 // been accessed, and thus it is no longer safe to show a provisional URL 103 // been accessed, and thus it is no longer safe to show a provisional URL
106 // above the document without risking a URL spoof. 104 // above the document without risking a URL spoof.
107 void didAccessInitialDocument(); 105 void didAccessInitialDocument();
108 106
109 // If the initial empty document is showing and has been accessed, this 107 // If the initial empty document is showing and has been accessed, this
110 // cancels the timer and immediately notifies the client in cases that 108 // cancels the timer and immediately notifies the client in cases that
111 // waiting to notify would allow a URL spoof. 109 // waiting to notify would allow a URL spoof.
112 void notifyIfInitialDocumentAccessed(); 110 void notifyIfInitialDocumentAccessed();
113 111
114 bool isLoading() const; 112 bool isLoading() const;
115 113
114 int numPendingOrLoadingRequests(bool recurse) const;
115
116 DocumentLoader* documentLoader() const { return m_documentLoader.get(); } 116 DocumentLoader* documentLoader() const { return m_documentLoader.get(); }
117 DocumentLoader* policyDocumentLoader() const { return m_policyDocumentLoader .get(); } 117 DocumentLoader* policyDocumentLoader() const { return m_policyDocumentLoader .get(); }
118 DocumentLoader* provisionalDocumentLoader() const { return m_provisionalDocu mentLoader.get(); } 118 DocumentLoader* provisionalDocumentLoader() const { return m_provisionalDocu mentLoader.get(); }
119 FrameState state() const { return m_state; } 119 FrameState state() const { return m_state; }
120 FetchContext& fetchContext() const { return *m_fetchContext; } 120 FetchContext& fetchContext() const { return *m_fetchContext; }
121 121
122 void receivedMainResourceError(const ResourceError&); 122 void receivedMainResourceError(const ResourceError&);
123 123
124 bool isLoadingMainFrame() const; 124 bool isLoadingMainFrame() const;
125 125
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 LocalFrame* m_frame; 232 LocalFrame* m_frame;
233 FrameLoaderClient* m_client; 233 FrameLoaderClient* m_client;
234 234
235 // FIXME: These should be OwnPtr<T> to reduce build times and simplify 235 // FIXME: These should be OwnPtr<T> to reduce build times and simplify
236 // header dependencies unless performance testing proves otherwise. 236 // header dependencies unless performance testing proves otherwise.
237 // Some of these could be lazily created for memory savings on devices. 237 // Some of these could be lazily created for memory savings on devices.
238 mutable FrameLoaderStateMachine m_stateMachine; 238 mutable FrameLoaderStateMachine m_stateMachine;
239 mutable MixedContentChecker m_mixedContentChecker; 239 mutable MixedContentChecker m_mixedContentChecker;
240 240
241 OwnPtr<ProgressTracker> m_progressTracker; 241 class FrameProgressTracker;
242 OwnPtr<FrameProgressTracker> m_progressTracker;
242 243
243 FrameState m_state; 244 FrameState m_state;
244 FrameLoadType m_loadType; 245 FrameLoadType m_loadType;
245 246
246 // Document loaders for the three phases of frame loading. Note that while 247 // Document loaders for the three phases of frame loading. Note that while
247 // a new request is being loaded, the old document loader may still be refer enced. 248 // a new request is being loaded, the old document loader may still be refer enced.
248 // E.g. while a new request is in the "policy" state, the old document loade r may 249 // E.g. while a new request is in the "policy" state, the old document loade r may
249 // be consulted in particular as it makes sense to imply certain settings on the new loader. 250 // be consulted in particular as it makes sense to imply certain settings on the new loader.
250 RefPtr<DocumentLoader> m_documentLoader; 251 RefPtr<DocumentLoader> m_documentLoader;
251 RefPtr<DocumentLoader> m_provisionalDocumentLoader; 252 RefPtr<DocumentLoader> m_provisionalDocumentLoader;
(...skipping 30 matching lines...) Expand all
282 283
283 bool m_didAccessInitialDocument; 284 bool m_didAccessInitialDocument;
284 Timer<FrameLoader> m_didAccessInitialDocumentTimer; 285 Timer<FrameLoader> m_didAccessInitialDocumentTimer;
285 286
286 SandboxFlags m_forcedSandboxFlags; 287 SandboxFlags m_forcedSandboxFlags;
287 }; 288 };
288 289
289 } // namespace WebCore 290 } // namespace WebCore
290 291
291 #endif // FrameLoader_h 292 #endif // FrameLoader_h
OLDNEW
« no previous file with comments | « Source/core/loader/FrameFetchContext.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698