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

Unified Diff: chrome/browser/ui/webui/settings/profile_info_handler.h

Issue 1942323002: Fix a used-after-free caused by an unremoved Observer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/profile_info_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/profile_info_handler.h
diff --git a/chrome/browser/ui/webui/settings/profile_info_handler.h b/chrome/browser/ui/webui/settings/profile_info_handler.h
index e0ab2adbc3688ee78d597cc9ffb892f4643e3104..4bc64054bd4bc09d38173407ad7047b8dd7e1cf2 100644
--- a/chrome/browser/ui/webui/settings/profile_info_handler.h
+++ b/chrome/browser/ui/webui/settings/profile_info_handler.h
@@ -8,6 +8,7 @@
#include <memory>
#include "base/macros.h"
+#include "base/scoped_observer.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
@@ -30,7 +31,7 @@ class ProfileInfoHandler : public SettingsPageUIHandler,
static const char kProfileInfoChangedEventName[];
explicit ProfileInfoHandler(Profile* profile);
- ~ProfileInfoHandler() override {}
+ ~ProfileInfoHandler() override;
// SettingsPageUIHandler implementation.
void RegisterMessages() override;
@@ -63,6 +64,9 @@ class ProfileInfoHandler : public SettingsPageUIHandler,
// Weak pointer.
Profile* profile_;
+ ScopedObserver<ProfileAttributesStorage, ProfileInfoHandler>
+ profile_observer_;
+
#if defined(OS_CHROMEOS)
// Used to listen to ChromeOS user image changes.
content::NotificationRegistrar registrar_;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/profile_info_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698