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

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: Incorporated comments from Matt & Ricardo. Created 6 years, 11 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
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_

Powered by Google App Engine
This is Rietveld 408576698