Commit 5b52a628 authored by Sigurdur Asgeirsson's avatar Sigurdur Asgeirsson Committed by Commit Bot

Retire ScopedObserver in /components/autofill.

ScopedObserver is being deprecated in favor of two new classes:
- base::ScopedObservation for observers that only ever observe
  a single source.
- base::ScopedMultiSourceObservation for observers that do or may
  observe more than a single source.

This CL was uploaded by git cl split.

R=ftirelo@chromium.org

Bug: 1145565
Change-Id: Icad7d2607d3f5820af9ea1648beab6661c502a5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2532876
Auto-Submit: Sigurður Ásgeirsson <siggi@chromium.org>
Commit-Queue: Fabio Tirelo <ftirelo@chromium.org>
Reviewed-by: default avatarFabio Tirelo <ftirelo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826450}
parent 0c93bcb5
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "base/cpu.h" #include "base/cpu.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/scoped_observer.h" #include "base/scoped_observation.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/system/sys_info.h" #include "base/system/sys_info.h"
...@@ -221,8 +221,9 @@ class FingerprintDataLoader : public content::GpuDataManagerObserver { ...@@ -221,8 +221,9 @@ class FingerprintDataLoader : public content::GpuDataManagerObserver {
// Ensures that any observer registrations for the GPU data are cleaned up by // Ensures that any observer registrations for the GPU data are cleaned up by
// the time this object is destroyed. // the time this object is destroyed.
ScopedObserver<content::GpuDataManager, content::GpuDataManagerObserver> base::ScopedObservation<content::GpuDataManager,
gpu_observer_{this}; content::GpuDataManagerObserver>
gpu_observation_{this};
// Data that will be passed on to the next loading phase. See the comment for // Data that will be passed on to the next loading phase. See the comment for
// GetFingerprint() for a description of these variables. // GetFingerprint() for a description of these variables.
...@@ -295,7 +296,7 @@ FingerprintDataLoader::FingerprintDataLoader( ...@@ -295,7 +296,7 @@ FingerprintDataLoader::FingerprintDataLoader(
// Load GPU data if needed. // Load GPU data if needed.
if (gpu_data_manager_->GpuAccessAllowed(nullptr) && if (gpu_data_manager_->GpuAccessAllowed(nullptr) &&
!gpu_data_manager_->IsEssentialGpuInfoAvailable()) { !gpu_data_manager_->IsEssentialGpuInfoAvailable()) {
gpu_observer_.Add(gpu_data_manager_); gpu_observation_.Observe(gpu_data_manager_);
OnGpuInfoUpdate(); OnGpuInfoUpdate();
} }
...@@ -326,7 +327,8 @@ void FingerprintDataLoader::OnGpuInfoUpdate() { ...@@ -326,7 +327,8 @@ void FingerprintDataLoader::OnGpuInfoUpdate() {
if (!gpu_data_manager_->IsEssentialGpuInfoAvailable()) if (!gpu_data_manager_->IsEssentialGpuInfoAvailable())
return; return;
gpu_observer_.Remove(gpu_data_manager_); DCHECK(gpu_observation_.IsObservingSource(gpu_data_manager_));
gpu_observation_.RemoveObservation();
MaybeFillFingerprint(); MaybeFillFingerprint();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment