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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/protocol_http_request.h
diff --git a/chrome/browser/devtools/protocol_http_request.h b/chrome/browser/devtools/protocol_http_request.h
new file mode 100644
index 0000000000000000000000000000000000000000..abd1e5c0a99af197daffc0331a190d0ae608c2a8
--- /dev/null
+++ b/chrome/browser/devtools/protocol_http_request.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DEVTOOLS_PROTOCOL_HTTP_REQUEST_H_
+#define CHROME_BROWSER_DEVTOOLS_PROTOCOL_HTTP_REQUEST_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "net/base/io_buffer.h"
+#include "net/url_request/url_request.h"
+
+namespace net {
+class URLRequestContextGetter;
+}
+
+class Profile;
+
+class ProtocolHttpRequest : public net::URLRequest::Delegate {
+ public:
+ typedef base::Callback<void(const std::string& error,
+ const std::string& data)> Callback;
+
+ ProtocolHttpRequest(Profile* profile,
+ const std::string& url,
+ const Callback& callback);
+
+ private:
+ virtual ~ProtocolHttpRequest();
+
+ void Start();
+
+ // net::URLRequest::Delegate implementation.
+ virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE;
+ virtual void OnReadCompleted(net::URLRequest* request,
+ int bytes_read) OVERRIDE;
+
+ void RespondOnUIThread();
+
+ net::URLRequestContextGetter* request_context_;
+ GURL url_;
+ Callback callback_;
+
+ std::string error_;
+ std::string data_;
+ scoped_refptr<net::IOBuffer> io_buffer_;
+ net::URLRequest* request_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProtocolHttpRequest);
+};
+
+#endif // CHROME_BROWSER_DEVTOOLS_PROTOCOL_HTTP_REQUEST_H_
« 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