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

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

Issue 1159523002: bluetooth: Browser side partial implementation of getPrimaryService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/sevice/service Created 5 years, 6 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 #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"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; 46 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
47 47
48 // Set |adapter_| to a BluetoothAdapter instance and register observers, 48 // Set |adapter_| to a BluetoothAdapter instance and register observers,
49 // releasing references to previous |adapter_|. 49 // releasing references to previous |adapter_|.
50 void set_adapter(scoped_refptr<device::BluetoothAdapter> adapter); 50 void set_adapter(scoped_refptr<device::BluetoothAdapter> adapter);
51 51
52 // IPC Handlers, see definitions in bluetooth_messages.h. 52 // IPC Handlers, see definitions in bluetooth_messages.h.
53 void OnRequestDevice(int thread_id, int request_id); 53 void OnRequestDevice(int thread_id, int request_id);
54 void OnConnectGATT(int thread_id, int request_id, 54 void OnConnectGATT(int thread_id, int request_id,
55 const std::string& device_instance_id); 55 const std::string& device_instance_id);
56 void OnGetPrimaryService(int thread_id,
57 int request_id,
58 const std::string& device_instance_id,
59 const std::string& service_uuid);
56 60
57 // Callbacks for BluetoothAdapter::StartDiscoverySession. 61 // Callbacks for BluetoothAdapter::StartDiscoverySession.
58 void OnDiscoverySessionStarted( 62 void OnDiscoverySessionStarted(
59 int thread_id, 63 int thread_id,
60 int request_id, 64 int request_id,
61 scoped_ptr<device::BluetoothDiscoverySession> discovery_session); 65 scoped_ptr<device::BluetoothDiscoverySession> discovery_session);
62 void OnDiscoverySessionStartedError(int thread_id, int request_id); 66 void OnDiscoverySessionStartedError(int thread_id, int request_id);
63 67
64 // Stop in progress discovery session. 68 // Stop in progress discovery session.
65 void StopDiscoverySession( 69 void StopDiscoverySession(
(...skipping 10 matching lines...) Expand all
76 int thread_id, 80 int thread_id,
77 int request_id, 81 int request_id,
78 const std::string& device_instance_id, 82 const std::string& device_instance_id,
79 scoped_ptr<device::BluetoothGattConnection> connection); 83 scoped_ptr<device::BluetoothGattConnection> connection);
80 void OnCreateGATTConnectionError( 84 void OnCreateGATTConnectionError(
81 int thread_id, 85 int thread_id,
82 int request_id, 86 int request_id,
83 const std::string& device_instance_id, 87 const std::string& device_instance_id,
84 device::BluetoothDevice::ConnectErrorCode error_code); 88 device::BluetoothDevice::ConnectErrorCode error_code);
85 89
86 // Defines how long to scan for. 90 // Callback for future BluetoothAdapter::ServicesDiscovered callback:
87 int current_scan_time_; 91 // For now we just post a delayed task.
92 // See: https://crbug.com/484504
93 void OnServicesDiscovered(int thread_id,
94 int request_id,
95 const std::string& device_instance_id,
96 const std::string& service_uuid);
97
98 // Defines how long to scan for and how long to discover services for.
99 int current_delay_time_;
88 100
89 // A BluetoothAdapter instance representing an adapter of the system. 101 // A BluetoothAdapter instance representing an adapter of the system.
90 scoped_refptr<device::BluetoothAdapter> adapter_; 102 scoped_refptr<device::BluetoothAdapter> adapter_;
91 103
92 // Must be last member, see base/memory/weak_ptr.h documentation 104 // Must be last member, see base/memory/weak_ptr.h documentation
93 base::WeakPtrFactory<BluetoothDispatcherHost> weak_ptr_factory_; 105 base::WeakPtrFactory<BluetoothDispatcherHost> weak_ptr_factory_;
94 106
95 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcherHost); 107 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcherHost);
96 }; 108 };
97 109
98 } // namespace content 110 } // namespace content
99 111
100 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ 112 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698