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

Unified Diff: chrome/browser/ui/webui/options/font_settings_handler.cc

Issue 1397903004: options: Fix async font fetching crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « chrome/browser/ui/webui/options/font_settings_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/font_settings_handler.cc
diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc
index 865e6715c3c51a630a8249dbf9407c308dfd00ad..690e0532399a71f63adc15f18b20be72f78237c8 100644
--- a/chrome/browser/ui/webui/options/font_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/font_settings_handler.cc
@@ -64,7 +64,8 @@ const char kAdvancedFontSettingsExtensionId[] =
namespace options {
FontSettingsHandler::FontSettingsHandler()
- : extension_registry_observer_(this) {
+ : extension_registry_observer_(this),
+ weak_ptr_factory_(this) {
}
FontSettingsHandler::~FontSettingsHandler() {
@@ -190,7 +191,7 @@ void FontSettingsHandler::OnExtensionUnloaded(
void FontSettingsHandler::HandleFetchFontsData(const base::ListValue* args) {
content::GetFontListAsync(
base::Bind(&FontSettingsHandler::FontsListHasLoaded,
- base::Unretained(this)));
+ weak_ptr_factory_.GetWeakPtr()));
}
void FontSettingsHandler::FontsListHasLoaded(
« no previous file with comments | « chrome/browser/ui/webui/options/font_settings_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698