OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |