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

Side by Side Diff: chrome/browser/devtools/adb_client_socket.h

Issue 12559008: DevTools: add backend for discovering connected ADB devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Offline review comments addressed Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/devtools/adb_client_socket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_DEVTOOLS_ADB_CLIENT_SOCKET_H_
6 #define CHROME_BROWSER_DEVTOOLS_ADB_CLIENT_SOCKET_H_
7
8 #include "base/callback.h"
9 #include "net/base/io_buffer.h"
10 #include "net/socket/tcp_client_socket.h"
11
12 class ADBClientSocket {
13 public:
14 typedef base::Callback<void(const std::string& error,
15 const std::string& data)> Callback;
16
17 static void Query(int port,
18 const std::string& query,
19 const Callback& callback);
20
21 private:
22 ADBClientSocket();
23 ~ADBClientSocket();
24
25 void InnerQuery(int port, const std::string& query, const Callback& callback);
26 void OnConnectComplete(scoped_refptr<net::StringIOBuffer> request_buffer,
27 int result);
28 void OnWriteComplete(int result);
29 void OnReadComplete(scoped_refptr<net::IOBuffer> response_buffer,
30 int result);
31 bool CheckNetResultOrDie(int result);
32 void ReportSuccessAndDie();
33 void ReportInvalidResponseAndDie();
34 void ReportErrorAndDie(const std::string& error);
35 void Destroy();
36
37 Callback callback_;
38 scoped_ptr<net::TCPClientSocket> socket_;
39 std::string response_;
40 int expected_response_length_;
41
42 DISALLOW_COPY_AND_ASSIGN(ADBClientSocket);
43 };
44
45 #endif // CHROME_BROWSER_DEVTOOLS_ADB_CLIENT_SOCKET_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/devtools/adb_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698