| 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 "ios/chrome/test/testing_application_context.h" | 5 #include "ios/chrome/test/testing_application_context.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ptr_util.h" |
| 8 #include "base/time/default_clock.h" | 9 #include "base/time/default_clock.h" |
| 9 #include "base/time/default_tick_clock.h" | 10 #include "base/time/default_tick_clock.h" |
| 10 #include "components/network_time/network_time_tracker.h" | 11 #include "components/network_time/network_time_tracker.h" |
| 11 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 12 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
| 12 | 13 |
| 13 TestingApplicationContext::TestingApplicationContext() | 14 TestingApplicationContext::TestingApplicationContext() |
| 14 : application_locale_("en"), | 15 : application_locale_("en"), |
| 15 local_state_(nullptr), | 16 local_state_(nullptr), |
| 16 chrome_browser_state_manager_(nullptr), | 17 chrome_browser_state_manager_(nullptr), |
| 17 was_last_shutdown_clean_(false) { | 18 was_last_shutdown_clean_(false) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 DCHECK(thread_checker_.CalledOnValidThread()); | 119 DCHECK(thread_checker_.CalledOnValidThread()); |
| 119 return nullptr; | 120 return nullptr; |
| 120 } | 121 } |
| 121 | 122 |
| 122 network_time::NetworkTimeTracker* | 123 network_time::NetworkTimeTracker* |
| 123 TestingApplicationContext::GetNetworkTimeTracker() { | 124 TestingApplicationContext::GetNetworkTimeTracker() { |
| 124 DCHECK(thread_checker_.CalledOnValidThread()); | 125 DCHECK(thread_checker_.CalledOnValidThread()); |
| 125 if (!network_time_tracker_) { | 126 if (!network_time_tracker_) { |
| 126 DCHECK(local_state_); | 127 DCHECK(local_state_); |
| 127 network_time_tracker_.reset(new network_time::NetworkTimeTracker( | 128 network_time_tracker_.reset(new network_time::NetworkTimeTracker( |
| 128 make_scoped_ptr(new base::DefaultClock), | 129 base::WrapUnique(new base::DefaultClock), |
| 129 make_scoped_ptr(new base::DefaultTickClock), local_state_)); | 130 base::WrapUnique(new base::DefaultTickClock), local_state_)); |
| 130 } | 131 } |
| 131 return network_time_tracker_.get(); | 132 return network_time_tracker_.get(); |
| 132 } | 133 } |
| 133 | 134 |
| 134 IOSChromeIOThread* TestingApplicationContext::GetIOSChromeIOThread() { | 135 IOSChromeIOThread* TestingApplicationContext::GetIOSChromeIOThread() { |
| 135 DCHECK(thread_checker_.CalledOnValidThread()); | 136 DCHECK(thread_checker_.CalledOnValidThread()); |
| 136 return nullptr; | 137 return nullptr; |
| 137 } | 138 } |
| 138 | 139 |
| 139 gcm::GCMDriver* TestingApplicationContext::GetGCMDriver() { | 140 gcm::GCMDriver* TestingApplicationContext::GetGCMDriver() { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 156 CRLSetFetcher* TestingApplicationContext::GetCRLSetFetcher() { | 157 CRLSetFetcher* TestingApplicationContext::GetCRLSetFetcher() { |
| 157 DCHECK(thread_checker_.CalledOnValidThread()); | 158 DCHECK(thread_checker_.CalledOnValidThread()); |
| 158 return nullptr; | 159 return nullptr; |
| 159 } | 160 } |
| 160 | 161 |
| 161 safe_browsing::SafeBrowsingService* | 162 safe_browsing::SafeBrowsingService* |
| 162 TestingApplicationContext::GetSafeBrowsingService() { | 163 TestingApplicationContext::GetSafeBrowsingService() { |
| 163 DCHECK(thread_checker_.CalledOnValidThread()); | 164 DCHECK(thread_checker_.CalledOnValidThread()); |
| 164 return nullptr; | 165 return nullptr; |
| 165 } | 166 } |
| OLD | NEW |