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

Side by Side Diff: content/child/webthread_impl.h

Issue 922733002: scheduler: Implement task observers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | content/child/webthread_impl.cc » ('j') | content/child/webthread_impl.cc » ('J')
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 #ifndef CONTENT_CHILD_WEBTHREAD_IMPL_H_ 5 #ifndef CONTENT_CHILD_WEBTHREAD_IMPL_H_
6 #define CONTENT_CHILD_WEBTHREAD_IMPL_H_ 6 #define CONTENT_CHILD_WEBTHREAD_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 11 matching lines...) Expand all
22 public: 22 public:
23 virtual ~WebThreadBase(); 23 virtual ~WebThreadBase();
24 24
25 virtual void addTaskObserver(TaskObserver* observer); 25 virtual void addTaskObserver(TaskObserver* observer);
26 virtual void removeTaskObserver(TaskObserver* observer); 26 virtual void removeTaskObserver(TaskObserver* observer);
27 27
28 virtual bool isCurrentThread() const = 0; 28 virtual bool isCurrentThread() const = 0;
29 virtual blink::PlatformThreadId threadId() const = 0; 29 virtual blink::PlatformThreadId threadId() const = 0;
30 30
31 protected: 31 protected:
32 class TaskObserverAdapter;
33
32 WebThreadBase(); 34 WebThreadBase();
33 35
36 virtual void AddTaskObserverInternal(
37 base::MessageLoop::TaskObserver* observer);
38 virtual void RemoveTaskObserverInternal(
39 base::MessageLoop::TaskObserver* observer);
40
41 static void RunWebThreadTask(scoped_ptr<blink::WebThread::Task> task);
42
34 private: 43 private:
35 class TaskObserverAdapter;
36
37 typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap; 44 typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap;
38 TaskObserverMap task_observer_map_; 45 TaskObserverMap task_observer_map_;
39 }; 46 };
40 47
41 class CONTENT_EXPORT WebThreadImpl : public WebThreadBase { 48 class CONTENT_EXPORT WebThreadImpl : public WebThreadBase {
42 public: 49 public:
43 explicit WebThreadImpl(const char* name); 50 explicit WebThreadImpl(const char* name);
44 virtual ~WebThreadImpl(); 51 virtual ~WebThreadImpl();
45 52
46 virtual void postTask(const blink::WebTraceLocation& location, Task* task); 53 virtual void postTask(const blink::WebTraceLocation& location, Task* task);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 virtual bool isCurrentThread() const override; 93 virtual bool isCurrentThread() const override;
87 virtual blink::PlatformThreadId threadId() const override; 94 virtual blink::PlatformThreadId threadId() const override;
88 95
89 scoped_refptr<base::SingleThreadTaskRunner> owning_thread_task_runner_; 96 scoped_refptr<base::SingleThreadTaskRunner> owning_thread_task_runner_;
90 blink::PlatformThreadId thread_id_; 97 blink::PlatformThreadId thread_id_;
91 }; 98 };
92 99
93 } // namespace content 100 } // namespace content
94 101
95 #endif // CONTENT_CHILD_WEBTHREAD_IMPL_H_ 102 #endif // CONTENT_CHILD_WEBTHREAD_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/webthread_impl.cc » ('j') | content/child/webthread_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698