Index: chrome/browser/net/network_transaction_factory.cc |
diff --git a/chrome/browser/net/network_transaction_factory.cc b/chrome/browser/net/network_transaction_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..923562d46c4c4e682649e5b0df02f357b733fa9e |
--- /dev/null |
+++ b/chrome/browser/net/network_transaction_factory.cc |
@@ -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. |
+ |
+#include "chrome/browser/net/network_transaction_factory.h" |
+ |
+#include "chrome/browser/net/network_controller.h" |
+#include "chrome/browser/net/network_transaction.h" |
+#include "net/base/request_priority.h" |
+#include "net/http/http_network_layer.h" |
+#include "net/http/http_network_session.h" |
+#include "net/http/http_network_transaction.h" |
+ |
+NetworkTransactionFactory::NetworkTransactionFactory( |
+ NetworkController* controller, |
+ net::HttpNetworkSession* session) |
+ : controller_(controller), |
+ network_layer_(new net::HttpNetworkLayer(session)) { |
+} |
+ |
+NetworkTransactionFactory::~NetworkTransactionFactory() { |
+} |
+ |
+int NetworkTransactionFactory::CreateTransaction( |
+ net::RequestPriority priority, |
+ scoped_ptr<net::HttpTransaction>* trans) { |
+ scoped_ptr<net::HttpTransaction> network_transaction; |
+ int rv = network_layer_->CreateTransaction(priority, &network_transaction); |
+ if (rv != net::OK) { |
+ return rv; |
+ } |
+ trans->reset(new NetworkTransaction(controller_, network_transaction)); |
+ return net::OK; |
+} |
+ |
+net::HttpCache* NetworkTransactionFactory::GetCache() { |
+ return network_layer_->GetCache(); |
+} |
+ |
+net::HttpNetworkSession* NetworkTransactionFactory::GetSession() { |
+ return network_layer_->GetSession(); |
+} |