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

Side by Side Diff: webkit/glue/webthread_impl.cc

Issue 10651010: Add plumbing for WebThread::TaskObserver::willProcessTask() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // An implementation of WebThread in terms of base::MessageLoop and 5 // An implementation of WebThread in terms of base::MessageLoop and
6 // base::Thread 6 // base::Thread
7 7
8 #include "webkit/glue/webthread_impl.h" 8 #include "webkit/glue/webthread_impl.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/threading/platform_thread.h" 13 #include "base/threading/platform_thread.h"
14 14
15 namespace webkit_glue { 15 namespace webkit_glue {
16 16
17 WebThreadBase::WebThreadBase() { } 17 WebThreadBase::WebThreadBase() { }
18 WebThreadBase::~WebThreadBase() { } 18 WebThreadBase::~WebThreadBase() { }
19 19
20 class WebThreadBase::TaskObserverAdapter : public MessageLoop::TaskObserver { 20 class WebThreadBase::TaskObserverAdapter : public MessageLoop::TaskObserver {
21 public: 21 public:
22 TaskObserverAdapter(WebThread::TaskObserver* observer) 22 TaskObserverAdapter(WebThread::TaskObserver* observer)
23 : observer_(observer) { } 23 : observer_(observer) { }
24 24
25 // WebThread::TaskObserver does not have a willProcessTask method. 25 virtual void WillProcessTask(base::TimeTicks) OVERRIDE {
26 virtual void WillProcessTask(base::TimeTicks) OVERRIDE { } 26 observer_->willProcessTask();
27 }
27 28
28 virtual void DidProcessTask(base::TimeTicks) OVERRIDE { 29 virtual void DidProcessTask(base::TimeTicks) OVERRIDE {
29 observer_->didProcessTask(); 30 observer_->didProcessTask();
30 } 31 }
31 32
32 private: 33 private:
33 WebThread::TaskObserver* observer_; 34 WebThread::TaskObserver* observer_;
34 }; 35 };
35 36
36 void WebThreadBase::addTaskObserver(TaskObserver* observer) { 37 void WebThreadBase::addTaskObserver(TaskObserver* observer) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 122 }
122 123
123 bool WebThreadImplForMessageLoop::IsCurrentThread() const { 124 bool WebThreadImplForMessageLoop::IsCurrentThread() const {
124 return message_loop_->BelongsToCurrentThread(); 125 return message_loop_->BelongsToCurrentThread();
125 } 126 }
126 127
127 WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() { 128 WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() {
128 } 129 }
129 130
130 } 131 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698