| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/net/http_server_properties_manager_factory.h" | 5 #include "ios/chrome/browser/net/http_server_properties_manager_factory.h" |
| 6 | 6 |
| 7 #include "base/threading/thread_task_runner_handle.h" |
| 7 #include "components/pref_registry/pref_registry_syncable.h" | 8 #include "components/pref_registry/pref_registry_syncable.h" |
| 8 #include "components/prefs/pref_change_registrar.h" | 9 #include "components/prefs/pref_change_registrar.h" |
| 9 #include "components/prefs/pref_service.h" | 10 #include "components/prefs/pref_service.h" |
| 10 #include "ios/chrome/browser/pref_names.h" | 11 #include "ios/chrome/browser/pref_names.h" |
| 11 #include "ios/web/public/web_thread.h" | 12 #include "ios/web/public/web_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 class PrefServiceAdapter | 17 class PrefServiceAdapter |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 DISALLOW_COPY_AND_ASSIGN(PrefServiceAdapter); | 51 DISALLOW_COPY_AND_ASSIGN(PrefServiceAdapter); |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 } // namespace | 54 } // namespace |
| 54 | 55 |
| 55 // static | 56 // static |
| 56 net::HttpServerPropertiesManager* | 57 net::HttpServerPropertiesManager* |
| 57 HttpServerPropertiesManagerFactory::CreateManager(PrefService* pref_service) { | 58 HttpServerPropertiesManagerFactory::CreateManager(PrefService* pref_service) { |
| 58 return new net::HttpServerPropertiesManager( | 59 return new net::HttpServerPropertiesManager( |
| 59 new PrefServiceAdapter(pref_service), // Transfers ownership. | 60 new PrefServiceAdapter(pref_service), // Transfers ownership. |
| 61 base::ThreadTaskRunnerHandle::Get(), |
| 60 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO)); | 62 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO)); |
| 61 } | 63 } |
| 62 | 64 |
| 63 // static | 65 // static |
| 64 void HttpServerPropertiesManagerFactory::RegisterProfilePrefs( | 66 void HttpServerPropertiesManagerFactory::RegisterProfilePrefs( |
| 65 user_prefs::PrefRegistrySyncable* registry) { | 67 user_prefs::PrefRegistrySyncable* registry) { |
| 66 registry->RegisterDictionaryPref(prefs::kHttpServerProperties); | 68 registry->RegisterDictionaryPref(prefs::kHttpServerProperties); |
| 67 } | 69 } |
| OLD | NEW |