| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/net/http_server_properties_manager.h" | 5 #include "chrome/browser/net/http_server_properties_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 void HttpServerPropertiesManager::ShutdownOnUIThread() { | 86 void HttpServerPropertiesManager::ShutdownOnUIThread() { |
| 87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 88 // Cancel any pending updates, and stop listening for pref change updates. | 88 // Cancel any pending updates, and stop listening for pref change updates. |
| 89 ui_cache_update_timer_->Stop(); | 89 ui_cache_update_timer_->Stop(); |
| 90 ui_weak_ptr_factory_.reset(); | 90 ui_weak_ptr_factory_.reset(); |
| 91 pref_change_registrar_.RemoveAll(); | 91 pref_change_registrar_.RemoveAll(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 // static | 94 // static |
| 95 void HttpServerPropertiesManager::RegisterUserPrefs( | 95 void HttpServerPropertiesManager::RegisterProfilePrefs( |
| 96 user_prefs::PrefRegistrySyncable* prefs) { | 96 user_prefs::PrefRegistrySyncable* prefs) { |
| 97 prefs->RegisterDictionaryPref( | 97 prefs->RegisterDictionaryPref( |
| 98 prefs::kHttpServerProperties, | 98 prefs::kHttpServerProperties, |
| 99 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 99 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 100 } | 100 } |
| 101 | 101 |
| 102 // This is required for conformance with the HttpServerProperties interface. | 102 // This is required for conformance with the HttpServerProperties interface. |
| 103 void HttpServerPropertiesManager::Clear() { | 103 void HttpServerPropertiesManager::Clear() { |
| 104 Clear(base::Closure()); | 104 Clear(base::Closure()); |
| 105 } | 105 } |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 completion.Run(); | 673 completion.Run(); |
| 674 } | 674 } |
| 675 | 675 |
| 676 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { | 676 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { |
| 677 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 677 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 678 if (!setting_prefs_) | 678 if (!setting_prefs_) |
| 679 ScheduleUpdateCacheOnUI(); | 679 ScheduleUpdateCacheOnUI(); |
| 680 } | 680 } |
| 681 | 681 |
| 682 } // namespace chrome_browser_net | 682 } // namespace chrome_browser_net |
| OLD | NEW |