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" | |
mmenke
2014/04/21 17:16:51
Nit: Not needed, since it's in the header.
eustas
2014/04/22 14:23:09
Surely. Done.
| |
10 #include "net/http/http_network_layer.h" | |
11 #include "net/http/http_network_transaction.h" | |
12 | |
13 DevToolsNetworkTransactionFactory::DevToolsNetworkTransactionFactory( | |
14 DevToolsNetworkController* controller, | |
15 net::HttpNetworkSession* session) | |
16 : controller_(controller), | |
17 network_layer_(new net::HttpNetworkLayer(session)) { | |
18 } | |
19 | |
20 DevToolsNetworkTransactionFactory::~DevToolsNetworkTransactionFactory() { | |
21 } | |
22 | |
23 int DevToolsNetworkTransactionFactory::CreateTransaction( | |
24 net::RequestPriority priority, | |
25 scoped_ptr<net::HttpTransaction>* trans) { | |
26 scoped_ptr<net::HttpTransaction> network_transaction; | |
27 int rv = network_layer_->CreateTransaction(priority, &network_transaction); | |
28 if (rv != net::OK) { | |
29 return rv; | |
30 } | |
31 trans->reset( | |
32 new DevToolsNetworkTransaction(controller_, network_transaction.Pass())); | |
33 return net::OK; | |
34 } | |
35 | |
36 net::HttpCache* DevToolsNetworkTransactionFactory::GetCache() { | |
37 return network_layer_->GetCache(); | |
38 } | |
39 | |
40 net::HttpNetworkSession* DevToolsNetworkTransactionFactory::GetSession() { | |
41 return network_layer_->GetSession(); | |
42 } | |
OLD | NEW |