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

Side by Side Diff: chrome/browser/net/network_transaction_factory.cc

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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/net/network_transaction_factory.h"
6
7 #include "chrome/browser/net/network_controller.h"
8 #include "chrome/browser/net/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"
12 #include "net/http/http_network_transaction.h"
13
14 NetworkTransactionFactory::NetworkTransactionFactory(
15 NetworkController* controller,
16 net::HttpNetworkSession* session)
17 : controller_(controller),
18 network_layer_(new net::HttpNetworkLayer(session)) {
19 }
20
21 NetworkTransactionFactory::~NetworkTransactionFactory() {
22 }
23
24 int NetworkTransactionFactory::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(new NetworkTransaction(controller_, network_transaction));
33 return net::OK;
34 }
35
36 net::HttpCache* NetworkTransactionFactory::GetCache() {
37 return network_layer_->GetCache();
38 }
39
40 net::HttpNetworkSession* NetworkTransactionFactory::GetSession() {
41 return network_layer_->GetSession();
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698