Commit ad66db1a authored by mef@chromium.org's avatar mef@chromium.org

Move http_server_properties_manager from chrome/browser/net to net/http.

BUG=

Review URL: https://codereview.chromium.org/378823002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282319 0039d316-1c4b-4281-b951-d872f2087c98
parent 8ca02c0b
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/net/http_server_properties_manager_factory.h"
#include "chrome/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "content/public/browser/browser_thread.h"
#include "net/http/http_server_properties_manager.h"
namespace chrome_browser_net {
/* static */
net::HttpServerPropertiesManager*
HttpServerPropertiesManagerFactory::CreateManager(PrefService* pref_service) {
using content::BrowserThread;
return new net::HttpServerPropertiesManager(
pref_service,
prefs::kHttpServerProperties,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
}
/* static */
void HttpServerPropertiesManagerFactory::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterDictionaryPref(
prefs::kHttpServerProperties,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
} // namespace chrome_browser_net
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_FACTORY_H_
#define CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_FACTORY_H_
#include "base/macros.h"
class PrefService;
namespace net {
class HttpServerPropertiesManager;
}
namespace user_prefs {
class PrefRegistrySyncable;
}
namespace chrome_browser_net {
////////////////////////////////////////////////////////////////////////////////
// Class for registration and creation of HttpServerPropertiesManager
class HttpServerPropertiesManagerFactory {
public:
// Create an instance of HttpServerPropertiesManager.
static net::HttpServerPropertiesManager* CreateManager(
PrefService* pref_service);
// Register prefs for properties managed by HttpServerPropertiesManager.
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(HttpServerPropertiesManagerFactory);
};
} // namespace chrome_browser_net
#endif // CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_FACTORY_H_
......@@ -37,7 +37,7 @@
#include "chrome/browser/media/media_stream_devices_controller.h"
#include "chrome/browser/metrics/chrome_metrics_service_client.h"
#include "chrome/browser/metrics/variations/variations_service.h"
#include "chrome/browser/net/http_server_properties_manager.h"
#include "chrome/browser/net/http_server_properties_manager_factory.h"
#include "chrome/browser/net/net_pref_observer.h"
#include "chrome/browser/net/prediction_options.h"
#include "chrome/browser/net/predictor.h"
......@@ -96,6 +96,7 @@
#include "components/translate/core/browser/translate_prefs.h"
#include "content/public/browser/render_process_host.h"
#include "extensions/browser/extension_prefs.h"
#include "net/http/http_server_properties_manager.h"
#if defined(ENABLE_AUTOFILL_DIALOG)
#include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
......@@ -352,7 +353,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
sync_driver::SyncPrefs::RegisterProfilePrefs(registry);
ChromeContentBrowserClient::RegisterProfilePrefs(registry);
ChromeVersionService::RegisterProfilePrefs(registry);
chrome_browser_net::HttpServerPropertiesManager::RegisterProfilePrefs(
chrome_browser_net::HttpServerPropertiesManagerFactory::RegisterProfilePrefs(
registry);
chrome_browser_net::Predictor::RegisterProfilePrefs(registry);
chrome_browser_net::RegisterPredictionOptionsProfilePrefs(registry);
......
......@@ -24,7 +24,7 @@
#include "chrome/browser/net/chrome_network_delegate.h"
#include "chrome/browser/net/connect_interceptor.h"
#include "chrome/browser/net/cookie_store_util.h"
#include "chrome/browser/net/http_server_properties_manager.h"
#include "chrome/browser/net/http_server_properties_manager_factory.h"
#include "chrome/browser/net/predictor.h"
#include "chrome/browser/net/sqlite_server_bound_cert_store.h"
#include "chrome/browser/profiles/profile.h"
......@@ -45,6 +45,7 @@
#include "net/base/sdch_manager.h"
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_cache.h"
#include "net/http/http_server_properties_manager.h"
#include "net/ssl/server_bound_cert_service.h"
#include "net/url_request/url_request_job_factory_impl.h"
#include "webkit/browser/quota/special_storage_policy.h"
......@@ -103,7 +104,7 @@ ProfileImplIOData::Handle::~Handle() {
}
if (io_data_->http_server_properties_manager_)
io_data_->http_server_properties_manager_->ShutdownOnUIThread();
io_data_->http_server_properties_manager_->ShutdownOnPrefThread();
io_data_->ShutdownOnUIThread();
}
......@@ -313,7 +314,8 @@ void ProfileImplIOData::Handle::LazyInitialize() const {
initialized_ = true;
PrefService* pref_service = profile_->GetPrefs();
io_data_->http_server_properties_manager_ =
new chrome_browser_net::HttpServerPropertiesManager(pref_service);
chrome_browser_net::HttpServerPropertiesManagerFactory::CreateManager(
pref_service);
io_data_->set_http_server_properties(
scoped_ptr<net::HttpServerProperties>(
io_data_->http_server_properties_manager_));
......@@ -377,7 +379,7 @@ void ProfileImplIOData::InitializeInternal(
ApplyProfileParamsToContext(main_context);
if (http_server_properties_manager_)
http_server_properties_manager_->InitializeOnIOThread();
http_server_properties_manager_->InitializeOnNetworkThread();
main_context->set_transport_security_state(transport_security_state());
......
......@@ -14,7 +14,6 @@
#include "content/public/browser/cookie_store_factory.h"
namespace chrome_browser_net {
class HttpServerPropertiesManager;
class Predictor;
} // namespace chrome_browser_net
......@@ -29,6 +28,7 @@ class DomainReliabilityMonitor;
namespace net {
class FtpTransactionFactory;
class HttpServerProperties;
class HttpServerPropertiesManager;
class HttpTransactionFactory;
class SDCHManager;
} // namespace net
......@@ -211,8 +211,7 @@ class ProfileImplIOData : public ProfileIOData {
// Same as |ProfileIOData::http_server_properties_|, owned there to maintain
// destruction ordering.
mutable chrome_browser_net::HttpServerPropertiesManager*
http_server_properties_manager_;
mutable net::HttpServerPropertiesManager* http_server_properties_manager_;
mutable scoped_ptr<chrome_browser_net::Predictor> predictor_;
......
......@@ -795,8 +795,8 @@
'browser/net/dns_probe_service.h',
'browser/net/evicted_domain_cookie_counter.cc',
'browser/net/evicted_domain_cookie_counter.h',
'browser/net/http_server_properties_manager.cc',
'browser/net/http_server_properties_manager.h',
'browser/net/http_server_properties_manager_factory.cc',
'browser/net/http_server_properties_manager_factory.h',
'browser/net/net_error_tab_helper.cc',
'browser/net/net_error_tab_helper.h',
'browser/net/net_log_temp_file.cc',
......
......@@ -1123,7 +1123,6 @@
'browser/net/dns_probe_service_unittest.cc',
'browser/net/evicted_domain_cookie_counter_unittest.cc',
'browser/net/firefox_proxy_settings_unittest.cc',
'browser/net/http_server_properties_manager_unittest.cc',
'browser/net/net_error_tab_helper_unittest.cc',
'browser/net/net_log_temp_file_unittest.cc',
'browser/net/network_stats_unittest.cc',
......
......@@ -85,6 +85,7 @@ component("net") {
":net_resources",
"//base",
"//base:i18n",
"//base:prefs",
"//base/third_party/dynamic_annotations",
"//crypto",
"//crypto:platform",
......@@ -522,7 +523,7 @@ component("net") {
include_dirs = [ "//third_party/openssl" ]
}
}
if (use_icu_alternatives_on_android) {
deps -= [
"//base:i18n",
......@@ -1065,6 +1066,7 @@ test("net_unittests") {
":test_support",
"//base",
"//base:i18n",
"//base:prefs_test_support",
"//base/allocator",
"//base/third_party/dynamic_annotations",
"//crypto",
......
......@@ -87,6 +87,7 @@
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:base_i18n',
'../base/base.gyp:base_prefs',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../crypto/crypto.gyp:crypto',
'../sdch/sdch.gyp:sdch',
......@@ -538,6 +539,7 @@
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:base_i18n',
'../base/base.gyp:base_prefs_test_support',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../crypto/crypto.gyp:crypto',
'../testing/gmock.gyp:gmock',
......
......@@ -634,6 +634,8 @@
'http/http_server_properties.h',
'http/http_server_properties_impl.cc',
'http/http_server_properties_impl.h',
'http/http_server_properties_manager.cc',
'http/http_server_properties_manager.h',
'http/http_status_code.cc',
'http/http_status_code.h',
'http/http_stream.h',
......@@ -1381,6 +1383,7 @@
'http/http_response_headers_unittest.cc',
'http/http_security_headers_unittest.cc',
'http/http_server_properties_impl_unittest.cc',
'http/http_server_properties_manager_unittest.cc',
'http/http_status_code_unittest.cc',
'http/http_stream_factory_impl_request_unittest.cc',
'http/http_stream_factory_impl_unittest.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment