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

Unified Diff: chrome/browser/devtools/devtools_network_transaction.h

Issue 182993003: Add the ability for DevTools to wrap network transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added optional QUIC setup in HttpCache constructor Created 6 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
Index: chrome/browser/devtools/devtools_network_transaction.h
diff --git a/chrome/browser/devtools/devtools_network_transaction.h b/chrome/browser/devtools/devtools_network_transaction.h
new file mode 100644
index 0000000000000000000000000000000000000000..909eb10578b5b6ee6c8c367849e04ae248bdbb13
--- /dev/null
+++ b/chrome/browser/devtools/devtools_network_transaction.h
@@ -0,0 +1,93 @@
+// Copyright 2014 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_DEVTOOLS_NETWORK_TRANSACTION_H_
+#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_
+
+#include "net/base/completion_callback.h"
+#include "net/base/load_states.h"
+#include "net/base/net_export.h"
+#include "net/base/request_priority.h"
+#include "net/base/upload_progress.h"
+#include "net/http/http_transaction.h"
+#include "net/websockets/websocket_handshake_stream_base.h"
+
+class DevToolsNetworkController;
+class GURL;
+
+namespace net {
+class AuthCredentials;
+class BoundNetLog;
+class HttpRequestHeaders;
+struct HttpRequestInfo;
+class HttpResponseInfo;
+class HttpNetworkSession;
+class IOBuffer;
+struct LoadTimingInfo;
+class X509Certificate;
+} // namespace net
+
+class NET_EXPORT DevToolsNetworkTransaction : public net::HttpTransaction {
mmenke 2014/03/31 18:10:20 Should more heavily comment this class.
eustas 2014/04/18 12:33:19 Done.
+ public:
+ DevToolsNetworkTransaction(
+ DevToolsNetworkController* controller,
+ scoped_ptr<net::HttpTransaction>& network_transaction);
+
+ virtual ~DevToolsNetworkTransaction();
+
+ const GURL& GetURL() const;
+ void Stop();
+
+ // HttpTransaction methods:
+ virtual int Start(
+ const net::HttpRequestInfo* request_info,
+ const net::CompletionCallback& callback,
+ const net::BoundNetLog& net_log) OVERRIDE;
+ virtual int RestartIgnoringLastError(
+ const net::CompletionCallback& callback) OVERRIDE;
+ virtual int RestartWithCertificate(
+ net::X509Certificate* client_cert,
+ const net::CompletionCallback& callback) OVERRIDE;
+ virtual int RestartWithAuth(
+ const net::AuthCredentials& credentials,
+ const net::CompletionCallback& callback) OVERRIDE;
+ virtual bool IsReadyToRestartForAuth() OVERRIDE;
+
+ virtual int Read(
+ net::IOBuffer* buf,
+ int buf_len,
+ const net::CompletionCallback& callback) OVERRIDE;
+ virtual void StopCaching() OVERRIDE;
+ virtual bool GetFullRequestHeaders(
+ net::HttpRequestHeaders* headers) const OVERRIDE;
+ virtual int64 GetTotalReceivedBytes() const OVERRIDE;
+ virtual void DoneReading() OVERRIDE;
+ virtual const net::HttpResponseInfo* GetResponseInfo() const OVERRIDE;
+ virtual net::LoadState GetLoadState() const OVERRIDE;
+ virtual net::UploadProgress GetUploadProgress() const OVERRIDE;
+ virtual void SetQuicServerInfo(
+ net::QuicServerInfo* quic_server_info) OVERRIDE;
+ virtual bool GetLoadTimingInfo(
+ net::LoadTimingInfo* load_timing_info) const OVERRIDE;
+ virtual void SetPriority(net::RequestPriority priority) OVERRIDE;
+ virtual void SetWebSocketHandshakeStreamCreateHelper(
+ net::WebSocketHandshakeStreamBase::CreateHelper* create_helper) OVERRIDE;
+ virtual void SetBeforeNetworkStartCallback(
+ const BeforeNetworkStartCallback& callback) OVERRIDE;
+ virtual int ResumeNetworkStart() OVERRIDE;
+
+ private:
+ void OnCallback(int result);
+
+ const uint64 id_;
+ DevToolsNetworkController* controller_;
+ scoped_ptr<net::HttpTransaction> network_transaction_;
+ GURL url_;
+ net::CompletionCallback proxy_callback_;
+ net::CompletionCallback callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransaction);
+};
+
+#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_

Powered by Google App Engine
This is Rietveld 408576698