OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |