OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ios/cronet_environment.h" | 5 #include "components/cronet/ios/cronet_environment.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/atomicops.h" | 10 #include "base/atomicops.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/feature_list.h" | 12 #include "base/feature_list.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
15 #include "base/files/scoped_file.h" | 15 #include "base/files/scoped_file.h" |
16 #include "base/json/json_writer.h" | 16 #include "base/json/json_writer.h" |
17 #include "base/mac/bind_objc_block.h" | 17 #include "base/mac/bind_objc_block.h" |
18 #include "base/mac/foundation_util.h" | 18 #include "base/mac/foundation_util.h" |
19 #include "base/macros.h" | 19 #include "base/macros.h" |
20 #include "base/metrics/statistics_recorder.h" | 20 #include "base/metrics/statistics_recorder.h" |
21 #include "base/path_service.h" | 21 #include "base/path_service.h" |
| 22 #include "base/single_thread_task_runner.h" |
22 #include "base/synchronization/waitable_event.h" | 23 #include "base/synchronization/waitable_event.h" |
23 #include "base/threading/worker_pool.h" | 24 #include "base/threading/worker_pool.h" |
24 #include "components/cronet/ios/version.h" | 25 #include "components/cronet/ios/version.h" |
25 #include "components/prefs/json_pref_store.h" | 26 #include "components/prefs/json_pref_store.h" |
26 #include "components/prefs/pref_filter.h" | 27 #include "components/prefs/pref_filter.h" |
27 #include "net/base/net_errors.h" | 28 #include "net/base/net_errors.h" |
28 #include "net/base/network_change_notifier.h" | 29 #include "net/base/network_change_notifier.h" |
29 #include "net/cert/cert_verify_result.h" | 30 #include "net/cert/cert_verify_result.h" |
30 #include "net/cert/ct_policy_enforcer.h" | 31 #include "net/cert/ct_policy_enforcer.h" |
31 #include "net/cert/multi_log_ct_verifier.h" | 32 #include "net/cert/multi_log_ct_verifier.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 68 |
68 void CronetEnvironment::PostToNetworkThread( | 69 void CronetEnvironment::PostToNetworkThread( |
69 const tracked_objects::Location& from_here, | 70 const tracked_objects::Location& from_here, |
70 const base::Closure& task) { | 71 const base::Closure& task) { |
71 network_io_thread_->task_runner()->PostTask(from_here, task); | 72 network_io_thread_->task_runner()->PostTask(from_here, task); |
72 } | 73 } |
73 | 74 |
74 void CronetEnvironment::PostToFileUserBlockingThread( | 75 void CronetEnvironment::PostToFileUserBlockingThread( |
75 const tracked_objects::Location& from_here, | 76 const tracked_objects::Location& from_here, |
76 const base::Closure& task) { | 77 const base::Closure& task) { |
77 file_user_blocking_thread_->message_loop()->PostTask(from_here, task); | 78 file_user_blocking_thread_->task_runner()->PostTask(from_here, task); |
78 } | 79 } |
79 | 80 |
80 net::URLRequestContext* CronetEnvironment::GetURLRequestContext() const { | 81 net::URLRequestContext* CronetEnvironment::GetURLRequestContext() const { |
81 return main_context_.get(); | 82 return main_context_.get(); |
82 } | 83 } |
83 | 84 |
84 // static | 85 // static |
85 void CronetEnvironment::Initialize() { | 86 void CronetEnvironment::Initialize() { |
86 // DCHECK_EQ([NSThread currentThread], [NSThread mainThread]); | 87 // DCHECK_EQ([NSThread currentThread], [NSThread mainThread]); |
87 // This method must be called once from the main thread. | 88 // This method must be called once from the main thread. |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 const net::HttpUserAgentSettings* user_agent_settings = | 345 const net::HttpUserAgentSettings* user_agent_settings = |
345 main_context_->http_user_agent_settings(); | 346 main_context_->http_user_agent_settings(); |
346 if (!user_agent_settings) { | 347 if (!user_agent_settings) { |
347 return nullptr; | 348 return nullptr; |
348 } | 349 } |
349 | 350 |
350 return user_agent_settings->GetUserAgent(); | 351 return user_agent_settings->GetUserAgent(); |
351 } | 352 } |
352 | 353 |
353 } // namespace cronet | 354 } // namespace cronet |
OLD | NEW |