OLD | NEW |
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 explicit TaskObserverAdapter(WebThread::TaskObserver* observer) |
23 : observer_(observer) { } | 23 : observer_(observer) { } |
24 | 24 |
25 virtual void WillProcessTask(base::TimeTicks) OVERRIDE { | 25 virtual void WillProcessTask(base::TimeTicks) OVERRIDE { |
26 observer_->willProcessTask(); | 26 observer_->willProcessTask(); |
27 } | 27 } |
28 | 28 |
29 virtual void DidProcessTask(base::TimeTicks) OVERRIDE { | 29 virtual void DidProcessTask(base::TimeTicks) OVERRIDE { |
30 observer_->didProcessTask(); | 30 observer_->didProcessTask(); |
31 } | 31 } |
32 | 32 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 | 123 |
124 bool WebThreadImplForMessageLoop::IsCurrentThread() const { | 124 bool WebThreadImplForMessageLoop::IsCurrentThread() const { |
125 return message_loop_->BelongsToCurrentThread(); | 125 return message_loop_->BelongsToCurrentThread(); |
126 } | 126 } |
127 | 127 |
128 WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() { | 128 WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() { |
129 } | 129 } |
130 | 130 |
131 } | 131 } |
OLD | NEW |