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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_settings_ui_wrapper.h" 5 #include "chrome/browser/extensions/extension_settings_ui_wrapper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "chrome/browser/extensions/extension_settings.h" 9 #include "chrome/browser/extensions/extension_settings.h"
10 #include "content/browser/browser_thread.h" 10 #include "content/browser/browser_thread.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 void ExtensionSettingsUIWrapper::Core::RunWithSettingsOnFileThread( 53 void ExtensionSettingsUIWrapper::Core::RunWithSettingsOnFileThread(
54 const SettingsCallback& callback) { 54 const SettingsCallback& callback) {
55 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 55 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
56 DCHECK(extension_settings_); 56 DCHECK(extension_settings_);
57 callback.Run(extension_settings_); 57 callback.Run(extension_settings_);
58 } 58 }
59 59
60 ExtensionSettingsUIWrapper::Core::~Core() { 60 ExtensionSettingsUIWrapper::Core::~Core() {
61 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || 61 if (BrowserThread::CurrentlyOn(BrowserThread::FILE)) {
62 BrowserThread::CurrentlyOn(BrowserThread::FILE)); 62 delete extension_settings_;
63 BrowserThread::DeleteSoon( 63 } else if (BrowserThread::CurrentlyOn(BrowserThread::UI)) {
64 BrowserThread::FILE, FROM_HERE, extension_settings_); 64 BrowserThread::DeleteSoon(
65 BrowserThread::FILE, FROM_HERE, extension_settings_);
66 } else {
67 NOTREACHED();
68 }
65 } 69 }
OLDNEW
« 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