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 #include "chrome/browser/net/http_server_properties_manager.h" | 4 #include "chrome/browser/net/http_server_properties_manager.h" |
5 | 5 |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 void HttpServerPropertiesManager::ShutdownOnUIThread() { | 83 void HttpServerPropertiesManager::ShutdownOnUIThread() { |
84 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 84 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
85 // Cancel any pending updates, and stop listening for pref change updates. | 85 // Cancel any pending updates, and stop listening for pref change updates. |
86 ui_cache_update_timer_->Stop(); | 86 ui_cache_update_timer_->Stop(); |
87 ui_weak_ptr_factory_.reset(); | 87 ui_weak_ptr_factory_.reset(); |
88 pref_change_registrar_.RemoveAll(); | 88 pref_change_registrar_.RemoveAll(); |
89 } | 89 } |
90 | 90 |
91 // static | 91 // static |
92 void HttpServerPropertiesManager::RegisterPrefs(PrefService* prefs) { | 92 void HttpServerPropertiesManager::RegisterUserPrefs( |
| 93 PrefServiceSyncable* prefs) { |
93 prefs->RegisterDictionaryPref(prefs::kHttpServerProperties, | 94 prefs->RegisterDictionaryPref(prefs::kHttpServerProperties, |
94 PrefService::UNSYNCABLE_PREF); | 95 PrefServiceSyncable::UNSYNCABLE_PREF); |
95 } | 96 } |
96 | 97 |
97 // This is required for conformance with the HttpServerProperties interface. | 98 // This is required for conformance with the HttpServerProperties interface. |
98 void HttpServerPropertiesManager::Clear() { | 99 void HttpServerPropertiesManager::Clear() { |
99 Clear(base::Closure()); | 100 Clear(base::Closure()); |
100 } | 101 } |
101 | 102 |
102 void HttpServerPropertiesManager::Clear(const base::Closure& completion) { | 103 void HttpServerPropertiesManager::Clear(const base::Closure& completion) { |
103 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 104 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
104 | 105 |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 completion.Run(); | 660 completion.Run(); |
660 } | 661 } |
661 | 662 |
662 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { | 663 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { |
663 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 664 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
664 if (!setting_prefs_) | 665 if (!setting_prefs_) |
665 ScheduleUpdateCacheOnUI(); | 666 ScheduleUpdateCacheOnUI(); |
666 } | 667 } |
667 | 668 |
668 } // namespace chrome_browser_net | 669 } // namespace chrome_browser_net |
OLD | NEW |