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

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

Issue 12161002: MessageLoop's RUN method will pass a const ref to PendingTask when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_pipelined_network_transaction_unittest.cc ('k') | 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/pending_task.h"
13 #include "base/threading/platform_thread.h" 14 #include "base/threading/platform_thread.h"
14 15
15 namespace webkit_glue { 16 namespace webkit_glue {
16 17
17 WebThreadBase::WebThreadBase() { } 18 WebThreadBase::WebThreadBase() { }
18 WebThreadBase::~WebThreadBase() { } 19 WebThreadBase::~WebThreadBase() { }
19 20
20 class WebThreadBase::TaskObserverAdapter : public MessageLoop::TaskObserver { 21 class WebThreadBase::TaskObserverAdapter : public MessageLoop::TaskObserver {
21 public: 22 public:
22 TaskObserverAdapter(WebThread::TaskObserver* observer) 23 TaskObserverAdapter(WebThread::TaskObserver* observer)
23 : observer_(observer) { } 24 : observer_(observer) { }
24 25
25 virtual void WillProcessTask(base::TimeTicks) OVERRIDE { 26 virtual void WillProcessTask(const base::PendingTask& pending_task) OVERRIDE {
26 observer_->willProcessTask(); 27 observer_->willProcessTask();
27 } 28 }
28 29
29 virtual void DidProcessTask(base::TimeTicks) OVERRIDE { 30 virtual void DidProcessTask(const base::PendingTask& pending_task) OVERRIDE {
30 observer_->didProcessTask(); 31 observer_->didProcessTask();
31 } 32 }
32 33
33 private: 34 private:
34 WebThread::TaskObserver* observer_; 35 WebThread::TaskObserver* observer_;
35 }; 36 };
36 37
37 void WebThreadBase::addTaskObserver(TaskObserver* observer) { 38 void WebThreadBase::addTaskObserver(TaskObserver* observer) {
38 CHECK(IsCurrentThread()); 39 CHECK(IsCurrentThread());
39 std::pair<TaskObserverMap::iterator, bool> result = task_observer_map_.insert( 40 std::pair<TaskObserverMap::iterator, bool> result = task_observer_map_.insert(
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 123 }
123 124
124 bool WebThreadImplForMessageLoop::IsCurrentThread() const { 125 bool WebThreadImplForMessageLoop::IsCurrentThread() const {
125 return message_loop_->BelongsToCurrentThread(); 126 return message_loop_->BelongsToCurrentThread();
126 } 127 }
127 128
128 WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() { 129 WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() {
129 } 130 }
130 131
131 } 132 }
OLDNEW
« no previous file with comments | « net/http/http_pipelined_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698