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 "chrome/browser/net/http_server_properties_manager_factory.h" | 5 #include "chrome/browser/net/http_server_properties_manager_factory.h" |
6 | 6 |
| 7 #include "base/threading/thread_task_runner_handle.h" |
7 #include "chrome/common/pref_names.h" | 8 #include "chrome/common/pref_names.h" |
8 #include "components/pref_registry/pref_registry_syncable.h" | 9 #include "components/pref_registry/pref_registry_syncable.h" |
9 #include "components/prefs/pref_change_registrar.h" | 10 #include "components/prefs/pref_change_registrar.h" |
10 #include "components/prefs/pref_service.h" | 11 #include "components/prefs/pref_service.h" |
11 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
12 #include "net/http/http_server_properties_manager.h" | 13 #include "net/http/http_server_properties_manager.h" |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 // Connects the HttpServerPropertiesManager's storage to the Chrome prefs. | 17 // Connects the HttpServerPropertiesManager's storage to the Chrome prefs. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } // namespace | 57 } // namespace |
57 | 58 |
58 namespace chrome_browser_net { | 59 namespace chrome_browser_net { |
59 | 60 |
60 /* static */ | 61 /* static */ |
61 net::HttpServerPropertiesManager* | 62 net::HttpServerPropertiesManager* |
62 HttpServerPropertiesManagerFactory::CreateManager(PrefService* pref_service) { | 63 HttpServerPropertiesManagerFactory::CreateManager(PrefService* pref_service) { |
63 using content::BrowserThread; | 64 using content::BrowserThread; |
64 return new net::HttpServerPropertiesManager( | 65 return new net::HttpServerPropertiesManager( |
65 new PrefServiceAdapter(pref_service), // Transfers ownership. | 66 new PrefServiceAdapter(pref_service), // Transfers ownership. |
| 67 base::ThreadTaskRunnerHandle::Get(), |
66 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 68 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
67 } | 69 } |
68 | 70 |
69 /* static */ | 71 /* static */ |
70 void HttpServerPropertiesManagerFactory::RegisterProfilePrefs( | 72 void HttpServerPropertiesManagerFactory::RegisterProfilePrefs( |
71 user_prefs::PrefRegistrySyncable* registry) { | 73 user_prefs::PrefRegistrySyncable* registry) { |
72 registry->RegisterDictionaryPref(prefs::kHttpServerProperties); | 74 registry->RegisterDictionaryPref(prefs::kHttpServerProperties); |
73 } | 75 } |
74 | 76 |
75 } // namespace chrome_browser_net | 77 } // namespace chrome_browser_net |
OLD | NEW |