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

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

Issue 1031843002: Move IdleTask to WebThread side 1/3 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix compile 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
« no previous file with comments | « no previous file | Source/platform/scheduler/SchedulerTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "config.h" 5 #include "config.h"
6 #include "platform/scheduler/Scheduler.h" 6 #include "platform/scheduler/Scheduler.h"
7 7
8 #include "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 #include "public/platform/WebScheduler.h" 9 #include "public/platform/WebScheduler.h"
10 #include "public/platform/WebTraceLocation.h" 10 #include "public/platform/WebTraceLocation.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class IdleTaskRunner : public WebScheduler::IdleTask { 14 class IdleTaskRunner : public WebThread::IdleTask {
15 WTF_MAKE_NONCOPYABLE(IdleTaskRunner); 15 WTF_MAKE_NONCOPYABLE(IdleTaskRunner);
16 16
17 public: 17 public:
18 explicit IdleTaskRunner(PassOwnPtr<Scheduler::IdleTask> task) 18 explicit IdleTaskRunner(PassOwnPtr<Scheduler::IdleTask> task)
19 : m_task(task) 19 : m_task(task)
20 { 20 {
21 } 21 }
22 22
23 ~IdleTaskRunner() override 23 ~IdleTaskRunner() override
24 { 24 {
25 } 25 }
26 26
27 // WebScheduler::IdleTask implementation. 27 // WebThread::IdleTask implementation.
28 void run(double deadlineSeconds) override 28 void run(double deadlineSeconds) override
29 { 29 {
30 (*m_task)(deadlineSeconds); 30 (*m_task)(deadlineSeconds);
31 } 31 }
32 private: 32 private:
33 OwnPtr<Scheduler::IdleTask> m_task; 33 OwnPtr<Scheduler::IdleTask> m_task;
34 }; 34 };
35 35
36 Scheduler* Scheduler::s_sharedScheduler = nullptr; 36 Scheduler* Scheduler::s_sharedScheduler = nullptr;
37 37
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 bool Scheduler::canExceedIdleDeadlineIfRequired() const 96 bool Scheduler::canExceedIdleDeadlineIfRequired() const
97 { 97 {
98 if (m_webScheduler) 98 if (m_webScheduler)
99 return m_webScheduler->canExceedIdleDeadlineIfRequired(); 99 return m_webScheduler->canExceedIdleDeadlineIfRequired();
100 return false; 100 return false;
101 } 101 }
102 102
103 } // namespace blink 103 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/scheduler/SchedulerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698