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

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

Issue 1844753002: Histogram the scheme of an origin on the 1st navigation to it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Describe |HaveAlreadySeen|'s side-effect. Created 4 years, 8 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 861
862 ResourceContext::SaltCallback ProfileIOData::GetMediaDeviceIDSalt() const { 862 ResourceContext::SaltCallback ProfileIOData::GetMediaDeviceIDSalt() const {
863 return base::Bind(&MediaDeviceIDSalt::GetSalt, media_device_id_salt_); 863 return base::Bind(&MediaDeviceIDSalt::GetSalt, media_device_id_salt_);
864 } 864 }
865 865
866 bool ProfileIOData::IsOffTheRecord() const { 866 bool ProfileIOData::IsOffTheRecord() const {
867 return profile_type() == Profile::INCOGNITO_PROFILE 867 return profile_type() == Profile::INCOGNITO_PROFILE
868 || profile_type() == Profile::GUEST_PROFILE; 868 || profile_type() == Profile::GUEST_PROFILE;
869 } 869 }
870 870
871 bool ProfileIOData::HaveAlreadySeenOrigin(const url::Origin& origin) {
872 return origins_seen_.insert(origin).second == false;
873 }
874
871 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { 875 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() {
872 DCHECK_CURRENTLY_ON(BrowserThread::UI); 876 DCHECK_CURRENTLY_ON(BrowserThread::UI);
873 #if BUILDFLAG(ANDROID_JAVA_UI) 877 #if BUILDFLAG(ANDROID_JAVA_UI)
874 // TODO(dwkang): rename or unify the pref for UMA once we have conclusion 878 // TODO(dwkang): rename or unify the pref for UMA once we have conclusion
875 // in crbugs.com/246495. 879 // in crbugs.com/246495.
876 // Android has it's own preferences for metrics / crash uploading. 880 // Android has it's own preferences for metrics / crash uploading.
877 enable_metrics_.Init(prefs::kCrashReportingEnabled, 881 enable_metrics_.Init(prefs::kCrashReportingEnabled,
878 g_browser_process->local_state()); 882 g_browser_process->local_state());
879 enable_metrics_.MoveToThread( 883 enable_metrics_.MoveToThread(
880 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 884 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 base::WrapUnique(new DevToolsNetworkTransactionFactory( 1331 base::WrapUnique(new DevToolsNetworkTransactionFactory(
1328 network_controller_handle_.GetController(), shared_session)), 1332 network_controller_handle_.GetController(), shared_session)),
1329 std::move(backend), true /* set_up_quic_server_info */)); 1333 std::move(backend), true /* set_up_quic_server_info */));
1330 } 1334 }
1331 1335
1332 void ProfileIOData::SetCookieSettingsForTesting( 1336 void ProfileIOData::SetCookieSettingsForTesting(
1333 content_settings::CookieSettings* cookie_settings) { 1337 content_settings::CookieSettings* cookie_settings) {
1334 DCHECK(!cookie_settings_.get()); 1338 DCHECK(!cookie_settings_.get());
1335 cookie_settings_ = cookie_settings; 1339 cookie_settings_ = cookie_settings;
1336 } 1340 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698