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

Side by Side Diff: third_party/WebKit/Source/core/loader/NavigationScheduler.cpp

Issue 1368643002: Add a signal to the scheduler that a navigation is expected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Requested changes Created 5 years, 2 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
OLDNEW
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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 { 413 {
414 if (!m_redirect) 414 if (!m_redirect)
415 return; 415 return;
416 416
417 ASSERT(m_frame->page()); 417 ASSERT(m_frame->page());
418 if (m_navigateTaskFactory->isPending()) 418 if (m_navigateTaskFactory->isPending())
419 return; 419 return;
420 if (!m_redirect->shouldStartTimer(m_frame)) 420 if (!m_redirect->shouldStartTimer(m_frame))
421 return; 421 return;
422 422
423 Platform::current()->currentThread()->scheduler()->loadingTaskRunner()->post DelayedTask( 423 WebScheduler* scheduler = Platform::current()->currentThread()->scheduler();
424 scheduler->onNavigationExpected();
425 scheduler->loadingTaskRunner()->postDelayedTask(
424 FROM_HERE, m_navigateTaskFactory->cancelAndCreate(), m_redirect->delay() * 1000.0); 426 FROM_HERE, m_navigateTaskFactory->cancelAndCreate(), m_redirect->delay() * 1000.0);
425 427
426 InspectorInstrumentation::frameScheduledNavigation(m_frame, m_redirect->dela y()); 428 InspectorInstrumentation::frameScheduledNavigation(m_frame, m_redirect->dela y());
427 } 429 }
428 430
429 void NavigationScheduler::cancel() 431 void NavigationScheduler::cancel()
430 { 432 {
431 if (m_navigateTaskFactory->isPending()) 433 if (m_navigateTaskFactory->isPending()) {
434 Platform::current()->currentThread()->scheduler()->onNavigationCanceled( );
432 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); 435 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame);
436 }
433 m_navigateTaskFactory->cancel(); 437 m_navigateTaskFactory->cancel();
434 m_redirect.clear(); 438 m_redirect.clear();
435 } 439 }
436 440
437 DEFINE_TRACE(NavigationScheduler) 441 DEFINE_TRACE(NavigationScheduler)
438 { 442 {
439 visitor->trace(m_frame); 443 visitor->trace(m_frame);
440 visitor->trace(m_redirect); 444 visitor->trace(m_redirect);
441 } 445 }
442 446
443 } // namespace blink 447 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698