Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / net / http / failing_http_transaction_factory.h
blobdd4a811151d3931a81e5ea05a6287bc4317c96f7
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
3 // found in the LICENSE file.
5 #ifndef NET_FAILING_HTTP_TRANSACTION_FACTORY_H_
6 #define NET_FAILING_HTTP_TRANSACTION_FACTORY_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "net/base/net_errors.h"
10 #include "net/base/request_priority.h"
11 #include "net/http/http_transaction.h"
12 #include "net/http/http_transaction_factory.h"
14 namespace net {
16 class HttpCache;
17 class HttpNetworkSession;
19 // Creates transactions that always (asynchronously) return a specified
20 // error. The error is returned asynchronously, just after the transaction is
21 // started.
22 class NET_EXPORT FailingHttpTransactionFactory : public HttpTransactionFactory {
23 public:
24 // The caller must guarantee that |session| outlives this object.
25 FailingHttpTransactionFactory(HttpNetworkSession* session, Error error);
26 ~FailingHttpTransactionFactory() override;
28 // HttpTransactionFactory:
29 int CreateTransaction(RequestPriority priority,
30 scoped_ptr<HttpTransaction>* trans) override;
31 HttpCache* GetCache() override;
32 HttpNetworkSession* GetSession() override;
34 private:
35 HttpNetworkSession* session_;
36 Error error_;
39 } // namespace net
41 #endif // NET_FAILING_HTTP_TRANSACTION_FACTORY_H_