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

Unified Diff: chrome/browser/extensions/extension_settings_ui_wrapper.cc

Issue 7977041: Fix unittest-only leak in ExtensionSettingsUIWrapper. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 3 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 | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_settings_ui_wrapper.cc
diff --git a/chrome/browser/extensions/extension_settings_ui_wrapper.cc b/chrome/browser/extensions/extension_settings_ui_wrapper.cc
index 20cad1e35878ebc21c7b93e08bb3e610ab975e6f..c9fe62d6dac9526b5047ce9acf4beda9fdc83825 100644
--- a/chrome/browser/extensions/extension_settings_ui_wrapper.cc
+++ b/chrome/browser/extensions/extension_settings_ui_wrapper.cc
@@ -58,8 +58,12 @@ void ExtensionSettingsUIWrapper::Core::RunWithSettingsOnFileThread(
}
ExtensionSettingsUIWrapper::Core::~Core() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
- BrowserThread::CurrentlyOn(BrowserThread::FILE));
- BrowserThread::DeleteSoon(
- BrowserThread::FILE, FROM_HERE, extension_settings_);
+ if (BrowserThread::CurrentlyOn(BrowserThread::FILE)) {
+ delete extension_settings_;
+ } else if (BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::DeleteSoon(
+ BrowserThread::FILE, FROM_HERE, extension_settings_);
+ } else {
+ NOTREACHED();
+ }
}
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698