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

Side by Side Diff: net/http/http_network_layer.cc

Issue 165430: Reference count ProxyService.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Sync Created 11 years, 4 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
« no previous file with comments | « net/http/http_network_layer.h ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_network_layer.h" 5 #include "net/http/http_network_layer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/http/http_network_session.h" 8 #include "net/http/http_network_session.h"
9 #include "net/http/http_network_transaction.h" 9 #include "net/http/http_network_transaction.h"
10 #include "net/socket/client_socket_factory.h" 10 #include "net/socket/client_socket_factory.h"
(...skipping 28 matching lines...) Expand all
39 : socket_factory_(socket_factory), 39 : socket_factory_(socket_factory),
40 host_resolver_(host_resolver), 40 host_resolver_(host_resolver),
41 proxy_service_(proxy_service), 41 proxy_service_(proxy_service),
42 session_(NULL), 42 session_(NULL),
43 suspended_(false) { 43 suspended_(false) {
44 DCHECK(proxy_service_); 44 DCHECK(proxy_service_);
45 } 45 }
46 46
47 HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session) 47 HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session)
48 : socket_factory_(ClientSocketFactory::GetDefaultFactory()), 48 : socket_factory_(ClientSocketFactory::GetDefaultFactory()),
49 host_resolver_(NULL),
50 proxy_service_(NULL),
51 session_(session), 49 session_(session),
52 suspended_(false) { 50 suspended_(false) {
53 DCHECK(session_.get()); 51 DCHECK(session_.get());
54 } 52 }
55 53
56 HttpNetworkLayer::~HttpNetworkLayer() { 54 HttpNetworkLayer::~HttpNetworkLayer() {
57 } 55 }
58 56
59 HttpTransaction* HttpNetworkLayer::CreateTransaction() { 57 HttpTransaction* HttpNetworkLayer::CreateTransaction() {
60 if (suspended_) 58 if (suspended_)
(...skipping 11 matching lines...) Expand all
72 70
73 if (suspend && session_) 71 if (suspend && session_)
74 session_->connection_pool()->CloseIdleSockets(); 72 session_->connection_pool()->CloseIdleSockets();
75 } 73 }
76 74
77 HttpNetworkSession* HttpNetworkLayer::GetSession() { 75 HttpNetworkSession* HttpNetworkLayer::GetSession() {
78 if (!session_) { 76 if (!session_) {
79 DCHECK(proxy_service_); 77 DCHECK(proxy_service_);
80 session_ = new HttpNetworkSession(host_resolver_, proxy_service_, 78 session_ = new HttpNetworkSession(host_resolver_, proxy_service_,
81 socket_factory_); 79 socket_factory_);
80 // These were just temps for lazy-initializing HttpNetworkSession.
81 host_resolver_ = NULL;
82 proxy_service_ = NULL;
82 } 83 }
83 return session_; 84 return session_;
84 } 85 }
85 86
86 } // namespace net 87 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_layer.h ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698