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

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 7713034: HostContentSettingsMap refactoring. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Keeping up to date with trunk. Created 9 years, 3 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/stl_util.h" 14 #include "base/stl_util.h"
15 #include "base/string_number_conversions.h" 15 #include "base/string_number_conversions.h"
16 #include "base/task.h" 16 #include "base/task.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/content_settings/cookie_settings.h"
18 #include "chrome/browser/content_settings/host_content_settings_map.h" 19 #include "chrome/browser/content_settings/host_content_settings_map.h"
19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
20 #include "chrome/browser/extensions/extension_info_map.h" 21 #include "chrome/browser/extensions/extension_info_map.h"
21 #include "chrome/browser/extensions/extension_protocols.h" 22 #include "chrome/browser/extensions/extension_protocols.h"
22 #include "chrome/browser/io_thread.h" 23 #include "chrome/browser/io_thread.h"
23 #include "chrome/browser/media/media_internals.h" 24 #include "chrome/browser/media/media_internals.h"
24 #include "chrome/browser/net/chrome_cookie_notification_details.h" 25 #include "chrome/browser/net/chrome_cookie_notification_details.h"
25 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" 26 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h"
26 #include "chrome/browser/net/chrome_net_log.h" 27 #include "chrome/browser/net/chrome_net_log.h"
27 #include "chrome/browser/net/chrome_network_delegate.h" 28 #include "chrome/browser/net/chrome_network_delegate.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // For the latter, we need a change on the webkit-side. 218 // For the latter, we need a change on the webkit-side.
218 // We initialize it to the default charset here and a user will 219 // We initialize it to the default charset here and a user will
219 // have an *arguably* better default charset for interpreting a raw 8bit 220 // have an *arguably* better default charset for interpreting a raw 8bit
220 // C-D header field. It means the native OS codepage fallback in 221 // C-D header field. It means the native OS codepage fallback in
221 // net_util::GetSuggestedFilename is unlikely to be taken. 222 // net_util::GetSuggestedFilename is unlikely to be taken.
222 params->referrer_charset = default_charset; 223 params->referrer_charset = default_charset;
223 224
224 params->io_thread = g_browser_process->io_thread(); 225 params->io_thread = g_browser_process->io_thread();
225 226
226 params->host_content_settings_map = profile->GetHostContentSettingsMap(); 227 params->host_content_settings_map = profile->GetHostContentSettingsMap();
228 params->cookie_settings = CookieSettings::GetForProfile(profile);
227 params->host_zoom_map = profile->GetHostZoomMap(); 229 params->host_zoom_map = profile->GetHostZoomMap();
228 params->transport_security_state = profile->GetTransportSecurityState(); 230 params->transport_security_state = profile->GetTransportSecurityState();
229 params->ssl_config_service = profile->GetSSLConfigService(); 231 params->ssl_config_service = profile->GetSSLConfigService();
230 base::Callback<Profile*(void)> profile_getter = 232 base::Callback<Profile*(void)> profile_getter =
231 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), 233 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(),
232 profile); 234 profile);
233 params->cookie_monster_delegate = 235 params->cookie_monster_delegate =
234 new ChromeCookieMonsterDelegate(profile_getter); 236 new ChromeCookieMonsterDelegate(profile_getter);
235 params->database_tracker = profile->GetDatabaseTracker(); 237 params->database_tracker = profile->GetDatabaseTracker();
236 params->appcache_service = profile->GetAppCacheService(); 238 params->appcache_service = profile->GetAppCacheService();
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 373 }
372 374
373 ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const { 375 ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const {
374 return extension_info_map_; 376 return extension_info_map_;
375 } 377 }
376 378
377 HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const { 379 HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const {
378 return host_content_settings_map_; 380 return host_content_settings_map_;
379 } 381 }
380 382
383 CookieSettings* ProfileIOData::GetCookieSettings() const {
384 return cookie_settings_;
385 }
386
381 DesktopNotificationService* ProfileIOData::GetNotificationService() const { 387 DesktopNotificationService* ProfileIOData::GetNotificationService() const {
382 return notification_service_; 388 return notification_service_;
383 } 389 }
384 390
385 ProfileIOData::ResourceContext::ResourceContext(const ProfileIOData* io_data) 391 ProfileIOData::ResourceContext::ResourceContext(const ProfileIOData* io_data)
386 : io_data_(io_data) { 392 : io_data_(io_data) {
387 DCHECK(io_data); 393 DCHECK(io_data);
388 } 394 }
389 395
390 ProfileIOData::ResourceContext::~ResourceContext() {} 396 ProfileIOData::ResourceContext::~ResourceContext() {}
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 #endif // defined(OS_CHROMEOS) 480 #endif // defined(OS_CHROMEOS)
475 481
476 // Take ownership over these parameters. 482 // Take ownership over these parameters.
477 database_tracker_ = profile_params_->database_tracker; 483 database_tracker_ = profile_params_->database_tracker;
478 appcache_service_ = profile_params_->appcache_service; 484 appcache_service_ = profile_params_->appcache_service;
479 blob_storage_context_ = profile_params_->blob_storage_context; 485 blob_storage_context_ = profile_params_->blob_storage_context;
480 file_system_context_ = profile_params_->file_system_context; 486 file_system_context_ = profile_params_->file_system_context;
481 quota_manager_ = profile_params_->quota_manager; 487 quota_manager_ = profile_params_->quota_manager;
482 host_zoom_map_ = profile_params_->host_zoom_map; 488 host_zoom_map_ = profile_params_->host_zoom_map;
483 host_content_settings_map_ = profile_params_->host_content_settings_map; 489 host_content_settings_map_ = profile_params_->host_content_settings_map;
490 cookie_settings_ = profile_params_->cookie_settings;
484 notification_service_ = profile_params_->notification_service; 491 notification_service_ = profile_params_->notification_service;
485 extension_info_map_ = profile_params_->extension_info_map; 492 extension_info_map_ = profile_params_->extension_info_map;
486 prerender_manager_getter_ = profile_params_->prerender_manager_getter; 493 prerender_manager_getter_ = profile_params_->prerender_manager_getter;
487 494
488 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get()); 495 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get());
489 resource_context_.set_request_context(main_request_context_); 496 resource_context_.set_request_context(main_request_context_);
490 resource_context_.set_database_tracker(database_tracker_); 497 resource_context_.set_database_tracker(database_tracker_);
491 resource_context_.set_appcache_service(appcache_service_); 498 resource_context_.set_appcache_service(appcache_service_);
492 resource_context_.set_blob_storage_context(blob_storage_context_); 499 resource_context_.set_blob_storage_context(blob_storage_context_);
493 resource_context_.set_file_system_context(file_system_context_); 500 resource_context_.set_file_system_context(file_system_context_);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 540 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
534 new DeleteTask<ProfileIOData>(this)); 541 new DeleteTask<ProfileIOData>(this));
535 if (!posted) 542 if (!posted)
536 delete this; 543 delete this;
537 } 544 }
538 545
539 void ProfileIOData::set_origin_bound_cert_service( 546 void ProfileIOData::set_origin_bound_cert_service(
540 net::OriginBoundCertService* origin_bound_cert_service) const { 547 net::OriginBoundCertService* origin_bound_cert_service) const {
541 origin_bound_cert_service_.reset(origin_bound_cert_service); 548 origin_bound_cert_service_.reset(origin_bound_cert_service);
542 } 549 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698