OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/http/failing_http_transaction_factory.h" | 5 #include "net/http/failing_http_transaction_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // These transactions can be generated by the FailingHttpTransactionFactory | 27 // These transactions can be generated by the FailingHttpTransactionFactory |
28 // to test interactions between cache and network. | 28 // to test interactions between cache and network. |
29 class FailingHttpTransaction : public HttpTransaction { | 29 class FailingHttpTransaction : public HttpTransaction { |
30 public: | 30 public: |
31 explicit FailingHttpTransaction(Error error); | 31 explicit FailingHttpTransaction(Error error); |
32 virtual ~FailingHttpTransaction(); | 32 virtual ~FailingHttpTransaction(); |
33 | 33 |
34 // HttpTransaction | 34 // HttpTransaction |
35 virtual int Start(const HttpRequestInfo* request_info, | 35 virtual int Start(const HttpRequestInfo* request_info, |
36 const CompletionCallback& callback, | 36 const CompletionCallback& callback, |
37 const BoundNetLog& net_log) OVERRIDE; | 37 const BoundNetLog& net_log) override; |
38 virtual int RestartIgnoringLastError( | 38 virtual int RestartIgnoringLastError( |
39 const CompletionCallback& callback) OVERRIDE; | 39 const CompletionCallback& callback) override; |
40 virtual int RestartWithCertificate( | 40 virtual int RestartWithCertificate( |
41 X509Certificate* client_cert, | 41 X509Certificate* client_cert, |
42 const CompletionCallback& callback) OVERRIDE; | 42 const CompletionCallback& callback) override; |
43 virtual int RestartWithAuth( | 43 virtual int RestartWithAuth( |
44 const AuthCredentials& credentials, | 44 const AuthCredentials& credentials, |
45 const CompletionCallback& callback) OVERRIDE; | 45 const CompletionCallback& callback) override; |
46 virtual bool IsReadyToRestartForAuth() OVERRIDE; | 46 virtual bool IsReadyToRestartForAuth() override; |
47 virtual int Read(IOBuffer* buf, int buf_len, | 47 virtual int Read(IOBuffer* buf, int buf_len, |
48 const CompletionCallback& callback) OVERRIDE; | 48 const CompletionCallback& callback) override; |
49 virtual void StopCaching() OVERRIDE; | 49 virtual void StopCaching() override; |
50 virtual bool GetFullRequestHeaders( | 50 virtual bool GetFullRequestHeaders( |
51 HttpRequestHeaders* headers) const OVERRIDE; | 51 HttpRequestHeaders* headers) const override; |
52 virtual int64 GetTotalReceivedBytes() const OVERRIDE; | 52 virtual int64 GetTotalReceivedBytes() const override; |
53 virtual void DoneReading() OVERRIDE; | 53 virtual void DoneReading() override; |
54 virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE; | 54 virtual const HttpResponseInfo* GetResponseInfo() const override; |
55 virtual LoadState GetLoadState() const OVERRIDE; | 55 virtual LoadState GetLoadState() const override; |
56 virtual UploadProgress GetUploadProgress() const OVERRIDE; | 56 virtual UploadProgress GetUploadProgress() const override; |
57 virtual void SetQuicServerInfo( | 57 virtual void SetQuicServerInfo( |
58 net::QuicServerInfo* quic_server_info) OVERRIDE; | 58 net::QuicServerInfo* quic_server_info) override; |
59 virtual bool GetLoadTimingInfo( | 59 virtual bool GetLoadTimingInfo( |
60 LoadTimingInfo* load_timing_info) const OVERRIDE; | 60 LoadTimingInfo* load_timing_info) const override; |
61 virtual void SetPriority(RequestPriority priority) OVERRIDE; | 61 virtual void SetPriority(RequestPriority priority) override; |
62 virtual void SetWebSocketHandshakeStreamCreateHelper( | 62 virtual void SetWebSocketHandshakeStreamCreateHelper( |
63 WebSocketHandshakeStreamBase::CreateHelper* create_helper) OVERRIDE; | 63 WebSocketHandshakeStreamBase::CreateHelper* create_helper) override; |
64 virtual void SetBeforeNetworkStartCallback( | 64 virtual void SetBeforeNetworkStartCallback( |
65 const BeforeNetworkStartCallback& callback) OVERRIDE; | 65 const BeforeNetworkStartCallback& callback) override; |
66 virtual void SetBeforeProxyHeadersSentCallback( | 66 virtual void SetBeforeProxyHeadersSentCallback( |
67 const BeforeProxyHeadersSentCallback& callback) OVERRIDE; | 67 const BeforeProxyHeadersSentCallback& callback) override; |
68 virtual int ResumeNetworkStart() OVERRIDE; | 68 virtual int ResumeNetworkStart() override; |
69 | 69 |
70 private: | 70 private: |
71 Error error_; | 71 Error error_; |
72 }; | 72 }; |
73 | 73 |
74 FailingHttpTransaction::FailingHttpTransaction(Error error) : error_(error) { | 74 FailingHttpTransaction::FailingHttpTransaction(Error error) : error_(error) { |
75 DCHECK_LT(error, OK); | 75 DCHECK_LT(error, OK); |
76 } | 76 } |
77 | 77 |
78 FailingHttpTransaction::~FailingHttpTransaction() {} | 78 FailingHttpTransaction::~FailingHttpTransaction() {} |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 HttpCache* FailingHttpTransactionFactory::GetCache() { | 188 HttpCache* FailingHttpTransactionFactory::GetCache() { |
189 return NULL; | 189 return NULL; |
190 } | 190 } |
191 | 191 |
192 HttpNetworkSession* FailingHttpTransactionFactory::GetSession() { | 192 HttpNetworkSession* FailingHttpTransactionFactory::GetSession() { |
193 return session_; | 193 return session_; |
194 } | 194 } |
195 | 195 |
196 } // namespace net | 196 } // namespace net |
197 | 197 |
OLD | NEW |