Chromium Code Reviews| Index: net/http/failing_http_transaction_factory.h |
| diff --git a/net/http/failing_http_transaction_factory.h b/net/http/failing_http_transaction_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..52d83528034a3956655d1538ab12cea279c9ca1b |
| --- /dev/null |
| +++ b/net/http/failing_http_transaction_factory.h |
| @@ -0,0 +1,49 @@ |
| +// 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 NET_FAILING_HTTP_TRANSACTION_FACTORY_H_ |
| +#define NET_FAILING_HTTP_TRANSACTION_FACTORY_H_ |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "net/base/completion_callback.h" |
|
mmenke
2014/01/28 17:27:23
Not needed.
Randy Smith (Not in Mondays)
2014/01/28 22:52:59
Done.
|
| +#include "net/base/net_errors.h" |
| +#include "net/base/request_priority.h" |
| +#include "net/http/http_transaction.h" |
| +#include "net/http/http_transaction_factory.h" |
| + |
| +namespace net { |
| + |
| +class AuthCredentials; |
| +class BoundNetLog; |
| +class HttpCache; |
| +class HttpRequestHeaders; |
| +class IOBuffer; |
| +class URLRequestContextGetter; |
| +class X509Certificate; |
| + |
| +struct HttpRequestInfo; |
|
mmenke
2014/01/28 17:27:23
Should probably add a forward declaration of HttpN
mmenke
2014/01/28 17:27:23
Of all these forward declarations, only HttpCache
Randy Smith (Not in Mondays)
2014/01/28 22:52:59
Done.
Randy Smith (Not in Mondays)
2014/01/28 22:52:59
Right, because the transaction declaration used to
|
| + |
| +// Creates transactions that always (asynchronously) return |err|. |
| +// |err| must not be OK. |
|
mmenke
2014/01/28 17:27:23
Think it's generally a bad idea to mention functio
Randy Smith (Not in Mondays)
2014/01/28 22:52:59
SGTM. Done.
|
| +class NET_EXPORT FailingHttpTransactionFactory : public HttpTransactionFactory { |
| + public: |
| + // The caller must guarantee that |session| outlives this object. |
| + FailingHttpTransactionFactory(HttpNetworkSession* session, Error error); |
| + virtual ~FailingHttpTransactionFactory(); |
| + |
| + // HttpTransactionFactory: |
| + virtual int CreateTransaction( |
| + RequestPriority priority, |
| + scoped_ptr<HttpTransaction>* trans) OVERRIDE; |
| + virtual HttpCache* GetCache() OVERRIDE; |
| + virtual HttpNetworkSession* GetSession() OVERRIDE; |
|
mmenke
2014/01/28 17:27:23
include platform_specific for OVERRIDE.
Randy Smith (Not in Mondays)
2014/01/28 22:52:59
I think you meant compiler_specific.h, so I includ
mmenke
2014/01/28 23:10:22
Gah...compiler_specific was named platform_specifi
|
| + |
| + private: |
| + HttpNetworkSession* session_; |
| + Error error_; |
| +}; |
| + |
| +} // namespace net |
| + |
| +#endif // NET_FAILING_HTTP_TRANSACTION_FACTORY_H_ |