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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 | 365 |
366 void NavigationScheduler::timerFired(Timer<NavigationScheduler>*) | 366 void NavigationScheduler::timerFired(Timer<NavigationScheduler>*) |
367 { | 367 { |
368 if (!m_frame->page()) | 368 if (!m_frame->page()) |
369 return; | 369 return; |
370 if (m_frame->page()->defersLoading()) { | 370 if (m_frame->page()->defersLoading()) { |
371 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); | 371 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); |
372 return; | 372 return; |
373 } | 373 } |
374 | 374 |
375 RefPtr<LocalFrame> protect(m_frame); | 375 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); |
haraken
2014/09/08 07:25:58
Is .get() needed?
| |
376 | 376 |
377 OwnPtr<ScheduledNavigation> redirect(m_redirect.release()); | 377 OwnPtr<ScheduledNavigation> redirect(m_redirect.release()); |
378 redirect->fire(m_frame); | 378 redirect->fire(m_frame); |
379 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); | 379 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); |
380 } | 380 } |
381 | 381 |
382 void NavigationScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect) | 382 void NavigationScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect) |
383 { | 383 { |
384 ASSERT(m_frame->page()); | 384 ASSERT(m_frame->page()); |
385 | 385 |
386 // In a back/forward navigation, we sometimes restore history state to ifram es, even though the state was generated | 386 // In a back/forward navigation, we sometimes restore history state to ifram es, even though the state was generated |
387 // dynamically and JS will try to put something different in the iframe. In this case, we will load stale things | 387 // dynamically and JS will try to put something different in the iframe. In this case, we will load stale things |
388 // and/or confuse the JS when it shortly thereafter tries to schedule a loca tion change. Let the JS have its way. | 388 // and/or confuse the JS when it shortly thereafter tries to schedule a loca tion change. Let the JS have its way. |
389 // FIXME: This check seems out of place. | 389 // FIXME: This check seems out of place. |
390 if (!m_frame->loader().stateMachine()->committedFirstRealDocumentLoad() && m _frame->loader().provisionalDocumentLoader()) { | 390 if (!m_frame->loader().stateMachine()->committedFirstRealDocumentLoad() && m _frame->loader().provisionalDocumentLoader()) { |
391 RefPtr<Frame> protect(m_frame); | 391 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); |
haraken
2014/09/08 07:25:59
Ditto.
| |
392 m_frame->loader().provisionalDocumentLoader()->stopLoading(); | 392 m_frame->loader().provisionalDocumentLoader()->stopLoading(); |
393 if (!m_frame->host()) | 393 if (!m_frame->host()) |
394 return; | 394 return; |
395 } | 395 } |
396 | 396 |
397 cancel(); | 397 cancel(); |
398 m_redirect = redirect; | 398 m_redirect = redirect; |
399 startTimer(); | 399 startTimer(); |
400 } | 400 } |
401 | 401 |
(...skipping 13 matching lines...) Expand all Loading... | |
415 } | 415 } |
416 | 416 |
417 void NavigationScheduler::cancel() | 417 void NavigationScheduler::cancel() |
418 { | 418 { |
419 if (m_timer.isActive()) | 419 if (m_timer.isActive()) |
420 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); | 420 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); |
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) | |
426 { | |
427 visitor->trace(m_frame); | |
428 } | |
429 | |
425 } // namespace blink | 430 } // namespace blink |
OLD | NEW |