summaryrefslogtreecommitdiffstats
path: root/content/renderer/bluetooth
diff options
context:
space:
mode:
authorkalman <kalman@chromium.org>2015-09-04 13:28:59 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-04 20:29:40 +0000
commitd1ab2c352c45427399f9f0730ac87e66e319d277 (patch)
treeefd4634a1a40e49f45ea0f68387b64361701f159 /content/renderer/bluetooth
parentff506f629332dbeb3efb3df73cf8ff5b168312e8 (diff)
downloadchromium_src-d1ab2c352c45427399f9f0730ac87e66e319d277.zip
chromium_src-d1ab2c352c45427399f9f0730ac87e66e319d277.tar.gz
chromium_src-d1ab2c352c45427399f9f0730ac87e66e319d277.tar.bz2
Move WorkerTaskRunner observer interface to WorkerThread.
This moves WorkerTaskRunner::Observer to WorkerThread::Observer, and renames WorkerTaskRunner::Add/RemoveStopObserver to WorkerThread::DidStartCurrentWorkerThread/WillStopCurrentWorkerThread. Some other code made sense to shuffle around while doing so. BUG=501569 R=kinuko@chromium.org Review URL: https://codereview.chromium.org/1307643006 Cr-Commit-Position: refs/heads/master@{#347479}
Diffstat (limited to 'content/renderer/bluetooth')
-rw-r--r--content/renderer/bluetooth/bluetooth_dispatcher.cc6
-rw-r--r--content/renderer/bluetooth/bluetooth_dispatcher.h8
2 files changed, 7 insertions, 7 deletions
diff --git a/content/renderer/bluetooth/bluetooth_dispatcher.cc b/content/renderer/bluetooth/bluetooth_dispatcher.cc
index 1a38354..1a4679e 100644
--- a/content/renderer/bluetooth/bluetooth_dispatcher.cc
+++ b/content/renderer/bluetooth/bluetooth_dispatcher.cc
@@ -72,7 +72,7 @@ base::LazyInstance<base::ThreadLocalPointer<void>>::Leaky g_dispatcher_tls =
void* const kHasBeenDeleted = reinterpret_cast<void*>(0x1);
int CurrentWorkerId() {
- return WorkerTaskRunner::Instance()->CurrentWorkerId();
+ return WorkerThread::GetCurrentId();
}
WebBluetoothDevice::VendorIDSource GetWebVendorIdSource(
@@ -111,7 +111,7 @@ BluetoothDispatcher* BluetoothDispatcher::GetOrCreateThreadSpecificInstance(
BluetoothDispatcher* dispatcher = new BluetoothDispatcher(thread_safe_sender);
if (CurrentWorkerId())
- WorkerTaskRunner::Instance()->AddStopObserver(dispatcher);
+ WorkerThread::AddObserver(dispatcher);
return dispatcher;
}
@@ -225,7 +225,7 @@ void BluetoothDispatcher::writeValue(
CurrentWorkerId(), request_id, characteristic_instance_id.utf8(), value));
}
-void BluetoothDispatcher::OnWorkerRunLoopStopped() {
+void BluetoothDispatcher::WillStopCurrentWorkerThread() {
delete this;
}
diff --git a/content/renderer/bluetooth/bluetooth_dispatcher.h b/content/renderer/bluetooth/bluetooth_dispatcher.h
index 1a704a7..4109414 100644
--- a/content/renderer/bluetooth/bluetooth_dispatcher.h
+++ b/content/renderer/bluetooth/bluetooth_dispatcher.h
@@ -7,8 +7,8 @@
#include "base/id_map.h"
#include "base/memory/ref_counted.h"
-#include "content/child/worker_task_runner.h"
#include "content/common/bluetooth/bluetooth_device.h"
+#include "content/public/child/worker_thread.h"
#include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h"
#include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothError.h"
@@ -35,7 +35,7 @@ class ThreadSafeSender;
// Incoming IPC messages are received by the BluetoothMessageFilter and
// directed to the thread specific instance of this class.
// Outgoing messages come from WebBluetoothImpl.
-class BluetoothDispatcher : public WorkerTaskRunner::Observer {
+class BluetoothDispatcher : public WorkerThread::Observer {
public:
explicit BluetoothDispatcher(ThreadSafeSender* sender);
~BluetoothDispatcher() override;
@@ -70,8 +70,8 @@ class BluetoothDispatcher : public WorkerTaskRunner::Observer {
const std::vector<uint8_t>& value,
blink::WebBluetoothWriteValueCallbacks*);
- // WorkerTaskRunner::Observer implementation.
- void OnWorkerRunLoopStopped() override;
+ // WorkerThread::Observer implementation.
+ void WillStopCurrentWorkerThread() override;
private:
// IPC Handlers, see definitions in bluetooth_messages.h.