OLD | NEW |
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 CHROME_BROWSER_DEVTOOLS_DEVICE_USB_ANDROID_USB_SOCKET_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_USB_ANDROID_USB_SOCKET_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_USB_ANDROID_USB_SOCKET_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_USB_ANDROID_USB_SOCKET_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 int buf_len, | 40 int buf_len, |
41 const net::CompletionCallback& callback) override; | 41 const net::CompletionCallback& callback) override; |
42 int SetReceiveBufferSize(int32_t size) override; | 42 int SetReceiveBufferSize(int32_t size) override; |
43 int SetSendBufferSize(int32_t size) override; | 43 int SetSendBufferSize(int32_t size) override; |
44 int Connect(const net::CompletionCallback& callback) override; | 44 int Connect(const net::CompletionCallback& callback) override; |
45 void Disconnect() override; | 45 void Disconnect() override; |
46 bool IsConnected() const override; | 46 bool IsConnected() const override; |
47 bool IsConnectedAndIdle() const override; | 47 bool IsConnectedAndIdle() const override; |
48 int GetPeerAddress(net::IPEndPoint* address) const override; | 48 int GetPeerAddress(net::IPEndPoint* address) const override; |
49 int GetLocalAddress(net::IPEndPoint* address) const override; | 49 int GetLocalAddress(net::IPEndPoint* address) const override; |
50 const net::BoundNetLog& NetLog() const override; | 50 const net::NetLogWithSource& NetLog() const override; |
51 void SetSubresourceSpeculation() override; | 51 void SetSubresourceSpeculation() override; |
52 void SetOmniboxSpeculation() override; | 52 void SetOmniboxSpeculation() override; |
53 bool WasEverUsed() const override; | 53 bool WasEverUsed() const override; |
54 bool WasNpnNegotiated() const override; | 54 bool WasNpnNegotiated() const override; |
55 net::NextProto GetNegotiatedProtocol() const override; | 55 net::NextProto GetNegotiatedProtocol() const override; |
56 bool GetSSLInfo(net::SSLInfo* ssl_info) override; | 56 bool GetSSLInfo(net::SSLInfo* ssl_info) override; |
57 void GetConnectionAttempts(net::ConnectionAttempts* out) const override; | 57 void GetConnectionAttempts(net::ConnectionAttempts* out) const override; |
58 void ClearConnectionAttempts() override {} | 58 void ClearConnectionAttempts() override {} |
59 void AddConnectionAttempts(const net::ConnectionAttempts& attempts) override { | 59 void AddConnectionAttempts(const net::ConnectionAttempts& attempts) override { |
60 } | 60 } |
61 int64_t GetTotalReceivedBytes() const override; | 61 int64_t GetTotalReceivedBytes() const override; |
62 | 62 |
63 private: | 63 private: |
64 void RespondToReader(bool disconnect); | 64 void RespondToReader(bool disconnect); |
65 void RespondToWriter(int result); | 65 void RespondToWriter(int result); |
66 | 66 |
67 scoped_refptr<AndroidUsbDevice> device_; | 67 scoped_refptr<AndroidUsbDevice> device_; |
68 std::string command_; | 68 std::string command_; |
69 uint32_t local_id_; | 69 uint32_t local_id_; |
70 uint32_t remote_id_; | 70 uint32_t remote_id_; |
71 net::BoundNetLog net_log_; | 71 net::NetLogWithSource net_log_; |
72 bool is_connected_; | 72 bool is_connected_; |
73 std::string read_buffer_; | 73 std::string read_buffer_; |
74 scoped_refptr<net::IOBuffer> read_io_buffer_; | 74 scoped_refptr<net::IOBuffer> read_io_buffer_; |
75 int read_length_; | 75 int read_length_; |
76 int write_length_; | 76 int write_length_; |
77 net::CompletionCallback connect_callback_; | 77 net::CompletionCallback connect_callback_; |
78 net::CompletionCallback read_callback_; | 78 net::CompletionCallback read_callback_; |
79 net::CompletionCallback write_callback_; | 79 net::CompletionCallback write_callback_; |
80 base::Closure delete_callback_; | 80 base::Closure delete_callback_; |
81 base::WeakPtrFactory<AndroidUsbSocket> weak_factory_; | 81 base::WeakPtrFactory<AndroidUsbSocket> weak_factory_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(AndroidUsbSocket); | 83 DISALLOW_COPY_AND_ASSIGN(AndroidUsbSocket); |
84 }; | 84 }; |
85 | 85 |
86 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_USB_ANDROID_USB_SOCKET_H_ | 86 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_USB_ANDROID_USB_SOCKET_H_ |
OLD | NEW |