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

Unified Diff: chrome/browser/net/network_transaction_factory.h

Issue 182993003: Add the ability for DevTools to wrap network transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split controller and factory Created 6 years, 9 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: chrome/browser/net/network_transaction_factory.h
diff --git a/chrome/browser/net/network_transaction_factory.h b/chrome/browser/net/network_transaction_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..8ee9dd27dee8e75835824d71b60914383edaec36
--- /dev/null
+++ b/chrome/browser/net/network_transaction_factory.h
@@ -0,0 +1,44 @@
+// 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 CHROME_BROWSER_NET_NETWORK_TRANSACTION_FACTORY_H_
+#define CHROME_BROWSER_NET_NETWORK_TRANSACTION_FACTORY_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "net/base/request_priority.h"
+#include "net/http/http_transaction_factory.h"
+
+class NetworkController;
+
+namespace net {
+class HttpCache;
+class HttpNetworkSession;
+class HttpTransaction;
+} // namespace net
+
+// NetworkTransactionFactory wraps HttpNetworkTransactions.
+class NetworkTransactionFactory: public net::HttpTransactionFactory {
+
+ public:
+ NetworkTransactionFactory(
+ NetworkController* controller,
+ net::HttpNetworkSession* session);
+ virtual ~NetworkTransactionFactory();
+
+ // net::HttpTransactionFactory methods:
+ virtual int CreateTransaction(
+ net::RequestPriority priority,
+ scoped_ptr<net::HttpTransaction>* trans) OVERRIDE;
+ virtual net::HttpCache* GetCache() OVERRIDE;
+ virtual net::HttpNetworkSession* GetSession() OVERRIDE;
+
+ private:
+ NetworkController* controller_;
+ scoped_ptr<net::HttpTransactionFactory> network_layer_;
+
+ DISALLOW_COPY_AND_ASSIGN(NetworkTransactionFactory);
+};
+
+#endif // CHROME_BROWSER_NET_NETWORK_TRANSACTION_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698