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

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: sync and fix tiny resulting build failure Created 5 years, 3 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 FROM_HERE, 132 FROM_HERE,
133 base::Bind(&URLRequestContextAdapter::InitRequestContextOnNetworkThread, 133 base::Bind(&URLRequestContextAdapter::InitRequestContextOnNetworkThread,
134 this)); 134 this));
135 } 135 }
136 136
137 void URLRequestContextAdapter::InitRequestContextOnNetworkThread() { 137 void URLRequestContextAdapter::InitRequestContextOnNetworkThread() {
138 DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread()); 138 DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread());
139 DCHECK(config_); 139 DCHECK(config_);
140 // TODO(mmenke): Add method to have the builder enable SPDY. 140 // TODO(mmenke): Add method to have the builder enable SPDY.
141 net::URLRequestContextBuilder context_builder; 141 net::URLRequestContextBuilder context_builder;
142 context_builder.set_network_delegate(new BasicNetworkDelegate()); 142 context_builder.set_network_delegate(
143 context_builder.set_proxy_config_service(proxy_config_service_.get()); 143 make_scoped_ptr(new BasicNetworkDelegate()));
144 context_builder.set_proxy_config_service(proxy_config_service_.Pass());
144 config_->ConfigureURLRequestContextBuilder(&context_builder); 145 config_->ConfigureURLRequestContextBuilder(&context_builder);
145 146
146 context_.reset(context_builder.Build()); 147 context_ = context_builder.Build().Pass();
147 148
148 if (config_->enable_sdch) { 149 if (config_->enable_sdch) {
149 DCHECK(context_->sdch_manager()); 150 DCHECK(context_->sdch_manager());
150 sdch_owner_.reset( 151 sdch_owner_.reset(
151 new net::SdchOwner(context_->sdch_manager(), context_.get())); 152 new net::SdchOwner(context_->sdch_manager(), context_.get()));
152 } 153 }
153 154
154 // Currently (circa M39) enabling QUIC requires setting probability threshold. 155 // Currently (circa M39) enabling QUIC requires setting probability threshold.
155 if (config_->enable_quic) { 156 if (config_->enable_quic) {
156 context_->http_server_properties() 157 context_->http_server_properties()
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 write_to_file_observer_.reset(); 305 write_to_file_observer_.reset();
305 } 306 }
306 } 307 }
307 308
308 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { 309 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) {
309 VLOG(2) << "Net log entry: type=" << entry.type() 310 VLOG(2) << "Net log entry: type=" << entry.type()
310 << ", source=" << entry.source().type << ", phase=" << entry.phase(); 311 << ", source=" << entry.source().type << ", phase=" << entry.phase();
311 } 312 }
312 313
313 } // namespace cronet 314 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698