Chromium Code Reviews| Index: chrome/browser/net/network_transaction.h |
| diff --git a/chrome/browser/net/network_transaction.h b/chrome/browser/net/network_transaction.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..08776bcd5f3887a04d5949f9d23073afd714d94d |
| --- /dev/null |
| +++ b/chrome/browser/net/network_transaction.h |
| @@ -0,0 +1,93 @@ |
| +// Copyright (c) 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_NET_NETWORK_TRANSACTION_H_ |
| +#define CHROME_BROWSER_NET_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 NetworkController; |
| +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 NetworkTransaction : public net::HttpTransaction { |
|
mmenke
2014/03/12 15:59:27
Why are you adding all this stuff to browser/net i
eustas
2014/03/13 13:11:09
We (DevTools) hesitate to be the only client of th
mmenke
2014/03/13 15:33:34
Generally interception is done at the URLRequestJo
|
| + public: |
| + NetworkTransaction( |
| + NetworkController* controller, |
| + scoped_ptr<net::HttpTransaction>& network_transaction); |
| + |
| + virtual ~NetworkTransaction(); |
| + |
| + const GURL& GetURL(); |
| + 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_; |
| + NetworkController* controller_; |
| + scoped_ptr<net::HttpTransaction> network_transaction_; |
| + GURL url_; |
| + net::CompletionCallback proxy_callback_; |
| + net::CompletionCallback callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NetworkTransaction); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_NET_NETWORK_TRANSACTION_H_ |