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

Unified Diff: components/autofill/browser/risk/fingerprint.cc

Issue 14904002: Load and send Wallet Risk params after user has agreed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/browser/risk/fingerprint.cc
diff --git a/components/autofill/browser/risk/fingerprint.cc b/components/autofill/browser/risk/fingerprint.cc
index 6dd0b6a63584c8dd43a1fa51c96f8459bfa4a73b..1d80121e3b7a9012ee8e1504873c43474e59f3d8 100644
--- a/components/autofill/browser/risk/fingerprint.cc
+++ b/components/autofill/browser/risk/fingerprint.cc
@@ -179,7 +179,7 @@ void AddGpuInfoToFingerprint(Fingerprint_MachineCharacteristics* machine) {
class FingerprintDataLoader : public content::GpuDataManagerObserver {
public:
FingerprintDataLoader(
- int64 gaia_id,
+ uint64 obfuscated_gaia_id,
const gfx::Rect& window_bounds,
const gfx::Rect& content_bounds,
const WebScreenInfo& screen_info,
@@ -212,7 +212,7 @@ class FingerprintDataLoader : public content::GpuDataManagerObserver {
content::GpuDataManager* const gpu_data_manager_;
// Data that will be passed on to the next loading phase.
- const int64 gaia_id_;
+ const uint64 obfuscated_gaia_id_;
const gfx::Rect window_bounds_;
const gfx::Rect content_bounds_;
const WebScreenInfo screen_info_;
@@ -237,7 +237,7 @@ class FingerprintDataLoader : public content::GpuDataManagerObserver {
};
FingerprintDataLoader::FingerprintDataLoader(
- int64 gaia_id,
+ uint64 obfuscated_gaia_id,
const gfx::Rect& window_bounds,
const gfx::Rect& content_bounds,
const WebScreenInfo& screen_info,
@@ -249,7 +249,7 @@ FingerprintDataLoader::FingerprintDataLoader(
const std::string& app_locale,
const base::Callback<void(scoped_ptr<Fingerprint>)>& callback)
: gpu_data_manager_(content::GpuDataManager::GetInstance()),
- gaia_id_(gaia_id),
+ obfuscated_gaia_id_(obfuscated_gaia_id),
window_bounds_(window_bounds),
content_bounds_(content_bounds),
screen_info_(screen_info),
@@ -268,9 +268,11 @@ FingerprintDataLoader::FingerprintDataLoader(
gpu_data_manager_->RequestCompleteGpuInfoIfNeeded();
}
+#if defined(USE_PLUGINS)
// Load plugin data.
content::PluginService::GetInstance()->GetPlugins(
base::Bind(&FingerprintDataLoader::OnGotPlugins, base::Unretained(this)));
+#endif
// Load font data.
content::GetFontListAsync(
@@ -304,9 +306,11 @@ void FingerprintDataLoader::OnGotPlugins(
void FingerprintDataLoader::MaybeFillFingerprint() {
// If all of the data has been loaded, fill the fingerprint and clean up.
- if (gpu_data_manager_->IsCompleteGpuInfoAvailable() &&
- fonts_ &&
- has_loaded_plugins_) {
+ bool finished = gpu_data_manager_->IsCompleteGpuInfoAvailable() && fonts_;
+#if defined(USE_PLUGINS)
+ finished = finished && has_loaded_plugins_;
+#endif
+ if (finished) {
FillFingerprint();
delete this;
}
@@ -357,7 +361,7 @@ void FingerprintDataLoader::FillFingerprint() {
Fingerprint_Metadata* metadata = fingerprint->mutable_metadata();
metadata->set_timestamp_ms(
(base::Time::Now() - base::Time::UnixEpoch()).InMilliseconds());
- metadata->set_gaia_id(gaia_id_);
+ metadata->set_obfuscated_gaia_id(obfuscated_gaia_id_);
metadata->set_fingerprinter_version(kFingerprinterVersion);
callback_.Run(fingerprint.Pass());
@@ -366,7 +370,7 @@ void FingerprintDataLoader::FillFingerprint() {
} // namespace
void GetFingerprint(
- int64 gaia_id,
+ uint64 obfuscated_gaia_id,
const gfx::Rect& window_bounds,
const content::WebContents& web_contents,
const std::string& version,
@@ -386,14 +390,15 @@ void GetFingerprint(
host_view->GetRenderWidgetHost()->GetWebScreenInfo(&screen_info);
internal::GetFingerprintInternal(
- gaia_id, window_bounds, content_bounds, screen_info, version, charset,
- accept_languages, install_time, dialog_type, app_locale, callback);
+ obfuscated_gaia_id, window_bounds, content_bounds, screen_info, version,
+ charset, accept_languages, install_time, dialog_type, app_locale,
+ callback);
}
namespace internal {
void GetFingerprintInternal(
- int64 gaia_id,
+ uint64 obfuscated_gaia_id,
const gfx::Rect& window_bounds,
const gfx::Rect& content_bounds,
const WebKit::WebScreenInfo& screen_info,
@@ -406,9 +411,9 @@ void GetFingerprintInternal(
const base::Callback<void(scoped_ptr<Fingerprint>)>& callback) {
// Begin loading all of the data that we need to load asynchronously.
// This class is responsible for freeing its own memory.
- new FingerprintDataLoader(gaia_id, window_bounds, content_bounds, screen_info,
- version, charset, accept_languages, install_time,
- dialog_type, app_locale, callback);
+ new FingerprintDataLoader(obfuscated_gaia_id, window_bounds, content_bounds,
+ screen_info, version, charset, accept_languages,
+ install_time, dialog_type, app_locale, callback);
}
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698