Chromium Code Reviews| Index: components/autofill/browser/risk/fingerprint.cc |
| diff --git a/components/autofill/browser/risk/fingerprint.cc b/components/autofill/browser/risk/fingerprint.cc |
| index f737e440fd4ec057e6b5580d4ce77fb3bc5f0b68..1841f19b1a0fe1608b1a484f96468a48ec8574c9 100644 |
| --- a/components/autofill/browser/risk/fingerprint.cc |
| +++ b/components/autofill/browser/risk/fingerprint.cc |
| @@ -182,7 +182,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, |
| @@ -225,7 +225,7 @@ class FingerprintDataLoader : public content::GpuDataManagerObserver { |
| content::GeolocationProvider::LocationUpdateCallback geolocation_callback_; |
| // 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_; |
| @@ -251,7 +251,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, |
| @@ -263,7 +263,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), |
| @@ -282,9 +282,11 @@ FingerprintDataLoader::FingerprintDataLoader( |
| gpu_data_manager_->RequestCompleteGpuInfoIfNeeded(); |
| } |
| +#if defined(ENABLE_PLUGINS) |
| // Load plugin data. |
| content::PluginService::GetInstance()->GetPlugins( |
| base::Bind(&FingerprintDataLoader::OnGotPlugins, base::Unretained(this))); |
| +#endif |
| // Load font data. |
| content::GetFontListAsync( |
| @@ -360,11 +362,15 @@ void FingerprintDataLoader::OnGotGeopositionOnIOThread( |
| void FingerprintDataLoader::MaybeFillFingerprint() { |
| // If all of the data has been loaded, fill the fingerprint and clean up. |
| - if (gpu_data_manager_->IsCompleteGpuInfoAvailable() && |
| + bool finished = gpu_data_manager_->IsCompleteGpuInfoAvailable() && |
| fonts_ && |
| has_loaded_plugins_ && |
|
Ilya Sherman
2013/05/22 22:34:24
Did you mean to remove this line? It seems like i
Dan Beam
2013/05/22 23:25:20
this was messed up in a merge conflict, they haven
|
| (geoposition_.Validate() || |
| - geoposition_.error_code != content::Geoposition::ERROR_CODE_NONE)) { |
| + geoposition_.error_code != content::Geoposition::ERROR_CODE_NONE); |
| +#if defined(ENABLE_PLUGINS) |
| + finished = finished && has_loaded_plugins_; |
| +#endif |
| + if (finished) { |
| FillFingerprint(); |
| delete this; |
| } |
| @@ -425,7 +431,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()); |
| @@ -434,7 +440,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, |
| @@ -454,14 +460,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, |
| @@ -474,9 +481,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 |