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

Side by Side Diff: components/cronet/android/url_request_context_adapter.cc

Issue 1303493002: Make UrlRequestContextBuilder take scoped_ptr's (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "components/cronet/android/url_request_context_adapter.h" 5 #include "components/cronet/android/url_request_context_adapter.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 FROM_HERE, 135 FROM_HERE,
136 base::Bind(&URLRequestContextAdapter::InitRequestContextOnNetworkThread, 136 base::Bind(&URLRequestContextAdapter::InitRequestContextOnNetworkThread,
137 this)); 137 this));
138 } 138 }
139 139
140 void URLRequestContextAdapter::InitRequestContextOnNetworkThread() { 140 void URLRequestContextAdapter::InitRequestContextOnNetworkThread() {
141 DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread()); 141 DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread());
142 DCHECK(config_); 142 DCHECK(config_);
143 // TODO(mmenke): Add method to have the builder enable SPDY. 143 // TODO(mmenke): Add method to have the builder enable SPDY.
144 net::URLRequestContextBuilder context_builder; 144 net::URLRequestContextBuilder context_builder;
145 context_builder.set_network_delegate(new BasicNetworkDelegate()); 145 context_builder.set_network_delegate(
146 context_builder.set_proxy_config_service(proxy_config_service_.get()); 146 make_scoped_ptr(new BasicNetworkDelegate()));
147 context_builder.set_proxy_config_service(proxy_config_service_.Pass());
147 config_->ConfigureURLRequestContextBuilder(&context_builder); 148 config_->ConfigureURLRequestContextBuilder(&context_builder);
148 149
149 context_.reset(context_builder.Build()); 150 context_ = context_builder.Build().Pass();
150 151
151 if (config_->enable_sdch) { 152 if (config_->enable_sdch) {
152 DCHECK(context_->sdch_manager()); 153 DCHECK(context_->sdch_manager());
153 sdch_owner_.reset( 154 sdch_owner_.reset(
154 new net::SdchOwner(context_->sdch_manager(), context_.get())); 155 new net::SdchOwner(context_->sdch_manager(), context_.get()));
155 } 156 }
156 157
157 // Currently (circa M39) enabling QUIC requires setting probability threshold. 158 // Currently (circa M39) enabling QUIC requires setting probability threshold.
158 if (config_->enable_quic) { 159 if (config_->enable_quic) {
159 context_->http_server_properties() 160 context_->http_server_properties()
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 write_to_file_observer_.reset(); 308 write_to_file_observer_.reset();
308 } 309 }
309 } 310 }
310 311
311 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { 312 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) {
312 VLOG(2) << "Net log entry: type=" << entry.type() 313 VLOG(2) << "Net log entry: type=" << entry.type()
313 << ", source=" << entry.source().type << ", phase=" << entry.phase(); 314 << ", source=" << entry.source().type << ", phase=" << entry.phase();
314 } 315 }
315 316
316 } // namespace cronet 317 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698