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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void URLRequestContextAdapter::Initialize( | 119 void URLRequestContextAdapter::Initialize( |
120 scoped_ptr<URLRequestContextConfig> config) { | 120 scoped_ptr<URLRequestContextConfig> config) { |
121 network_thread_ = new base::Thread("network"); | 121 network_thread_ = new base::Thread("network"); |
122 base::Thread::Options options; | 122 base::Thread::Options options; |
123 options.message_loop_type = base::MessageLoop::TYPE_IO; | 123 options.message_loop_type = base::MessageLoop::TYPE_IO; |
124 network_thread_->StartWithOptions(options); | 124 network_thread_->StartWithOptions(options); |
125 config_ = config.Pass(); | 125 config_ = config.Pass(); |
126 } | 126 } |
127 | 127 |
128 void URLRequestContextAdapter::InitRequestContextOnMainThread() { | 128 void URLRequestContextAdapter::InitRequestContextOnMainThread() { |
129 proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( | 129 proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService( |
130 GetNetworkTaskRunner(), NULL)); | 130 GetNetworkTaskRunner(), NULL); |
131 GetNetworkTaskRunner()->PostTask( | 131 GetNetworkTaskRunner()->PostTask( |
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. |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 write_to_file_observer_.reset(); | 305 write_to_file_observer_.reset(); |
306 } | 306 } |
307 } | 307 } |
308 | 308 |
309 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { | 309 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { |
310 VLOG(2) << "Net log entry: type=" << entry.type() | 310 VLOG(2) << "Net log entry: type=" << entry.type() |
311 << ", source=" << entry.source().type << ", phase=" << entry.phase(); | 311 << ", source=" << entry.source().type << ", phase=" << entry.phase(); |
312 } | 312 } |
313 | 313 |
314 } // namespace cronet | 314 } // namespace cronet |
OLD | NEW |