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

Side by Side Diff: device/bluetooth/bluetooth_profile_win.h

Issue 180163009: chrome.bluetooth API improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review feedback, simplify threading model. Created 6 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "device/bluetooth/bluetooth_profile.h" 10 #include "device/bluetooth/bluetooth_profile.h"
11 #include "net/base/net_log.h"
11 12
12 namespace device { 13 namespace device {
13 14
14 class BluetoothDeviceWin; 15 class BluetoothDeviceWin;
16 class BluetoothSocketThreadWin;
15 17
16 class BluetoothProfileWin : public BluetoothProfile { 18 class BluetoothProfileWin : public BluetoothProfile {
17 public: 19 public:
18 // BluetoothProfile override. 20 // BluetoothProfile override.
19 virtual void Unregister() OVERRIDE; 21 virtual void Unregister() OVERRIDE;
20 virtual void SetConnectionCallback( 22 virtual void SetConnectionCallback(
21 const ConnectionCallback& callback) OVERRIDE; 23 const ConnectionCallback& callback) OVERRIDE;
22 24
23 bool Connect(const BluetoothDeviceWin* device); 25 typedef base::Callback<void(const std::string&)> ErrorCallback;
26
27 void Connect(const BluetoothDeviceWin* device,
28 scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
29 scoped_refptr<BluetoothSocketThreadWin> socket_thread,
30 net::NetLog* net_log,
31 const net::NetLog::Source& source,
32 const base::Closure& callback,
33 const ErrorCallback& error_callback);
24 34
25 private: 35 private:
26 friend BluetoothProfile; 36 friend BluetoothProfile;
27 37
28 BluetoothProfileWin(const std::string& uuid, const std::string& name); 38 BluetoothProfileWin(const std::string& uuid, const std::string& name);
29 virtual ~BluetoothProfileWin(); 39 virtual ~BluetoothProfileWin();
30 40
31 const std::string uuid_; 41 const std::string uuid_;
32 const std::string name_; 42 const std::string name_;
33 ConnectionCallback connection_callback_; 43 ConnectionCallback connection_callback_;
44
45 DISALLOW_COPY_AND_ASSIGN(BluetoothProfileWin);
34 }; 46 };
35 47
36 } // namespace device 48 } // namespace device
37 49
38 #endif // DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_H_ 50 #endif // DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698