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

Side by Side Diff: content/renderer/scheduler/webthread_impl_for_scheduler.h

Issue 922733002: scheduler: Implement task observers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 5 years, 10 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_
6 #define CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_
7
8 #include "content/child/webthread_impl.h"
9
10 namespace content {
11
12 class RendererScheduler;
13
14 class WebThreadImplForScheduler : public WebThreadBase {
15 public:
16 CONTENT_EXPORT explicit WebThreadImplForScheduler(
17 RendererScheduler* scheduler);
18 CONTENT_EXPORT virtual ~WebThreadImplForScheduler();
19
20 // Implement blink::WebThread.
21 virtual void postTask(const blink::WebTraceLocation& location, Task* task);
22 virtual void postDelayedTask(const blink::WebTraceLocation& location,
23 Task* task,
24 long long delay_ms);
25
26 // TODO(skyostil): Remove once blink has migrated.
27 virtual void postTask(Task* task);
28 virtual void postDelayedTask(Task* task, long long delay_ms);
29
30 virtual void enterRunLoop();
31 virtual void exitRunLoop();
32
33 virtual bool isCurrentThread() const;
34 virtual blink::PlatformThreadId threadId() const;
35
36 private:
37 void AddTaskObserverInternal(
38 base::MessageLoop::TaskObserver* observer) override;
39 void RemoveTaskObserverInternal(
40 base::MessageLoop::TaskObserver* observer) override;
41
42 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
43 RendererScheduler* scheduler_; // Not owned.
44 blink::PlatformThreadId thread_id_;
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698