Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #include "chrome/browser/devtools/devtools_network_transaction_factory.h" | |
| 6 | |
| 7 #include "chrome/browser/devtools/devtools_network_controller.h" | |
| 8 #include "chrome/browser/devtools/devtools_network_transaction.h" | |
| 9 #include "net/base/request_priority.h" | |
| 10 #include "net/http/http_network_layer.h" | |
| 11 #include "net/http/http_network_session.h" | |
|
mmenke
2014/03/31 18:10:20
I don't think we need this, since we only work thr
eustas
2014/04/18 12:33:19
Done.
| |
| 12 #include "net/http/http_network_transaction.h" | |
| 13 | |
| 14 DevToolsNetworkTransactionFactory::DevToolsNetworkTransactionFactory( | |
| 15 DevToolsNetworkController* controller, | |
| 16 net::HttpNetworkSession* session) | |
| 17 : controller_(controller), | |
| 18 network_layer_(new net::HttpNetworkLayer(session)) { | |
| 19 } | |
| 20 | |
| 21 DevToolsNetworkTransactionFactory::~DevToolsNetworkTransactionFactory() { | |
| 22 } | |
| 23 | |
| 24 int DevToolsNetworkTransactionFactory::CreateTransaction( | |
| 25 net::RequestPriority priority, | |
| 26 scoped_ptr<net::HttpTransaction>* trans) { | |
| 27 scoped_ptr<net::HttpTransaction> network_transaction; | |
| 28 int rv = network_layer_->CreateTransaction(priority, &network_transaction); | |
| 29 if (rv != net::OK) { | |
| 30 return rv; | |
| 31 } | |
| 32 trans->reset( | |
| 33 new DevToolsNetworkTransaction(controller_, network_transaction)); | |
|
mmenke
2014/03/31 18:10:20
network_transaction.Pass()?
eustas
2014/04/18 12:33:19
Done.
| |
| 34 return net::OK; | |
| 35 } | |
| 36 | |
| 37 net::HttpCache* DevToolsNetworkTransactionFactory::GetCache() { | |
| 38 return network_layer_->GetCache(); | |
| 39 } | |
| 40 | |
| 41 net::HttpNetworkSession* DevToolsNetworkTransactionFactory::GetSession() { | |
| 42 return network_layer_->GetSession(); | |
| 43 } | |
| OLD | NEW |