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

Side by Side 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 DevTools part of patch. Resolved some comments 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014 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_DEVTOOLS_NETWORK_TRANSACTION_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "net/base/completion_callback.h"
10 #include "net/base/load_states.h"
11 #include "net/base/net_export.h"
12 #include "net/base/request_priority.h"
13 #include "net/base/upload_progress.h"
14 #include "net/http/http_transaction.h"
15 #include "net/websockets/websocket_handshake_stream_base.h"
16
17 class DevToolsNetworkController;
18 class GURL;
19
20 namespace net {
21 class AuthCredentials;
22 class BoundNetLog;
23 class HttpRequestHeaders;
24 struct HttpRequestInfo;
25 class HttpResponseInfo;
26 class HttpNetworkSession;
27 class IOBuffer;
28 struct LoadTimingInfo;
29 class X509Certificate;
30 } // namespace net
31
32 class NET_EXPORT DevToolsNetworkTransaction : public net::HttpTransaction {
33 public:
34 DevToolsNetworkTransaction(
35 const base::WeakPtr<DevToolsNetworkController>& controller,
36 scoped_ptr<net::HttpTransaction>& network_transaction);
37
38 virtual ~DevToolsNetworkTransaction();
39
40 std::string GetId();
41 const GURL& GetURL();
42 void Stop();
43
44 // HttpTransaction methods:
45 virtual int Start(
46 const net::HttpRequestInfo* request_info,
47 const net::CompletionCallback& callback,
48 const net::BoundNetLog& net_log) OVERRIDE;
49 virtual int RestartIgnoringLastError(
50 const net::CompletionCallback& callback) OVERRIDE;
51 virtual int RestartWithCertificate(
52 net::X509Certificate* client_cert,
53 const net::CompletionCallback& callback) OVERRIDE;
54 virtual int RestartWithAuth(
55 const net::AuthCredentials& credentials,
56 const net::CompletionCallback& callback) OVERRIDE;
57 virtual bool IsReadyToRestartForAuth() OVERRIDE;
58
59 virtual int Read(
60 net::IOBuffer* buf,
61 int buf_len,
62 const net::CompletionCallback& callback) OVERRIDE;
63 virtual void StopCaching() OVERRIDE;
64 virtual bool GetFullRequestHeaders(
65 net::HttpRequestHeaders* headers) const OVERRIDE;
66 virtual int64 GetTotalReceivedBytes() const OVERRIDE;
67 virtual void DoneReading() OVERRIDE;
68 virtual const net::HttpResponseInfo* GetResponseInfo() const OVERRIDE;
69 virtual net::LoadState GetLoadState() const OVERRIDE;
70 virtual net::UploadProgress GetUploadProgress() const OVERRIDE;
71 virtual void SetQuicServerInfo(
72 net::QuicServerInfo* quic_server_info) OVERRIDE;
73 virtual bool GetLoadTimingInfo(
74 net::LoadTimingInfo* load_timing_info) const OVERRIDE;
75 virtual void SetPriority(net::RequestPriority priority) OVERRIDE;
76 virtual void SetWebSocketHandshakeStreamCreateHelper(
77 net::WebSocketHandshakeStreamBase::CreateHelper* create_helper) OVERRIDE;
78 virtual void SetBeforeNetworkStartCallback(
79 const BeforeNetworkStartCallback& callback) OVERRIDE;
80 virtual int ResumeNetworkStart() OVERRIDE;
81
82 private:
83 void OnCallback(int result);
84
85 base::WeakPtr<DevToolsNetworkController> controller_;
86 scoped_ptr<net::HttpTransaction> network_transaction_;
87 const std::string id_;
88 GURL url_;
89 net::CompletionCallback proxy_callback_;
90 net::CompletionCallback callback_;
91
92 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransaction);
93 };
94
95 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698