OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Generating a fingerprint consists of two major steps: | 5 // Generating a fingerprint consists of two major steps: |
6 // (1) Gather all the necessary data. | 6 // (1) Gather all the necessary data. |
7 // (2) Write it into a protocol buffer. | 7 // (2) Write it into a protocol buffer. |
8 // | 8 // |
9 // Step (2) is as simple as it sounds -- it's really just a matter of copying | 9 // Step (2) is as simple as it sounds -- it's really just a matter of copying |
10 // data. Step (1) requires waiting on several asynchronous callbacks, which are | 10 // data. Step (1) requires waiting on several asynchronous callbacks, which are |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 return; | 165 return; |
166 | 166 |
167 const gpu::GPUInfo gpu_info = gpu_data_manager.GetGPUInfo(); | 167 const gpu::GPUInfo gpu_info = gpu_data_manager.GetGPUInfo(); |
168 | 168 |
169 Fingerprint::MachineCharacteristics::Graphics* graphics = | 169 Fingerprint::MachineCharacteristics::Graphics* graphics = |
170 machine->mutable_graphics_card(); | 170 machine->mutable_graphics_card(); |
171 graphics->set_vendor_id(gpu_info.gpu.vendor_id); | 171 graphics->set_vendor_id(gpu_info.gpu.vendor_id); |
172 graphics->set_device_id(gpu_info.gpu.device_id); | 172 graphics->set_device_id(gpu_info.gpu.device_id); |
173 graphics->set_driver_version(gpu_info.driver_version); | 173 graphics->set_driver_version(gpu_info.driver_version); |
174 graphics->set_driver_date(gpu_info.driver_date); | 174 graphics->set_driver_date(gpu_info.driver_date); |
175 | |
176 Fingerprint::MachineCharacteristics::Graphics::PerformanceStatistics* | |
177 gpu_performance = graphics->mutable_performance_statistics(); | |
178 gpu_performance->set_graphics_score(gpu_info.performance_stats.graphics); | |
179 gpu_performance->set_gaming_score(gpu_info.performance_stats.gaming); | |
180 gpu_performance->set_overall_score(gpu_info.performance_stats.overall); | |
181 } | 175 } |
182 | 176 |
183 // Waits for all asynchronous data required for the fingerprint to be loaded, | 177 // Waits for all asynchronous data required for the fingerprint to be loaded, |
184 // then fills out the fingerprint. | 178 // then fills out the fingerprint. |
185 class FingerprintDataLoader : public content::GpuDataManagerObserver { | 179 class FingerprintDataLoader : public content::GpuDataManagerObserver { |
186 public: | 180 public: |
187 FingerprintDataLoader( | 181 FingerprintDataLoader( |
188 uint64 obfuscated_gaia_id, | 182 uint64 obfuscated_gaia_id, |
189 const gfx::Rect& window_bounds, | 183 const gfx::Rect& window_bounds, |
190 const gfx::Rect& content_bounds, | 184 const gfx::Rect& content_bounds, |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 host_view->GetRenderWidgetHost()->GetWebScreenInfo(&screen_info); | 478 host_view->GetRenderWidgetHost()->GetWebScreenInfo(&screen_info); |
485 | 479 |
486 internal::GetFingerprintInternal( | 480 internal::GetFingerprintInternal( |
487 obfuscated_gaia_id, window_bounds, content_bounds, screen_info, version, | 481 obfuscated_gaia_id, window_bounds, content_bounds, screen_info, version, |
488 charset, accept_languages, install_time, app_locale, user_agent, | 482 charset, accept_languages, install_time, app_locale, user_agent, |
489 base::TimeDelta::FromSeconds(kTimeoutSeconds), callback); | 483 base::TimeDelta::FromSeconds(kTimeoutSeconds), callback); |
490 } | 484 } |
491 | 485 |
492 } // namespace risk | 486 } // namespace risk |
493 } // namespace autofill | 487 } // namespace autofill |
OLD | NEW |