OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
5 * Copyright (C) 2009 Adam Barth. All rights reserved. | 5 * Copyright (C) 2009 Adam Barth. 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 : ScheduledNavigation(delay, lockBackForwardList, isLocationChange) | 101 : ScheduledNavigation(delay, lockBackForwardList, isLocationChange) |
102 , m_originDocument(originDocument) | 102 , m_originDocument(originDocument) |
103 , m_url(url) | 103 , m_url(url) |
104 , m_referrer(referrer) | 104 , m_referrer(referrer) |
105 , m_shouldCheckMainWorldContentSecurityPolicy(CheckContentSecurityPolicy
) | 105 , m_shouldCheckMainWorldContentSecurityPolicy(CheckContentSecurityPolicy
) |
106 { | 106 { |
107 if (ContentSecurityPolicy::shouldBypassMainWorld(originDocument)) | 107 if (ContentSecurityPolicy::shouldBypassMainWorld(originDocument)) |
108 m_shouldCheckMainWorldContentSecurityPolicy = DoNotCheckContentSecur
ityPolicy; | 108 m_shouldCheckMainWorldContentSecurityPolicy = DoNotCheckContentSecur
ityPolicy; |
109 } | 109 } |
110 | 110 |
111 virtual void fire(LocalFrame* frame) OVERRIDE | 111 virtual void fire(LocalFrame* frame) override |
112 { | 112 { |
113 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 113 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
114 FrameLoadRequest request(m_originDocument.get(), ResourceRequest(KURL(Pa
rsedURLString, m_url), m_referrer), "_self", m_shouldCheckMainWorldContentSecuri
tyPolicy); | 114 FrameLoadRequest request(m_originDocument.get(), ResourceRequest(KURL(Pa
rsedURLString, m_url), m_referrer), "_self", m_shouldCheckMainWorldContentSecuri
tyPolicy); |
115 request.setLockBackForwardList(lockBackForwardList()); | 115 request.setLockBackForwardList(lockBackForwardList()); |
116 request.setClientRedirect(ClientRedirect); | 116 request.setClientRedirect(ClientRedirect); |
117 frame->loader().load(request); | 117 frame->loader().load(request); |
118 } | 118 } |
119 | 119 |
120 Document* originDocument() const { return m_originDocument.get(); } | 120 Document* originDocument() const { return m_originDocument.get(); } |
121 String url() const { return m_url; } | 121 String url() const { return m_url; } |
122 const Referrer& referrer() const { return m_referrer; } | 122 const Referrer& referrer() const { return m_referrer; } |
123 | 123 |
124 private: | 124 private: |
125 RefPtrWillBePersistent<Document> m_originDocument; | 125 RefPtrWillBePersistent<Document> m_originDocument; |
126 String m_url; | 126 String m_url; |
127 Referrer m_referrer; | 127 Referrer m_referrer; |
128 ContentSecurityPolicyCheck m_shouldCheckMainWorldContentSecurityPolicy; | 128 ContentSecurityPolicyCheck m_shouldCheckMainWorldContentSecurityPolicy; |
129 }; | 129 }; |
130 | 130 |
131 class ScheduledRedirect FINAL : public ScheduledURLNavigation { | 131 class ScheduledRedirect final : public ScheduledURLNavigation { |
132 public: | 132 public: |
133 ScheduledRedirect(double delay, Document* originDocument, const String& url,
bool lockBackForwardList) | 133 ScheduledRedirect(double delay, Document* originDocument, const String& url,
bool lockBackForwardList) |
134 : ScheduledURLNavigation(delay, originDocument, url, Referrer(), lockBac
kForwardList, false) | 134 : ScheduledURLNavigation(delay, originDocument, url, Referrer(), lockBac
kForwardList, false) |
135 { | 135 { |
136 clearUserGesture(); | 136 clearUserGesture(); |
137 } | 137 } |
138 | 138 |
139 virtual bool shouldStartTimer(LocalFrame* frame) OVERRIDE { return frame->lo
ader().allAncestorsAreComplete(); } | 139 virtual bool shouldStartTimer(LocalFrame* frame) override { return frame->lo
ader().allAncestorsAreComplete(); } |
140 | 140 |
141 virtual void fire(LocalFrame* frame) OVERRIDE | 141 virtual void fire(LocalFrame* frame) override |
142 { | 142 { |
143 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 143 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
144 FrameLoadRequest request(originDocument(), ResourceRequest(KURL(ParsedUR
LString, url()), referrer()), "_self"); | 144 FrameLoadRequest request(originDocument(), ResourceRequest(KURL(ParsedUR
LString, url()), referrer()), "_self"); |
145 request.setLockBackForwardList(lockBackForwardList()); | 145 request.setLockBackForwardList(lockBackForwardList()); |
146 if (equalIgnoringFragmentIdentifier(frame->document()->url(), request.re
sourceRequest().url())) | 146 if (equalIgnoringFragmentIdentifier(frame->document()->url(), request.re
sourceRequest().url())) |
147 request.resourceRequest().setCachePolicy(ReloadIgnoringCacheData); | 147 request.resourceRequest().setCachePolicy(ReloadIgnoringCacheData); |
148 request.setClientRedirect(ClientRedirect); | 148 request.setClientRedirect(ClientRedirect); |
149 frame->loader().load(request); | 149 frame->loader().load(request); |
150 } | 150 } |
151 }; | 151 }; |
152 | 152 |
153 class ScheduledLocationChange FINAL : public ScheduledURLNavigation { | 153 class ScheduledLocationChange final : public ScheduledURLNavigation { |
154 public: | 154 public: |
155 ScheduledLocationChange(Document* originDocument, const String& url, const R
eferrer& referrer, bool lockBackForwardList) | 155 ScheduledLocationChange(Document* originDocument, const String& url, const R
eferrer& referrer, bool lockBackForwardList) |
156 : ScheduledURLNavigation(0.0, originDocument, url, referrer, lockBackFor
wardList, true) { } | 156 : ScheduledURLNavigation(0.0, originDocument, url, referrer, lockBackFor
wardList, true) { } |
157 }; | 157 }; |
158 | 158 |
159 class ScheduledReload FINAL : public ScheduledNavigation { | 159 class ScheduledReload final : public ScheduledNavigation { |
160 public: | 160 public: |
161 ScheduledReload() | 161 ScheduledReload() |
162 : ScheduledNavigation(0.0, true, true) | 162 : ScheduledNavigation(0.0, true, true) |
163 { | 163 { |
164 } | 164 } |
165 | 165 |
166 virtual void fire(LocalFrame* frame) OVERRIDE | 166 virtual void fire(LocalFrame* frame) override |
167 { | 167 { |
168 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 168 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
169 frame->loader().reload(NormalReload, KURL(), ClientRedirect); | 169 frame->loader().reload(NormalReload, KURL(), ClientRedirect); |
170 } | 170 } |
171 }; | 171 }; |
172 | 172 |
173 class ScheduledPageBlock FINAL : public ScheduledURLNavigation { | 173 class ScheduledPageBlock final : public ScheduledURLNavigation { |
174 public: | 174 public: |
175 ScheduledPageBlock(Document* originDocument, const String& url, const Referr
er& referrer) | 175 ScheduledPageBlock(Document* originDocument, const String& url, const Referr
er& referrer) |
176 : ScheduledURLNavigation(0.0, originDocument, url, referrer, true, true) | 176 : ScheduledURLNavigation(0.0, originDocument, url, referrer, true, true) |
177 { | 177 { |
178 } | 178 } |
179 | 179 |
180 virtual void fire(LocalFrame* frame) OVERRIDE | 180 virtual void fire(LocalFrame* frame) override |
181 { | 181 { |
182 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 182 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
183 SubstituteData substituteData(SharedBuffer::create(), "text/plain", "UTF
-8", KURL(), ForceSynchronousLoad); | 183 SubstituteData substituteData(SharedBuffer::create(), "text/plain", "UTF
-8", KURL(), ForceSynchronousLoad); |
184 FrameLoadRequest request(originDocument(), ResourceRequest(KURL(ParsedUR
LString, url()), referrer(), ReloadIgnoringCacheData), substituteData); | 184 FrameLoadRequest request(originDocument(), ResourceRequest(KURL(ParsedUR
LString, url()), referrer(), ReloadIgnoringCacheData), substituteData); |
185 request.setLockBackForwardList(true); | 185 request.setLockBackForwardList(true); |
186 request.setClientRedirect(ClientRedirect); | 186 request.setClientRedirect(ClientRedirect); |
187 frame->loader().load(request); | 187 frame->loader().load(request); |
188 } | 188 } |
189 }; | 189 }; |
190 | 190 |
191 class ScheduledHistoryNavigation FINAL : public ScheduledNavigation { | 191 class ScheduledHistoryNavigation final : public ScheduledNavigation { |
192 public: | 192 public: |
193 explicit ScheduledHistoryNavigation(int historySteps) | 193 explicit ScheduledHistoryNavigation(int historySteps) |
194 : ScheduledNavigation(0, false, true) | 194 : ScheduledNavigation(0, false, true) |
195 , m_historySteps(historySteps) | 195 , m_historySteps(historySteps) |
196 { | 196 { |
197 } | 197 } |
198 | 198 |
199 virtual void fire(LocalFrame* frame) OVERRIDE | 199 virtual void fire(LocalFrame* frame) override |
200 { | 200 { |
201 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 201 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
202 // go(i!=0) from a frame navigates into the history of the frame only, | 202 // go(i!=0) from a frame navigates into the history of the frame only, |
203 // in both IE and NS (but not in Mozilla). We can't easily do that. | 203 // in both IE and NS (but not in Mozilla). We can't easily do that. |
204 frame->page()->deprecatedLocalMainFrame()->loader().client()->navigateBa
ckForward(m_historySteps); | 204 frame->page()->deprecatedLocalMainFrame()->loader().client()->navigateBa
ckForward(m_historySteps); |
205 } | 205 } |
206 | 206 |
207 private: | 207 private: |
208 int m_historySteps; | 208 int m_historySteps; |
209 }; | 209 }; |
210 | 210 |
211 class ScheduledFormSubmission FINAL : public ScheduledNavigation { | 211 class ScheduledFormSubmission final : public ScheduledNavigation { |
212 public: | 212 public: |
213 ScheduledFormSubmission(PassRefPtrWillBeRawPtr<FormSubmission> submission, b
ool lockBackForwardList) | 213 ScheduledFormSubmission(PassRefPtrWillBeRawPtr<FormSubmission> submission, b
ool lockBackForwardList) |
214 : ScheduledNavigation(0, lockBackForwardList, true) | 214 : ScheduledNavigation(0, lockBackForwardList, true) |
215 , m_submission(submission) | 215 , m_submission(submission) |
216 { | 216 { |
217 ASSERT(m_submission->state()); | 217 ASSERT(m_submission->state()); |
218 } | 218 } |
219 | 219 |
220 virtual void fire(LocalFrame* frame) OVERRIDE | 220 virtual void fire(LocalFrame* frame) override |
221 { | 221 { |
222 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 222 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
223 FrameLoadRequest frameRequest(m_submission->state()->sourceDocument()); | 223 FrameLoadRequest frameRequest(m_submission->state()->sourceDocument()); |
224 m_submission->populateFrameLoadRequest(frameRequest); | 224 m_submission->populateFrameLoadRequest(frameRequest); |
225 frameRequest.setLockBackForwardList(lockBackForwardList()); | 225 frameRequest.setLockBackForwardList(lockBackForwardList()); |
226 frameRequest.setTriggeringEvent(m_submission->event()); | 226 frameRequest.setTriggeringEvent(m_submission->event()); |
227 frameRequest.setFormState(m_submission->state()); | 227 frameRequest.setFormState(m_submission->state()); |
228 frame->loader().load(frameRequest); | 228 frame->loader().load(frameRequest); |
229 } | 229 } |
230 | 230 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 m_timer.stop(); | 421 m_timer.stop(); |
422 m_redirect.clear(); | 422 m_redirect.clear(); |
423 } | 423 } |
424 | 424 |
425 void NavigationScheduler::trace(Visitor* visitor) | 425 void NavigationScheduler::trace(Visitor* visitor) |
426 { | 426 { |
427 visitor->trace(m_frame); | 427 visitor->trace(m_frame); |
428 } | 428 } |
429 | 429 |
430 } // namespace blink | 430 } // namespace blink |
OLD | NEW |