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

Side by Side Diff: 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
« no previous file with comments | « no previous file | components/cronet/android/cronet_url_request_context_adapter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/cronet_url_request_context_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698