OLD | NEW |
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 Loading... |
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; |
63 class ResourceError; | 64 class ResourceError; |
64 class ResourceResponse; | 65 class ResourceResponse; |
65 class SecurityOrigin; | 66 class SecurityOrigin; |
66 class SerializedScriptValue; | 67 class SerializedScriptValue; |
67 class SubstituteData; | 68 class SubstituteData; |
68 | 69 |
69 struct FrameLoadRequest; | 70 struct FrameLoadRequest; |
70 struct WindowFeatures; | 71 struct WindowFeatures; |
71 | 72 |
72 bool isBackForwardLoadType(FrameLoadType); | 73 bool isBackForwardLoadType(FrameLoadType); |
73 | 74 |
74 class FrameLoader { | 75 class FrameLoader { |
75 WTF_MAKE_NONCOPYABLE(FrameLoader); | 76 WTF_MAKE_NONCOPYABLE(FrameLoader); |
76 public: | 77 public: |
77 FrameLoader(LocalFrame*, FrameLoaderClient*); | 78 FrameLoader(LocalFrame*, FrameLoaderClient*); |
78 ~FrameLoader(); | 79 ~FrameLoader(); |
79 | 80 |
80 void init(); | 81 void init(); |
81 | 82 |
82 LocalFrame* frame() const { return m_frame; } | 83 LocalFrame* frame() const { return m_frame; } |
83 | 84 |
84 MixedContentChecker* mixedContentChecker() const { return &m_mixedContentChe
cker; } | 85 MixedContentChecker* mixedContentChecker() const { return &m_mixedContentChe
cker; } |
| 86 ProgressTracker& progress() const { return *m_progressTracker; } |
85 | 87 |
86 // These functions start a load. All eventually call into loadWithNavigation
Action() or loadInSameDocument(). | 88 // These functions start a load. All eventually call into loadWithNavigation
Action() or loadInSameDocument(). |
87 void load(const FrameLoadRequest&); // The entry point for non-reload, non-h
istory loads. | 89 void load(const FrameLoadRequest&); // The entry point for non-reload, non-h
istory loads. |
88 void reload(ReloadPolicy = NormalReload, const KURL& overrideURL = KURL(), c
onst AtomicString& overrideEncoding = nullAtom); | 90 void reload(ReloadPolicy = NormalReload, const KURL& overrideURL = KURL(), c
onst AtomicString& overrideEncoding = nullAtom); |
89 void loadHistoryItem(HistoryItem*, HistoryLoadType = HistoryDifferentDocumen
tLoad, ResourceRequestCachePolicy = UseProtocolCachePolicy); // The entry point
for all back/forward loads | 91 void loadHistoryItem(HistoryItem*, HistoryLoadType = HistoryDifferentDocumen
tLoad, ResourceRequestCachePolicy = UseProtocolCachePolicy); // The entry point
for all back/forward loads |
90 | 92 |
91 static void reportLocalLoadFailed(LocalFrame*, const String& url); | 93 static void reportLocalLoadFailed(LocalFrame*, const String& url); |
92 | 94 |
93 // FIXME: These are all functions which stop loads. We have too many. | 95 // FIXME: These are all functions which stop loads. We have too many. |
94 // Warning: stopAllLoaders can and will detach the LocalFrame out from under
you. All callers need to either protect the LocalFrame | 96 // Warning: stopAllLoaders can and will detach the LocalFrame out from under
you. All callers need to either protect the LocalFrame |
95 // or guarantee they won't in any way access the LocalFrame after stopAllLoa
ders returns. | 97 // or guarantee they won't in any way access the LocalFrame after stopAllLoa
ders returns. |
96 void stopAllLoaders(); | 98 void stopAllLoaders(); |
97 void stopLoading(); | 99 void stopLoading(); |
98 bool closeURL(); | 100 bool closeURL(); |
99 // FIXME: clear() is trying to do too many things. We should break it down i
nto smaller functions. | 101 // FIXME: clear() is trying to do too many things. We should break it down i
nto smaller functions. |
100 void clear(); | 102 void clear(); |
101 | 103 |
102 // Sets a timer to notify the client that the initial empty document has | 104 // Sets a timer to notify the client that the initial empty document has |
103 // been accessed, and thus it is no longer safe to show a provisional URL | 105 // been accessed, and thus it is no longer safe to show a provisional URL |
104 // above the document without risking a URL spoof. | 106 // above the document without risking a URL spoof. |
105 void didAccessInitialDocument(); | 107 void didAccessInitialDocument(); |
106 | 108 |
107 // If the initial empty document is showing and has been accessed, this | 109 // If the initial empty document is showing and has been accessed, this |
108 // cancels the timer and immediately notifies the client in cases that | 110 // cancels the timer and immediately notifies the client in cases that |
109 // waiting to notify would allow a URL spoof. | 111 // waiting to notify would allow a URL spoof. |
110 void notifyIfInitialDocumentAccessed(); | 112 void notifyIfInitialDocumentAccessed(); |
111 | 113 |
112 bool isLoading() const; | 114 bool isLoading() const; |
113 | 115 |
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 Loading... |
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 class FrameProgressTracker; | 241 OwnPtr<ProgressTracker> m_progressTracker; |
242 OwnPtr<FrameProgressTracker> m_progressTracker; | |
243 | 242 |
244 FrameState m_state; | 243 FrameState m_state; |
245 FrameLoadType m_loadType; | 244 FrameLoadType m_loadType; |
246 | 245 |
247 // Document loaders for the three phases of frame loading. Note that while | 246 // Document loaders for the three phases of frame loading. Note that while |
248 // a new request is being loaded, the old document loader may still be refer
enced. | 247 // a new request is being loaded, the old document loader may still be refer
enced. |
249 // E.g. while a new request is in the "policy" state, the old document loade
r may | 248 // E.g. while a new request is in the "policy" state, the old document loade
r may |
250 // be consulted in particular as it makes sense to imply certain settings on
the new loader. | 249 // be consulted in particular as it makes sense to imply certain settings on
the new loader. |
251 RefPtr<DocumentLoader> m_documentLoader; | 250 RefPtr<DocumentLoader> m_documentLoader; |
252 RefPtr<DocumentLoader> m_provisionalDocumentLoader; | 251 RefPtr<DocumentLoader> m_provisionalDocumentLoader; |
(...skipping 30 matching lines...) Expand all Loading... |
283 | 282 |
284 bool m_didAccessInitialDocument; | 283 bool m_didAccessInitialDocument; |
285 Timer<FrameLoader> m_didAccessInitialDocumentTimer; | 284 Timer<FrameLoader> m_didAccessInitialDocumentTimer; |
286 | 285 |
287 SandboxFlags m_forcedSandboxFlags; | 286 SandboxFlags m_forcedSandboxFlags; |
288 }; | 287 }; |
289 | 288 |
290 } // namespace WebCore | 289 } // namespace WebCore |
291 | 290 |
292 #endif // FrameLoader_h | 291 #endif // FrameLoader_h |
OLD | NEW |