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

Side by Side Diff: chrome/browser/devtools/protocol_http_request.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
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_PROTOCOL_HTTP_REQUEST_H_
6 #define CHROME_BROWSER_DEVTOOLS_PROTOCOL_HTTP_REQUEST_H_
7
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "net/base/io_buffer.h"
11 #include "net/url_request/url_request.h"
12
13 namespace net {
14 class URLRequestContextGetter;
15 }
16
17 class Profile;
18
19 class ProtocolHttpRequest : public net::URLRequest::Delegate {
20 public:
21 typedef base::Callback<void(const std::string& error,
22 const std::string& data)> Callback;
23
24 ProtocolHttpRequest(Profile* profile,
25 const std::string& url,
26 const Callback& callback);
27
28 private:
29 virtual ~ProtocolHttpRequest();
30
31 void Start();
32
33 // net::URLRequest::Delegate implementation.
34 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE;
35 virtual void OnReadCompleted(net::URLRequest* request,
36 int bytes_read) OVERRIDE;
37
38 void RespondOnUIThread();
39
40 net::URLRequestContextGetter* request_context_;
41 GURL url_;
42 Callback callback_;
43
44 std::string error_;
45 std::string data_;
46 scoped_refptr<net::IOBuffer> io_buffer_;
47 net::URLRequest* request_;
48
49 DISALLOW_COPY_AND_ASSIGN(ProtocolHttpRequest);
50 };
51
52 #endif // CHROME_BROWSER_DEVTOOLS_PROTOCOL_HTTP_REQUEST_H_
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_adb_bridge.cc ('k') | chrome/browser/devtools/protocol_http_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698