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

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

Issue 54863002: Implement a salt for MediaSource IDs that can be cleared by a user. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/content_settings/host_content_settings_map.h" 28 #include "chrome/browser/content_settings/host_content_settings_map.h"
29 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 29 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
30 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 30 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
31 #include "chrome/browser/download/download_service.h" 31 #include "chrome/browser/download/download_service.h"
32 #include "chrome/browser/download/download_service_factory.h" 32 #include "chrome/browser/download/download_service_factory.h"
33 #include "chrome/browser/extensions/extension_info_map.h" 33 #include "chrome/browser/extensions/extension_info_map.h"
34 #include "chrome/browser/extensions/extension_protocols.h" 34 #include "chrome/browser/extensions/extension_protocols.h"
35 #include "chrome/browser/extensions/extension_resource_protocols.h" 35 #include "chrome/browser/extensions/extension_resource_protocols.h"
36 #include "chrome/browser/extensions/extension_system.h" 36 #include "chrome/browser/extensions/extension_system.h"
37 #include "chrome/browser/io_thread.h" 37 #include "chrome/browser/io_thread.h"
38 #include "chrome/browser/media/media_device_id_salt.h"
38 #include "chrome/browser/net/about_protocol_handler.h" 39 #include "chrome/browser/net/about_protocol_handler.h"
39 #include "chrome/browser/net/chrome_cookie_notification_details.h" 40 #include "chrome/browser/net/chrome_cookie_notification_details.h"
40 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" 41 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
41 #include "chrome/browser/net/chrome_http_user_agent_settings.h" 42 #include "chrome/browser/net/chrome_http_user_agent_settings.h"
42 #include "chrome/browser/net/chrome_net_log.h" 43 #include "chrome/browser/net/chrome_net_log.h"
43 #include "chrome/browser/net/chrome_network_delegate.h" 44 #include "chrome/browser/net/chrome_network_delegate.h"
44 #include "chrome/browser/net/evicted_domain_cookie_counter.h" 45 #include "chrome/browser/net/evicted_domain_cookie_counter.h"
45 #include "chrome/browser/net/load_time_stats.h" 46 #include "chrome/browser/net/load_time_stats.h"
46 #include "chrome/browser/net/proxy_service_factory.h" 47 #include "chrome/browser/net/proxy_service_factory.h"
47 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" 48 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 &enable_do_not_track_, 307 &enable_do_not_track_,
307 &force_safesearch_, 308 &force_safesearch_,
308 pref_service); 309 pref_service);
309 310
310 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy = 311 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy =
311 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 312 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
312 #if defined(ENABLE_PRINTING) 313 #if defined(ENABLE_PRINTING)
313 printing_enabled_.Init(prefs::kPrintingEnabled, pref_service); 314 printing_enabled_.Init(prefs::kPrintingEnabled, pref_service);
314 printing_enabled_.MoveToThread(io_message_loop_proxy); 315 printing_enabled_.MoveToThread(io_message_loop_proxy);
315 #endif 316 #endif
317
316 chrome_http_user_agent_settings_.reset( 318 chrome_http_user_agent_settings_.reset(
317 new ChromeHttpUserAgentSettings(pref_service)); 319 new ChromeHttpUserAgentSettings(pref_service));
318 320
319 // These members are used only for one click sign in, which is not enabled 321 // These members are used only for one click sign in, which is not enabled
320 // in incognito mode. So no need to initialize them. 322 // in incognito mode. So no need to initialize them.
321 if (!is_incognito()) { 323 if (!is_incognito()) {
322 signin_names_.reset(new SigninNamesOnIOThread()); 324 signin_names_.reset(new SigninNamesOnIOThread());
323 325
324 google_services_username_.Init( 326 google_services_username_.Init(
325 prefs::kGoogleServicesUsername, pref_service); 327 prefs::kGoogleServicesUsername, pref_service);
(...skipping 11 matching lines...) Expand all
337 prefs::kReverseAutologinRejectedEmailList, pref_service); 339 prefs::kReverseAutologinRejectedEmailList, pref_service);
338 one_click_signin_rejected_email_list_.MoveToThread(io_message_loop_proxy); 340 one_click_signin_rejected_email_list_.MoveToThread(io_message_loop_proxy);
339 341
340 sync_disabled_.Init(prefs::kSyncManaged, pref_service); 342 sync_disabled_.Init(prefs::kSyncManaged, pref_service);
341 sync_disabled_.MoveToThread(io_message_loop_proxy); 343 sync_disabled_.MoveToThread(io_message_loop_proxy);
342 344
343 signin_allowed_.Init(prefs::kSigninAllowed, pref_service); 345 signin_allowed_.Init(prefs::kSigninAllowed, pref_service);
344 signin_allowed_.MoveToThread(io_message_loop_proxy); 346 signin_allowed_.MoveToThread(io_message_loop_proxy);
345 } 347 }
346 348
349 media_device_id_salt_.reset(new MediaDeviceIDSalt(pref_service,
350 is_incognito()));
351
347 // The URLBlacklistManager has to be created on the UI thread to register 352 // The URLBlacklistManager has to be created on the UI thread to register
348 // observers of |pref_service|, and it also has to clean up on 353 // observers of |pref_service|, and it also has to clean up on
349 // ShutdownOnUIThread to release these observers on the right thread. 354 // ShutdownOnUIThread to release these observers on the right thread.
350 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, 355 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up,
351 // in particular when this ProfileIOData isn't |initialized_| during deletion. 356 // in particular when this ProfileIOData isn't |initialized_| during deletion.
352 #if defined(ENABLE_CONFIGURATION_POLICY) 357 #if defined(ENABLE_CONFIGURATION_POLICY)
353 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); 358 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service));
354 #endif 359 #endif
355 360
356 initialized_on_UI_thread_ = true; 361 initialized_on_UI_thread_ = true;
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 return host_content_settings_map_.get(); 641 return host_content_settings_map_.get();
637 } 642 }
638 643
639 #if defined(ENABLE_NOTIFICATIONS) 644 #if defined(ENABLE_NOTIFICATIONS)
640 DesktopNotificationService* ProfileIOData::GetNotificationService() const { 645 DesktopNotificationService* ProfileIOData::GetNotificationService() const {
641 DCHECK(initialized_); 646 DCHECK(initialized_);
642 return notification_service_; 647 return notification_service_;
643 } 648 }
644 #endif 649 #endif
645 650
651 const std::string& ProfileIOData::media_device_id_salt() const {
652 return media_device_id_salt_->GetSalt();
Jói 2013/10/31 16:14:47 If you name your method using Linux hacker style (
perkj_chrome 2013/10/31 17:05:44 Done.
653 }
654
646 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { 655 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() {
647 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 656 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
648 #if defined(OS_CHROMEOS) 657 #if defined(OS_CHROMEOS)
649 // Just fetch the value from ChromeOS' settings while we're on the UI thread. 658 // Just fetch the value from ChromeOS' settings while we're on the UI thread.
650 // TODO(stevet): For now, this value is only set on profile initialization. 659 // TODO(stevet): For now, this value is only set on profile initialization.
651 // We will want to do something similar to the PrefMember method below in the 660 // We will want to do something similar to the PrefMember method below in the
652 // future to more accurately capture this state. 661 // future to more accurately capture this state.
653 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, 662 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref,
654 &enable_metrics_); 663 &enable_metrics_);
655 #elif defined(OS_ANDROID) 664 #elif defined(OS_ANDROID)
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 enable_referrers_.Destroy(); 933 enable_referrers_.Destroy();
925 enable_do_not_track_.Destroy(); 934 enable_do_not_track_.Destroy();
926 force_safesearch_.Destroy(); 935 force_safesearch_.Destroy();
927 #if !defined(OS_CHROMEOS) 936 #if !defined(OS_CHROMEOS)
928 enable_metrics_.Destroy(); 937 enable_metrics_.Destroy();
929 #endif 938 #endif
930 safe_browsing_enabled_.Destroy(); 939 safe_browsing_enabled_.Destroy();
931 printing_enabled_.Destroy(); 940 printing_enabled_.Destroy();
932 sync_disabled_.Destroy(); 941 sync_disabled_.Destroy();
933 signin_allowed_.Destroy(); 942 signin_allowed_.Destroy();
943 media_device_id_salt_.reset(NULL);
934 session_startup_pref_.Destroy(); 944 session_startup_pref_.Destroy();
935 #if defined(ENABLE_CONFIGURATION_POLICY) 945 #if defined(ENABLE_CONFIGURATION_POLICY)
936 if (url_blacklist_manager_) 946 if (url_blacklist_manager_)
937 url_blacklist_manager_->ShutdownOnUIThread(); 947 url_blacklist_manager_->ShutdownOnUIThread();
938 #endif 948 #endif
939 if (chrome_http_user_agent_settings_) 949 if (chrome_http_user_agent_settings_)
940 chrome_http_user_agent_settings_->CleanupOnUIThread(); 950 chrome_http_user_agent_settings_->CleanupOnUIThread();
941 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); 951 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this);
942 if (!posted) 952 if (!posted)
943 delete this; 953 delete this;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 void ProfileIOData::SetCookieSettingsForTesting( 988 void ProfileIOData::SetCookieSettingsForTesting(
979 CookieSettings* cookie_settings) { 989 CookieSettings* cookie_settings) {
980 DCHECK(!cookie_settings_.get()); 990 DCHECK(!cookie_settings_.get());
981 cookie_settings_ = cookie_settings; 991 cookie_settings_ = cookie_settings;
982 } 992 }
983 993
984 void ProfileIOData::set_signin_names_for_testing( 994 void ProfileIOData::set_signin_names_for_testing(
985 SigninNamesOnIOThread* signin_names) { 995 SigninNamesOnIOThread* signin_names) {
986 signin_names_.reset(signin_names); 996 signin_names_.reset(signin_names);
987 } 997 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698