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

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

Issue 1118053003: bluetooth: Add NetworkError for Bluetooth on browser side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-connect-gatt-implementation
Patch Set: Remove from bluetooth_dispatcher_host so that we can commit 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
« no previous file with comments | « no previous file | content/common/bluetooth/bluetooth_error.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 21 matching lines...) Expand all
32 BluetoothDispatcher* const kHasBeenDeleted = 32 BluetoothDispatcher* const kHasBeenDeleted =
33 reinterpret_cast<BluetoothDispatcher*>(0x1); 33 reinterpret_cast<BluetoothDispatcher*>(0x1);
34 34
35 int CurrentWorkerId() { 35 int CurrentWorkerId() {
36 return WorkerTaskRunner::Instance()->CurrentWorkerId(); 36 return WorkerTaskRunner::Instance()->CurrentWorkerId();
37 } 37 }
38 38
39 WebBluetoothError::ErrorType WebBluetoothErrorFromBluetoothError( 39 WebBluetoothError::ErrorType WebBluetoothErrorFromBluetoothError(
40 BluetoothError error_type) { 40 BluetoothError error_type) {
41 switch (error_type) { 41 switch (error_type) {
42 case BluetoothError::NETWORK_ERROR:
43 return WebBluetoothError::NetworkError;
42 case BluetoothError::NOT_FOUND: 44 case BluetoothError::NOT_FOUND:
43 return WebBluetoothError::NotFoundError; 45 return WebBluetoothError::NotFoundError;
44 case BluetoothError::SECURITY: 46 case BluetoothError::SECURITY:
45 return WebBluetoothError::SecurityError; 47 return WebBluetoothError::SecurityError;
46 } 48 }
47 NOTIMPLEMENTED(); 49 NOTIMPLEMENTED();
48 return WebBluetoothError::NotFoundError; 50 return WebBluetoothError::NotFoundError;
49 } 51 }
50 52
51 WebBluetoothDevice::VendorIDSource GetWebVendorIdSource( 53 WebBluetoothDevice::VendorIDSource GetWebVendorIdSource(
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 int request_id, 174 int request_id,
173 BluetoothError error_type) { 175 BluetoothError error_type) {
174 DCHECK(pending_connect_requests_.Lookup(request_id)) << request_id; 176 DCHECK(pending_connect_requests_.Lookup(request_id)) << request_id;
175 pending_connect_requests_.Lookup(request_id) 177 pending_connect_requests_.Lookup(request_id)
176 ->onError(new WebBluetoothError( 178 ->onError(new WebBluetoothError(
177 WebBluetoothErrorFromBluetoothError(error_type), "")); 179 WebBluetoothErrorFromBluetoothError(error_type), ""));
178 pending_connect_requests_.Remove(request_id); 180 pending_connect_requests_.Remove(request_id);
179 } 181 }
180 182
181 } // namespace content 183 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/bluetooth/bluetooth_error.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698