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

Side by Side Diff: content/browser/bluetooth/bluetooth_dispatcher_host.h

Issue 1120373004: bluetooth: Browser-side implementation of connectGATT. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-request-device-implementation
Patch Set: Address jyasskin's comments 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/browser/bluetooth/bluetooth_dispatcher_host.cc » ('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 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "content/common/bluetooth/bluetooth_error.h" 10 #include "content/common/bluetooth/bluetooth_error.h"
11 #include "content/public/browser/browser_message_filter.h" 11 #include "content/public/browser/browser_message_filter.h"
12 #include "device/bluetooth/bluetooth_adapter.h" 12 #include "device/bluetooth/bluetooth_adapter.h"
13 #include "device/bluetooth/bluetooth_gatt_connection.h"
13 14
14 namespace content { 15 namespace content {
15 16
16 // Dispatches and sends bluetooth related messages sent to/from a child 17 // Dispatches and sends bluetooth related messages sent to/from a child
17 // process BluetoothDispatcher from/to the main browser process. 18 // process BluetoothDispatcher from/to the main browser process.
18 // 19 //
19 // Intended to be instantiated by the RenderProcessHost and installed as 20 // Intended to be instantiated by the RenderProcessHost and installed as
20 // a filter on the channel. BrowserMessageFilter is refcounted and typically 21 // a filter on the channel. BrowserMessageFilter is refcounted and typically
21 // lives as long as it is installed on a channel. 22 // lives as long as it is installed on a channel.
22 // 23 //
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // Stop in progress discovery session. 64 // Stop in progress discovery session.
64 void StopDiscoverySession( 65 void StopDiscoverySession(
65 int thread_id, 66 int thread_id,
66 int request_id, 67 int request_id,
67 scoped_ptr<device::BluetoothDiscoverySession> discovery_session); 68 scoped_ptr<device::BluetoothDiscoverySession> discovery_session);
68 69
69 // Callbacks for BluetoothDiscoverySession::Stop. 70 // Callbacks for BluetoothDiscoverySession::Stop.
70 void OnDiscoverySessionStopped(int thread_id, int request_id); 71 void OnDiscoverySessionStopped(int thread_id, int request_id);
71 void OnDiscoverySessionStoppedError(int thread_id, int request_id); 72 void OnDiscoverySessionStoppedError(int thread_id, int request_id);
72 73
74 // Callbacks for BluetoothDevice::CreateGattConnection
75 void OnGATTConnectionCreated(
76 int thread_id,
77 int request_id,
78 const std::string& device_instance_id,
79 scoped_ptr<device::BluetoothGattConnection> connection);
80 void OnCreateGATTConnectionError(
81 int thread_id,
82 int request_id,
83 const std::string& device_instance_id,
84 device::BluetoothDevice::ConnectErrorCode error_code);
85
73 // Defines how long to scan for. 86 // Defines how long to scan for.
74 int current_scan_time_; 87 int current_scan_time_;
75 88
76 // A BluetoothAdapter instance representing an adapter of the system. 89 // A BluetoothAdapter instance representing an adapter of the system.
77 scoped_refptr<device::BluetoothAdapter> adapter_; 90 scoped_refptr<device::BluetoothAdapter> adapter_;
78 91
79 // Must be last member, see base/memory/weak_ptr.h documentation 92 // Must be last member, see base/memory/weak_ptr.h documentation
80 base::WeakPtrFactory<BluetoothDispatcherHost> weak_ptr_factory_; 93 base::WeakPtrFactory<BluetoothDispatcherHost> weak_ptr_factory_;
81 94
82 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcherHost); 95 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcherHost);
83 }; 96 };
84 97
85 } // namespace content 98 } // namespace content
86 99
87 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ 100 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698