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

Side by Side Diff: content/child/bluetooth/bluetooth_dispatcher.cc

Issue 1142303002: Revert of bluetooth: Move testing IPC from BluetoothDispatcher to BlinkTestRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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 #include "content/child/bluetooth/bluetooth_dispatcher.h" 5 #include "content/child/bluetooth/bluetooth_dispatcher.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 void BluetoothDispatcher::connectGATT( 115 void BluetoothDispatcher::connectGATT(
116 const blink::WebString& device_instance_id, 116 const blink::WebString& device_instance_id,
117 blink::WebBluetoothConnectGATTCallbacks* callbacks) { 117 blink::WebBluetoothConnectGATTCallbacks* callbacks) {
118 int request_id = pending_connect_requests_.Add(callbacks); 118 int request_id = pending_connect_requests_.Add(callbacks);
119 Send(new BluetoothHostMsg_ConnectGATT(CurrentWorkerId(), request_id, 119 Send(new BluetoothHostMsg_ConnectGATT(CurrentWorkerId(), request_id,
120 device_instance_id.utf8())); 120 device_instance_id.utf8()));
121 } 121 }
122 122
123 void BluetoothDispatcher::SetBluetoothMockDataSetForTesting(
124 const std::string& name) {
125 Send(new BluetoothHostMsg_SetBluetoothMockDataSetForTesting(name));
126 }
127
123 void BluetoothDispatcher::OnWorkerRunLoopStopped() { 128 void BluetoothDispatcher::OnWorkerRunLoopStopped() {
124 delete this; 129 delete this;
125 } 130 }
126 131
127 void BluetoothDispatcher::OnRequestDeviceSuccess( 132 void BluetoothDispatcher::OnRequestDeviceSuccess(
128 int thread_id, 133 int thread_id,
129 int request_id, 134 int request_id,
130 const BluetoothDevice& device) { 135 const BluetoothDevice& device) {
131 DCHECK(pending_requests_.Lookup(request_id)) << request_id; 136 DCHECK(pending_requests_.Lookup(request_id)) << request_id;
132 137
(...skipping 25 matching lines...) Expand all
158 int request_id, 163 int request_id,
159 BluetoothError error_type) { 164 BluetoothError error_type) {
160 DCHECK(pending_requests_.Lookup(request_id)) << request_id; 165 DCHECK(pending_requests_.Lookup(request_id)) << request_id;
161 pending_requests_.Lookup(request_id) 166 pending_requests_.Lookup(request_id)
162 ->onError(new WebBluetoothError( 167 ->onError(new WebBluetoothError(
163 WebBluetoothErrorFromBluetoothError(error_type), "")); 168 WebBluetoothErrorFromBluetoothError(error_type), ""));
164 pending_requests_.Remove(request_id); 169 pending_requests_.Remove(request_id);
165 } 170 }
166 171
167 } // namespace content 172 } // namespace content
OLDNEW
« no previous file with comments | « content/child/bluetooth/bluetooth_dispatcher.h ('k') | content/child/bluetooth/web_bluetooth_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698