| 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 #include "chrome/browser/net/http_server_properties_manager.h" | 5 #include "chrome/browser/net/http_server_properties_manager.h" |
| 5 | 6 |
| 6 #include "base/bind.h" | 7 #include "base/bind.h" |
| 7 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 8 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 9 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 10 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
| 11 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/values.h" | 13 #include "base/values.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 void HttpServerPropertiesManager::ShutdownOnUIThread() { | 86 void HttpServerPropertiesManager::ShutdownOnUIThread() { |
| 86 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 87 // Cancel any pending updates, and stop listening for pref change updates. | 88 // Cancel any pending updates, and stop listening for pref change updates. |
| 88 ui_cache_update_timer_->Stop(); | 89 ui_cache_update_timer_->Stop(); |
| 89 ui_weak_ptr_factory_.reset(); | 90 ui_weak_ptr_factory_.reset(); |
| 90 pref_change_registrar_.RemoveAll(); | 91 pref_change_registrar_.RemoveAll(); |
| 91 } | 92 } |
| 92 | 93 |
| 93 // static | 94 // static |
| 94 void HttpServerPropertiesManager::RegisterUserPrefs( | 95 void HttpServerPropertiesManager::RegisterUserPrefs( |
| 95 PrefRegistrySyncable* prefs) { | 96 user_prefs::PrefRegistrySyncable* prefs) { |
| 96 prefs->RegisterDictionaryPref(prefs::kHttpServerProperties, | 97 prefs->RegisterDictionaryPref( |
| 97 PrefRegistrySyncable::UNSYNCABLE_PREF); | 98 prefs::kHttpServerProperties, |
| 99 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 98 } | 100 } |
| 99 | 101 |
| 100 // This is required for conformance with the HttpServerProperties interface. | 102 // This is required for conformance with the HttpServerProperties interface. |
| 101 void HttpServerPropertiesManager::Clear() { | 103 void HttpServerPropertiesManager::Clear() { |
| 102 Clear(base::Closure()); | 104 Clear(base::Closure()); |
| 103 } | 105 } |
| 104 | 106 |
| 105 void HttpServerPropertiesManager::Clear(const base::Closure& completion) { | 107 void HttpServerPropertiesManager::Clear(const base::Closure& completion) { |
| 106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 108 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 107 | 109 |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 completion.Run(); | 673 completion.Run(); |
| 672 } | 674 } |
| 673 | 675 |
| 674 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { | 676 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { |
| 675 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 677 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 676 if (!setting_prefs_) | 678 if (!setting_prefs_) |
| 677 ScheduleUpdateCacheOnUI(); | 679 ScheduleUpdateCacheOnUI(); |
| 678 } | 680 } |
| 679 | 681 |
| 680 } // namespace chrome_browser_net | 682 } // namespace chrome_browser_net |
| OLD | NEW |