Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: ios/chrome/browser/net/http_server_properties_manager_factory.cc

Issue 2567893002: Pass pref_task_runner through HttpServerPropertiesManager's cxtor so that tests could inject a Test… (Closed)
Patch Set: add comments to HttpServerPropertiesManager Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « components/cronet/android/cronet_url_request_context_adapter.cc ('k') | net/http/http_server_properties_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698