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

Unified Diff: chrome/browser/ui/webui/options/preferences_browsertest.h

Issue 2569083003: Prevent prefs_registrar unsubscribe from destroyed pref_service (Closed)
Patch Set: nit removal Created 4 years 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/options/preferences_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/preferences_browsertest.h
diff --git a/chrome/browser/ui/webui/options/preferences_browsertest.h b/chrome/browser/ui/webui/options/preferences_browsertest.h
index 092900350e014b2fad5363bf0d8934e3ac5c9541..9532cf9266a9e77aaf3576521ca9495b728c77b3 100644
--- a/chrome/browser/ui/webui/options/preferences_browsertest.h
+++ b/chrome/browser/ui/webui/options/preferences_browsertest.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_PREFERENCES_BROWSERTEST_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_PREFERENCES_BROWSERTEST_H_
+#include <memory>
#include <string>
#include <vector>
@@ -38,12 +39,16 @@ class PreferencesBrowserTest : public InProcessBrowserTest {
// InProcessBrowserTest implementation:
void SetUpOnMainThread() override;
+ void TearDownOnMainThread() override;
void OnPreferenceChanged(const std::string& pref_name);
protected:
MOCK_METHOD1(OnCommit, void(const PrefService::Preference*));
+ // The pref service that holds the current pref values in the C++ backend.
+ PrefService* pref_service();
+
void SetUpPrefs();
// InProcessBrowserTest implementation:
@@ -175,10 +180,7 @@ class PreferencesBrowserTest : public InProcessBrowserTest {
// Pref change registrar that detects changes to user-modified pref values
// made in the C++ backend by the JavaScript Preferences class.
- PrefChangeRegistrar pref_change_registrar_;
-
- // The pref service that holds the current pref values in the C++ backend.
- PrefService* pref_service_;
+ std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_;
// The prefs and corresponding policies used by the current test.
std::vector<std::string> types_;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/preferences_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698