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

Side by Side Diff: Source/platform/scheduler/Scheduler.h

Issue 956333002: Refactor TimeBase to post tasks. Workers to use real Idle tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix a bunch of stuff Created 5 years, 9 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef Scheduler_h 5 #ifndef Scheduler_h
6 #define Scheduler_h 6 #define Scheduler_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "public/platform/WebThread.h" 9 #include "public/platform/WebThread.h"
10 #include "wtf/Functional.h" 10 #include "wtf/Functional.h"
(...skipping 22 matching lines...) Expand all
33 // Like postIdleTask but does not run the idle task until after some other 33 // Like postIdleTask but does not run the idle task until after some other
34 // task has run. This enables posting of a task which won't stop the Blink 34 // task has run. This enables posting of a task which won't stop the Blink
35 // main thread from sleeping, but will start running after it wakes up. 35 // main thread from sleeping, but will start running after it wakes up.
36 void postIdleTaskAfterWakeup(const WebTraceLocation&, PassOwnPtr<IdleTask>); 36 void postIdleTaskAfterWakeup(const WebTraceLocation&, PassOwnPtr<IdleTask>);
37 37
38 // For tasks related to loading, e.g. HTML parsing. Loading tasks usually h ave default priority 38 // For tasks related to loading, e.g. HTML parsing. Loading tasks usually h ave default priority
39 // but they may be deprioritized when the user is interacting with the devic e. 39 // but they may be deprioritized when the user is interacting with the devic e.
40 // Takes ownership of |WebThread::Task|. 40 // Takes ownership of |WebThread::Task|.
41 void postLoadingTask(const WebTraceLocation&, WebThread::Task*); 41 void postLoadingTask(const WebTraceLocation&, WebThread::Task*);
42 42
43 void postTimerTask(const WebTraceLocation&, WebThread::Task*, long long dela yMs);
44
43 // Returns true if there is high priority work pending on the main thread 45 // Returns true if there is high priority work pending on the main thread
44 // and the caller should yield to let the scheduler service that work. 46 // and the caller should yield to let the scheduler service that work.
45 // Must be called on the main thread. 47 // Must be called on the main thread.
46 bool shouldYieldForHighPriorityWork() const; 48 bool shouldYieldForHighPriorityWork() const;
47 49
48 protected: 50 protected:
49 Scheduler(WebScheduler*); 51 Scheduler(WebScheduler*);
50 virtual ~Scheduler(); 52 virtual ~Scheduler();
51 53
52 static Scheduler* s_sharedScheduler; 54 static Scheduler* s_sharedScheduler;
53 WebScheduler* m_webScheduler; 55 WebScheduler* m_webScheduler;
54 }; 56 };
55 57
56 } // namespace blink 58 } // namespace blink
57 59
58 #endif // Scheduler_h 60 #endif // Scheduler_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698