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

Unified Diff: net/http/failing_http_transaction_factory.h

Issue 138513002: Plumb network stack information about existence of cached copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to r248769. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/data/nocache.html.mock-http-headers ('k') | net/http/failing_http_transaction_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..84d87a7a3d3db68e209673496c7a2e1af88c1a91
--- /dev/null
+++ b/net/http/failing_http_transaction_factory.h
@@ -0,0 +1,42 @@
+// 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/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 HttpCache;
+class HttpNetworkSession;
+
+// Creates transactions that always (asynchronously) return a specified
+// error. The error is returned asynchronously, just after the transaction is
+// started.
+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;
+
+ private:
+ HttpNetworkSession* session_;
+ Error error_;
+};
+
+} // namespace net
+
+#endif // NET_FAILING_HTTP_TRANSACTION_FACTORY_H_
« no previous file with comments | « content/test/data/nocache.html.mock-http-headers ('k') | net/http/failing_http_transaction_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698