| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "core/loader/FrameLoaderStateMachine.h" | 47 #include "core/loader/FrameLoaderStateMachine.h" |
| 48 #include "core/page/Page.h" | 48 #include "core/page/Page.h" |
| 49 #include "platform/SharedBuffer.h" | 49 #include "platform/SharedBuffer.h" |
| 50 #include "platform/UserGestureIndicator.h" | 50 #include "platform/UserGestureIndicator.h" |
| 51 #include "wtf/CurrentTime.h" | 51 #include "wtf/CurrentTime.h" |
| 52 | 52 |
| 53 namespace blink { | 53 namespace blink { |
| 54 | 54 |
| 55 unsigned NavigationDisablerForBeforeUnload::s_navigationDisableCount = 0; | 55 unsigned NavigationDisablerForBeforeUnload::s_navigationDisableCount = 0; |
| 56 | 56 |
| 57 class ScheduledNavigation { | 57 class ScheduledNavigation : public NoBaseWillBeGarbageCollectedFinalized<Schedul
edNavigation> { |
| 58 WTF_MAKE_NONCOPYABLE(ScheduledNavigation); WTF_MAKE_FAST_ALLOCATED(Scheduled
Navigation); | 58 WTF_MAKE_NONCOPYABLE(ScheduledNavigation); WTF_MAKE_FAST_ALLOCATED_WILL_BE_R
EMOVED(ScheduledNavigation); |
| 59 public: | 59 public: |
| 60 ScheduledNavigation(double delay, Document* originDocument, bool lockBackFor
wardList, bool isLocationChange) | 60 ScheduledNavigation(double delay, Document* originDocument, bool lockBackFor
wardList, bool isLocationChange) |
| 61 : m_delay(delay) | 61 : m_delay(delay) |
| 62 , m_originDocument(originDocument) | 62 , m_originDocument(originDocument) |
| 63 , m_lockBackForwardList(lockBackForwardList) | 63 , m_lockBackForwardList(lockBackForwardList) |
| 64 , m_isLocationChange(isLocationChange) | 64 , m_isLocationChange(isLocationChange) |
| 65 , m_wasUserGesture(UserGestureIndicator::processingUserGesture()) | 65 , m_wasUserGesture(UserGestureIndicator::processingUserGesture()) |
| 66 { | 66 { |
| 67 if (m_wasUserGesture) | 67 if (m_wasUserGesture) |
| 68 m_userGestureToken = UserGestureIndicator::currentToken(); | 68 m_userGestureToken = UserGestureIndicator::currentToken(); |
| 69 } | 69 } |
| 70 virtual ~ScheduledNavigation() { } | 70 virtual ~ScheduledNavigation() { } |
| 71 | 71 |
| 72 virtual void fire(LocalFrame*) = 0; | 72 virtual void fire(LocalFrame*) = 0; |
| 73 | 73 |
| 74 virtual bool shouldStartTimer(LocalFrame*) { return true; } | 74 virtual bool shouldStartTimer(LocalFrame*) { return true; } |
| 75 | 75 |
| 76 double delay() const { return m_delay; } | 76 double delay() const { return m_delay; } |
| 77 Document* originDocument() const { return m_originDocument.get(); } | 77 Document* originDocument() const { return m_originDocument.get(); } |
| 78 bool lockBackForwardList() const { return m_lockBackForwardList; } | 78 bool lockBackForwardList() const { return m_lockBackForwardList; } |
| 79 bool isLocationChange() const { return m_isLocationChange; } | 79 bool isLocationChange() const { return m_isLocationChange; } |
| 80 PassOwnPtr<UserGestureIndicator> createUserGestureIndicator() | 80 PassOwnPtr<UserGestureIndicator> createUserGestureIndicator() |
| 81 { | 81 { |
| 82 if (m_wasUserGesture && m_userGestureToken) | 82 if (m_wasUserGesture && m_userGestureToken) |
| 83 return adoptPtr(new UserGestureIndicator(m_userGestureToken)); | 83 return adoptPtr(new UserGestureIndicator(m_userGestureToken)); |
| 84 return adoptPtr(new UserGestureIndicator(DefinitelyNotProcessingUserGest
ure)); | 84 return adoptPtr(new UserGestureIndicator(DefinitelyNotProcessingUserGest
ure)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 DEFINE_INLINE_VIRTUAL_TRACE() |
| 88 { |
| 89 visitor->trace(m_originDocument); |
| 90 } |
| 91 |
| 87 protected: | 92 protected: |
| 88 void clearUserGesture() { m_wasUserGesture = false; } | 93 void clearUserGesture() { m_wasUserGesture = false; } |
| 89 | 94 |
| 90 private: | 95 private: |
| 91 double m_delay; | 96 double m_delay; |
| 92 RefPtrWillBePersistent<Document> m_originDocument; | 97 RefPtrWillBeMember<Document> m_originDocument; |
| 93 bool m_lockBackForwardList; | 98 bool m_lockBackForwardList; |
| 94 bool m_isLocationChange; | 99 bool m_isLocationChange; |
| 95 bool m_wasUserGesture; | 100 bool m_wasUserGesture; |
| 96 RefPtr<UserGestureToken> m_userGestureToken; | 101 RefPtr<UserGestureToken> m_userGestureToken; |
| 97 }; | 102 }; |
| 98 | 103 |
| 99 class ScheduledURLNavigation : public ScheduledNavigation { | 104 class ScheduledURLNavigation : public ScheduledNavigation { |
| 100 protected: | 105 protected: |
| 101 ScheduledURLNavigation(double delay, Document* originDocument, const String&
url, bool lockBackForwardList, bool isLocationChange) | 106 ScheduledURLNavigation(double delay, Document* originDocument, const String&
url, bool lockBackForwardList, bool isLocationChange) |
| 102 : ScheduledNavigation(delay, originDocument, lockBackForwardList, isLoca
tionChange) | 107 : ScheduledNavigation(delay, originDocument, lockBackForwardList, isLoca
tionChange) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 118 | 123 |
| 119 String url() const { return m_url; } | 124 String url() const { return m_url; } |
| 120 | 125 |
| 121 private: | 126 private: |
| 122 String m_url; | 127 String m_url; |
| 123 ContentSecurityPolicyDisposition m_shouldCheckMainWorldContentSecurityPolicy
; | 128 ContentSecurityPolicyDisposition m_shouldCheckMainWorldContentSecurityPolicy
; |
| 124 }; | 129 }; |
| 125 | 130 |
| 126 class ScheduledRedirect final : public ScheduledURLNavigation { | 131 class ScheduledRedirect final : public ScheduledURLNavigation { |
| 127 public: | 132 public: |
| 128 ScheduledRedirect(double delay, Document* originDocument, const String& url,
bool lockBackForwardList) | 133 static PassOwnPtrWillBeRawPtr<ScheduledRedirect> create(double delay, Docume
nt* originDocument, const String& url, bool lockBackForwardList) |
| 129 : ScheduledURLNavigation(delay, originDocument, url, lockBackForwardList
, false) | |
| 130 { | 134 { |
| 131 clearUserGesture(); | 135 return adoptPtrWillBeNoop(new ScheduledRedirect(delay, originDocument, u
rl, lockBackForwardList)); |
| 132 } | 136 } |
| 133 | 137 |
| 134 virtual bool shouldStartTimer(LocalFrame* frame) override { return frame->do
cument()->loadEventFinished(); } | 138 virtual bool shouldStartTimer(LocalFrame* frame) override { return frame->do
cument()->loadEventFinished(); } |
| 135 | 139 |
| 136 virtual void fire(LocalFrame* frame) override | 140 virtual void fire(LocalFrame* frame) override |
| 137 { | 141 { |
| 138 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 142 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
| 139 FrameLoadRequest request(originDocument(), url(), "_self"); | 143 FrameLoadRequest request(originDocument(), url(), "_self"); |
| 140 request.setLockBackForwardList(lockBackForwardList()); | 144 request.setLockBackForwardList(lockBackForwardList()); |
| 141 if (equalIgnoringFragmentIdentifier(frame->document()->url(), request.re
sourceRequest().url())) | 145 if (equalIgnoringFragmentIdentifier(frame->document()->url(), request.re
sourceRequest().url())) |
| 142 request.resourceRequest().setCachePolicy(ReloadIgnoringCacheData); | 146 request.resourceRequest().setCachePolicy(ReloadIgnoringCacheData); |
| 143 request.setClientRedirect(ClientRedirect); | 147 request.setClientRedirect(ClientRedirect); |
| 144 frame->loader().load(request); | 148 frame->loader().load(request); |
| 145 } | 149 } |
| 150 private: |
| 151 ScheduledRedirect(double delay, Document* originDocument, const String& url,
bool lockBackForwardList) |
| 152 : ScheduledURLNavigation(delay, originDocument, url, lockBackForwardList
, false) |
| 153 { |
| 154 clearUserGesture(); |
| 155 } |
| 146 }; | 156 }; |
| 147 | 157 |
| 148 class ScheduledLocationChange final : public ScheduledURLNavigation { | 158 class ScheduledLocationChange final : public ScheduledURLNavigation { |
| 149 public: | 159 public: |
| 160 static PassOwnPtrWillBeRawPtr<ScheduledLocationChange> create(Document* orig
inDocument, const String& url, bool lockBackForwardList) |
| 161 { |
| 162 return adoptPtrWillBeNoop(new ScheduledLocationChange(originDocument, ur
l, lockBackForwardList)); |
| 163 } |
| 164 |
| 165 private: |
| 150 ScheduledLocationChange(Document* originDocument, const String& url, bool lo
ckBackForwardList) | 166 ScheduledLocationChange(Document* originDocument, const String& url, bool lo
ckBackForwardList) |
| 151 : ScheduledURLNavigation(0.0, originDocument, url, lockBackForwardList,
!protocolIsJavaScript(url)) { } | 167 : ScheduledURLNavigation(0.0, originDocument, url, lockBackForwardList,
!protocolIsJavaScript(url)) { } |
| 152 }; | 168 }; |
| 153 | 169 |
| 154 class ScheduledReload final : public ScheduledNavigation { | 170 class ScheduledReload final : public ScheduledNavigation { |
| 155 public: | 171 public: |
| 156 ScheduledReload() | 172 static PassOwnPtrWillBeRawPtr<ScheduledReload> create() |
| 157 : ScheduledNavigation(0.0, nullptr, true, true) | |
| 158 { | 173 { |
| 174 return adoptPtrWillBeNoop(new ScheduledReload); |
| 159 } | 175 } |
| 160 | 176 |
| 161 virtual void fire(LocalFrame* frame) override | 177 virtual void fire(LocalFrame* frame) override |
| 162 { | 178 { |
| 163 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 179 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
| 164 frame->loader().reload(NormalReload, KURL(), ClientRedirect); | 180 frame->loader().reload(NormalReload, KURL(), ClientRedirect); |
| 165 } | 181 } |
| 182 |
| 183 private: |
| 184 ScheduledReload() |
| 185 : ScheduledNavigation(0.0, nullptr, true, true) |
| 186 { |
| 187 } |
| 166 }; | 188 }; |
| 167 | 189 |
| 168 class ScheduledPageBlock final : public ScheduledURLNavigation { | 190 class ScheduledPageBlock final : public ScheduledURLNavigation { |
| 169 public: | 191 public: |
| 170 ScheduledPageBlock(Document* originDocument, const String& url) | 192 static PassOwnPtrWillBeRawPtr<ScheduledPageBlock> create(Document* originDoc
ument, const String& url) |
| 171 : ScheduledURLNavigation(0.0, originDocument, url, true, true) | |
| 172 { | 193 { |
| 194 return adoptPtrWillBeNoop(new ScheduledPageBlock(originDocument, url)); |
| 173 } | 195 } |
| 174 | 196 |
| 175 virtual void fire(LocalFrame* frame) override | 197 virtual void fire(LocalFrame* frame) override |
| 176 { | 198 { |
| 177 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 199 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
| 178 SubstituteData substituteData(SharedBuffer::create(), "text/plain", "UTF
-8", KURL(), ForceSynchronousLoad); | 200 SubstituteData substituteData(SharedBuffer::create(), "text/plain", "UTF
-8", KURL(), ForceSynchronousLoad); |
| 179 FrameLoadRequest request(originDocument(), url(), substituteData); | 201 FrameLoadRequest request(originDocument(), url(), substituteData); |
| 180 request.setLockBackForwardList(true); | 202 request.setLockBackForwardList(true); |
| 181 request.setClientRedirect(ClientRedirect); | 203 request.setClientRedirect(ClientRedirect); |
| 182 frame->loader().load(request); | 204 frame->loader().load(request); |
| 183 } | 205 } |
| 206 private: |
| 207 ScheduledPageBlock(Document* originDocument, const String& url) |
| 208 : ScheduledURLNavigation(0.0, originDocument, url, true, true) |
| 209 { |
| 210 } |
| 211 |
| 184 }; | 212 }; |
| 185 | 213 |
| 186 class ScheduledFormSubmission final : public ScheduledNavigation { | 214 class ScheduledFormSubmission final : public ScheduledNavigation { |
| 187 public: | 215 public: |
| 188 ScheduledFormSubmission(Document* document, PassRefPtrWillBeRawPtr<FormSubmi
ssion> submission, bool lockBackForwardList) | 216 static PassOwnPtrWillBeRawPtr<ScheduledFormSubmission> create(Document* docu
ment, PassRefPtrWillBeRawPtr<FormSubmission> submission, bool lockBackForwardLis
t) |
| 189 : ScheduledNavigation(0, document, lockBackForwardList, true) | |
| 190 , m_submission(submission) | |
| 191 { | 217 { |
| 192 ASSERT(m_submission->form()); | 218 return adoptPtrWillBeNoop(new ScheduledFormSubmission(document, submissi
on, lockBackForwardList)); |
| 193 } | 219 } |
| 194 | 220 |
| 195 virtual void fire(LocalFrame* frame) override | 221 virtual void fire(LocalFrame* frame) override |
| 196 { | 222 { |
| 197 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 223 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
| 198 FrameLoadRequest frameRequest(originDocument()); | 224 FrameLoadRequest frameRequest(originDocument()); |
| 199 m_submission->populateFrameLoadRequest(frameRequest); | 225 m_submission->populateFrameLoadRequest(frameRequest); |
| 200 frameRequest.setLockBackForwardList(lockBackForwardList()); | 226 frameRequest.setLockBackForwardList(lockBackForwardList()); |
| 201 frameRequest.setTriggeringEvent(m_submission->event()); | 227 frameRequest.setTriggeringEvent(m_submission->event()); |
| 202 frameRequest.setForm(m_submission->form()); | 228 frameRequest.setForm(m_submission->form()); |
| 203 frame->loader().load(frameRequest); | 229 frame->loader().load(frameRequest); |
| 204 } | 230 } |
| 205 | 231 |
| 232 DEFINE_INLINE_VIRTUAL_TRACE() |
| 233 { |
| 234 visitor->trace(m_submission); |
| 235 ScheduledNavigation::trace(visitor); |
| 236 } |
| 237 |
| 206 private: | 238 private: |
| 207 RefPtrWillBePersistent<FormSubmission> m_submission; | 239 ScheduledFormSubmission(Document* document, PassRefPtrWillBeRawPtr<FormSubmi
ssion> submission, bool lockBackForwardList) |
| 240 : ScheduledNavigation(0, document, lockBackForwardList, true) |
| 241 , m_submission(submission) |
| 242 { |
| 243 ASSERT(m_submission->form()); |
| 244 } |
| 245 |
| 246 RefPtrWillBeMember<FormSubmission> m_submission; |
| 208 }; | 247 }; |
| 209 | 248 |
| 210 NavigationScheduler::NavigationScheduler(LocalFrame* frame) | 249 NavigationScheduler::NavigationScheduler(LocalFrame* frame) |
| 211 : m_frame(frame) | 250 : m_frame(frame) |
| 212 , m_timer(this, &NavigationScheduler::timerFired) | 251 , m_timer(this, &NavigationScheduler::timerFired) |
| 213 { | 252 { |
| 214 } | 253 } |
| 215 | 254 |
| 216 NavigationScheduler::~NavigationScheduler() | 255 NavigationScheduler::~NavigationScheduler() |
| 217 { | 256 { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 236 { | 275 { |
| 237 if (!shouldScheduleNavigation(url)) | 276 if (!shouldScheduleNavigation(url)) |
| 238 return; | 277 return; |
| 239 if (delay < 0 || delay > INT_MAX / 1000) | 278 if (delay < 0 || delay > INT_MAX / 1000) |
| 240 return; | 279 return; |
| 241 if (url.isEmpty()) | 280 if (url.isEmpty()) |
| 242 return; | 281 return; |
| 243 | 282 |
| 244 // We want a new back/forward list item if the refresh timeout is > 1 second
. | 283 // We want a new back/forward list item if the refresh timeout is > 1 second
. |
| 245 if (!m_redirect || delay <= m_redirect->delay()) | 284 if (!m_redirect || delay <= m_redirect->delay()) |
| 246 schedule(adoptPtr(new ScheduledRedirect(delay, m_frame->document(), url,
delay <= 1))); | 285 schedule(ScheduledRedirect::create(delay, m_frame->document(), url, dela
y <= 1)); |
| 247 } | 286 } |
| 248 | 287 |
| 249 bool NavigationScheduler::mustLockBackForwardList(LocalFrame* targetFrame) | 288 bool NavigationScheduler::mustLockBackForwardList(LocalFrame* targetFrame) |
| 250 { | 289 { |
| 251 // Non-user navigation before the page has finished firing onload should not
create a new back/forward item. | 290 // Non-user navigation before the page has finished firing onload should not
create a new back/forward item. |
| 252 // See https://webkit.org/b/42861 for the original motivation for this. | 291 // See https://webkit.org/b/42861 for the original motivation for this. |
| 253 if (!UserGestureIndicator::processingUserGesture() && !targetFrame->document
()->loadEventFinished()) | 292 if (!UserGestureIndicator::processingUserGesture() && !targetFrame->document
()->loadEventFinished()) |
| 254 return true; | 293 return true; |
| 255 | 294 |
| 256 // From the HTML5 spec for location.assign(): | 295 // From the HTML5 spec for location.assign(): |
| (...skipping 29 matching lines...) Expand all Loading... |
| 286 if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier
(m_frame->document()->url(), parsedURL)) { | 325 if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier
(m_frame->document()->url(), parsedURL)) { |
| 287 FrameLoadRequest request(originDocument, m_frame->document()->comple
teURL(url), "_self"); | 326 FrameLoadRequest request(originDocument, m_frame->document()->comple
teURL(url), "_self"); |
| 288 request.setLockBackForwardList(lockBackForwardList); | 327 request.setLockBackForwardList(lockBackForwardList); |
| 289 if (lockBackForwardList) | 328 if (lockBackForwardList) |
| 290 request.setClientRedirect(ClientRedirect); | 329 request.setClientRedirect(ClientRedirect); |
| 291 m_frame->loader().load(request); | 330 m_frame->loader().load(request); |
| 292 return; | 331 return; |
| 293 } | 332 } |
| 294 } | 333 } |
| 295 | 334 |
| 296 schedule(adoptPtr(new ScheduledLocationChange(originDocument, url, lockBackF
orwardList))); | 335 schedule(ScheduledLocationChange::create(originDocument, url, lockBackForwar
dList)); |
| 297 } | 336 } |
| 298 | 337 |
| 299 void NavigationScheduler::schedulePageBlock(Document* originDocument) | 338 void NavigationScheduler::schedulePageBlock(Document* originDocument) |
| 300 { | 339 { |
| 301 ASSERT(m_frame->page()); | 340 ASSERT(m_frame->page()); |
| 302 const KURL& url = m_frame->document()->url(); | 341 const KURL& url = m_frame->document()->url(); |
| 303 schedule(adoptPtr(new ScheduledPageBlock(originDocument, url))); | 342 schedule(ScheduledPageBlock::create(originDocument, url)); |
| 304 } | 343 } |
| 305 | 344 |
| 306 void NavigationScheduler::scheduleFormSubmission(Document* document, PassRefPtrW
illBeRawPtr<FormSubmission> submission) | 345 void NavigationScheduler::scheduleFormSubmission(Document* document, PassRefPtrW
illBeRawPtr<FormSubmission> submission) |
| 307 { | 346 { |
| 308 ASSERT(m_frame->page()); | 347 ASSERT(m_frame->page()); |
| 309 schedule(adoptPtr(new ScheduledFormSubmission(document, submission, mustLock
BackForwardList(m_frame)))); | 348 schedule(ScheduledFormSubmission::create(document, submission, mustLockBackF
orwardList(m_frame))); |
| 310 } | 349 } |
| 311 | 350 |
| 312 void NavigationScheduler::scheduleReload() | 351 void NavigationScheduler::scheduleReload() |
| 313 { | 352 { |
| 314 if (!shouldScheduleReload()) | 353 if (!shouldScheduleReload()) |
| 315 return; | 354 return; |
| 316 if (m_frame->document()->url().isEmpty()) | 355 if (m_frame->document()->url().isEmpty()) |
| 317 return; | 356 return; |
| 318 schedule(adoptPtr(new ScheduledReload)); | 357 schedule(ScheduledReload::create()); |
| 319 } | 358 } |
| 320 | 359 |
| 321 void NavigationScheduler::timerFired(Timer<NavigationScheduler>*) | 360 void NavigationScheduler::timerFired(Timer<NavigationScheduler>*) |
| 322 { | 361 { |
| 323 if (!m_frame->page()) | 362 if (!m_frame->page()) |
| 324 return; | 363 return; |
| 325 if (m_frame->page()->defersLoading()) { | 364 if (m_frame->page()->defersLoading()) { |
| 326 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); | 365 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); |
| 327 return; | 366 return; |
| 328 } | 367 } |
| 329 | 368 |
| 330 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); | 369 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); |
| 331 | 370 |
| 332 OwnPtr<ScheduledNavigation> redirect(m_redirect.release()); | 371 OwnPtrWillBeRawPtr<ScheduledNavigation> redirect(m_redirect.release()); |
| 333 redirect->fire(m_frame); | 372 redirect->fire(m_frame); |
| 334 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); | 373 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); |
| 335 } | 374 } |
| 336 | 375 |
| 337 void NavigationScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect) | 376 void NavigationScheduler::schedule(PassOwnPtrWillBeRawPtr<ScheduledNavigation> r
edirect) |
| 338 { | 377 { |
| 339 ASSERT(m_frame->page()); | 378 ASSERT(m_frame->page()); |
| 340 | 379 |
| 341 // In a back/forward navigation, we sometimes restore history state to ifram
es, even though the state was generated | 380 // In a back/forward navigation, we sometimes restore history state to ifram
es, even though the state was generated |
| 342 // dynamically and JS will try to put something different in the iframe. In
this case, we will load stale things | 381 // dynamically and JS will try to put something different in the iframe. In
this case, we will load stale things |
| 343 // and/or confuse the JS when it shortly thereafter tries to schedule a loca
tion change. Let the JS have its way. | 382 // and/or confuse the JS when it shortly thereafter tries to schedule a loca
tion change. Let the JS have its way. |
| 344 // FIXME: This check seems out of place. | 383 // FIXME: This check seems out of place. |
| 345 if (!m_frame->loader().stateMachine()->committedFirstRealDocumentLoad() && m
_frame->loader().provisionalDocumentLoader()) { | 384 if (!m_frame->loader().stateMachine()->committedFirstRealDocumentLoad() && m
_frame->loader().provisionalDocumentLoader()) { |
| 346 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); | 385 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); |
| 347 m_frame->loader().provisionalDocumentLoader()->stopLoading(); | 386 m_frame->loader().provisionalDocumentLoader()->stopLoading(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 373 { | 412 { |
| 374 if (m_timer.isActive()) | 413 if (m_timer.isActive()) |
| 375 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); | 414 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); |
| 376 m_timer.stop(); | 415 m_timer.stop(); |
| 377 m_redirect.clear(); | 416 m_redirect.clear(); |
| 378 } | 417 } |
| 379 | 418 |
| 380 DEFINE_TRACE(NavigationScheduler) | 419 DEFINE_TRACE(NavigationScheduler) |
| 381 { | 420 { |
| 382 visitor->trace(m_frame); | 421 visitor->trace(m_frame); |
| 422 visitor->trace(m_redirect); |
| 383 } | 423 } |
| 384 | 424 |
| 385 } // namespace blink | 425 } // namespace blink |
| OLD | NEW |