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

Unified Diff: components/scheduler/renderer/renderer_scheduler.h

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: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/scheduler/renderer/renderer_scheduler.h
diff --git a/components/scheduler/renderer/renderer_scheduler.h b/components/scheduler/renderer/renderer_scheduler.h
index d605e52ce620fc7aa0f120249dd1c72a0379dd5d..3ec03e0b23a94a009bdbc1de057ad5cc80633b2b 100644
--- a/components/scheduler/renderer/renderer_scheduler.h
+++ b/components/scheduler/renderer/renderer_scheduler.h
@@ -106,10 +106,20 @@ class SCHEDULER_EXPORT RendererScheduler : public ChildScheduler {
// Must be called on the main thread.
virtual void OnRendererForegrounded() = 0;
- // Tells the scheduler that a page load has started. The scheduler will
+ // Tells the scheduler that a navigation is expected. The scheduler will
+ // ensure that loading tasks are not blocked even if they are expensive.
+ // This mode lasts until either OnNavigationStarted or OnNavigationCanceled is
+ // called.
+ virtual void OnNavigationExpected() = 0;
+
+ // Tells the scheduler that an expected navigation was canceled. The
+ // scheduler may now block expensive tasks.
+ virtual void OnNavigationCanceled() = 0;
+
+ // Tells the scheduler that a navigation has started. The scheduler will
// prioritize loading tasks for a short duration afterwards.
// Must be called from the main thread.
- virtual void OnPageLoadStarted() = 0;
+ virtual void OnNavigationStarted() = 0;
// Returns true if the scheduler has reason to believe that high priority work
// may soon arrive on the main thread, e.g., if gesture events were observed

Powered by Google App Engine
This is Rietveld 408576698