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

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

Issue 180163009: chrome.bluetooth API improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix threading ownership related to ApiResourceManager<BluetoothApiSocket> and BluetoothSocketEventD… 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_SOCKET_MAC_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_MAC_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_MAC_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 25 matching lines...) Expand all
36 public: 36 public:
37 // TODO(youngki): This method is deprecated; remove this method when 37 // TODO(youngki): This method is deprecated; remove this method when
38 // BluetoothServiceRecord is removed. 38 // BluetoothServiceRecord is removed.
39 static scoped_refptr<BluetoothSocket> CreateBluetoothSocket( 39 static scoped_refptr<BluetoothSocket> CreateBluetoothSocket(
40 const BluetoothServiceRecord& service_record); 40 const BluetoothServiceRecord& service_record);
41 41
42 static scoped_refptr<BluetoothSocket> CreateBluetoothSocket( 42 static scoped_refptr<BluetoothSocket> CreateBluetoothSocket(
43 IOBluetoothSDPServiceRecord* record); 43 IOBluetoothSDPServiceRecord* record);
44 44
45 // BluetoothSocket override 45 // BluetoothSocket override
46 virtual bool Receive(net::GrowableIOBuffer* buffer) OVERRIDE; 46 virtual void Connect(const base::Closure& success_callback,
47 virtual bool Send(net::DrainableIOBuffer* buffer) OVERRIDE; 47 const ErrorCompletionCallback& error_callback) OVERRIDE;
48 virtual std::string GetLastErrorMessage() const OVERRIDE; 48 virtual void Disconnect(const base::Closure& callback) OVERRIDE;
49 virtual void Receive(int count,
50 const ReceiveCompletionCallback& success_callback,
51 const ReceiveErrorCompletionCallback& error_callback)
52 OVERRIDE;
53 virtual void Send(scoped_refptr<net::DrainableIOBuffer> buffer,
54 const SendCompletionCallback& success_callback,
55 const ErrorCompletionCallback& error_callback) OVERRIDE;
49 56
50 // called by BluetoothRFCOMMChannelDelegate. 57 // called by BluetoothRFCOMMChannelDelegate.
51 void OnDataReceived(IOBluetoothRFCOMMChannel* rfcomm_channel, 58 void OnDataReceived(IOBluetoothRFCOMMChannel* rfcomm_channel,
52 void* data, 59 void* data,
53 size_t length); 60 size_t length);
54 61
55 protected: 62 protected:
56 virtual ~BluetoothSocketMac(); 63 virtual ~BluetoothSocketMac();
57 64
58 private: 65 private:
59 explicit BluetoothSocketMac(IOBluetoothRFCOMMChannel* rfcomm_channel); 66 explicit BluetoothSocketMac(IOBluetoothRFCOMMChannel* rfcomm_channel);
60 67
61 void ResetIncomingDataBuffer(); 68 void ResetIncomingDataBuffer();
62 69
63 IOBluetoothRFCOMMChannel* rfcomm_channel_; 70 IOBluetoothRFCOMMChannel* rfcomm_channel_;
64 BluetoothRFCOMMChannelDelegate* delegate_; 71 BluetoothRFCOMMChannelDelegate* delegate_;
65 scoped_refptr<net::GrowableIOBuffer> incoming_data_buffer_; 72 scoped_refptr<net::GrowableIOBuffer> incoming_data_buffer_;
66 std::string error_message_; 73 std::string error_message_;
67 74
68 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketMac); 75 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketMac);
69 }; 76 };
70 77
71 } // namespace device 78 } // namespace device
72 79
73 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_MAC_H_ 80 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698