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

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

Issue 12586010: DevTools: extract ADB command classes, change objects' lifetimes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win build fixed. 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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_ADB_CLIENT_SOCKET_H_ 5 #ifndef CHROME_BROWSER_DEVTOOLS_ADB_CLIENT_SOCKET_H_
6 #define CHROME_BROWSER_DEVTOOLS_ADB_CLIENT_SOCKET_H_ 6 #define CHROME_BROWSER_DEVTOOLS_ADB_CLIENT_SOCKET_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/socket/tcp_client_socket.h" 10 #include "net/socket/tcp_client_socket.h"
(...skipping 13 matching lines...) Expand all
24 const std::string& socket_name, 24 const std::string& socket_name,
25 const std::string& request, 25 const std::string& request,
26 const CommandCallback& callback); 26 const CommandCallback& callback);
27 27
28 static void HttpQuery(int port, 28 static void HttpQuery(int port,
29 const std::string& serial, 29 const std::string& serial,
30 const std::string& socket_name, 30 const std::string& socket_name,
31 const std::string& request, 31 const std::string& request,
32 const SocketCallback& callback); 32 const SocketCallback& callback);
33 33
34 AdbClientSocket(const std::string& host, int port);
35 ~AdbClientSocket();
36
37 protected:
38 void Connect(const net::CompletionCallback& callback);
39
40 void SendCommand(const std::string& command,
41 bool is_void,
42 const CommandCallback& callback);
43
44 scoped_ptr<net::TCPClientSocket> socket_;
45
34 private: 46 private:
35 AdbClientSocket(); 47 void ReadResponse(const CommandCallback& callback, bool is_void, int result);
36 ~AdbClientSocket(); 48
49 void OnResponseHeader(const CommandCallback& callback,
50 bool is_void,
51 scoped_refptr<net::IOBuffer> response_buffer,
52 int result);
53
54 void OnResponseData(const CommandCallback& callback,
55 const std::string& response,
56 scoped_refptr<net::IOBuffer> response_buffer,
57 int bytes_left,
58 int result);
59
60 std::string host_;
61 int port_;
37 62
38 DISALLOW_COPY_AND_ASSIGN(AdbClientSocket); 63 DISALLOW_COPY_AND_ASSIGN(AdbClientSocket);
39 }; 64 };
40 65
41 #endif // CHROME_BROWSER_DEVTOOLS_ADB_CLIENT_SOCKET_H_ 66 #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