| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/settings/settings_frontend.h" | 5 #include "chrome/browser/extensions/settings/settings_frontend.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 165 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 166 | 166 |
| 167 ValueStoreCache* cache = caches_[settings_namespace]; | 167 ValueStoreCache* cache = caches_[settings_namespace]; |
| 168 CHECK(cache); | 168 CHECK(cache); |
| 169 | 169 |
| 170 // The |extension| has already been referenced earlier in the stack, so it | 170 // The |extension| has already been referenced earlier in the stack, so it |
| 171 // can't be gone here. | 171 // can't be gone here. |
| 172 // TODO(kalman): change RunWithStorage() to take a | 172 // TODO(kalman): change RunWithStorage() to take a |
| 173 // scoped_refptr<const Extension> instead. | 173 // scoped_refptr<const Extension> instead. |
| 174 scoped_refptr<const Extension> extension = | 174 scoped_refptr<const Extension> extension = |
| 175 profile_->GetExtensionService()->GetExtensionById(extension_id, true); | 175 extensions::ExtensionSystem::Get(profile_)->extension_service()-> |
| 176 GetExtensionById(extension_id, true); |
| 176 CHECK(extension); | 177 CHECK(extension); |
| 177 | 178 |
| 178 cache->GetMessageLoop()->PostTask( | 179 cache->GetMessageLoop()->PostTask( |
| 179 FROM_HERE, | 180 FROM_HERE, |
| 180 base::Bind(&ValueStoreCache::RunWithValueStoreForExtension, | 181 base::Bind(&ValueStoreCache::RunWithValueStoreForExtension, |
| 181 base::Unretained(cache), callback, extension)); | 182 base::Unretained(cache), callback, extension)); |
| 182 } | 183 } |
| 183 | 184 |
| 184 void SettingsFrontend::DeleteStorageSoon( | 185 void SettingsFrontend::DeleteStorageSoon( |
| 185 const std::string& extension_id) { | 186 const std::string& extension_id) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 204 CacheMap::iterator it = caches_.find(settings_namespace); | 205 CacheMap::iterator it = caches_.find(settings_namespace); |
| 205 if (it != caches_.end()) { | 206 if (it != caches_.end()) { |
| 206 ValueStoreCache* cache = it->second; | 207 ValueStoreCache* cache = it->second; |
| 207 cache->ShutdownOnUI(); | 208 cache->ShutdownOnUI(); |
| 208 cache->GetMessageLoop()->DeleteSoon(FROM_HERE, cache); | 209 cache->GetMessageLoop()->DeleteSoon(FROM_HERE, cache); |
| 209 caches_.erase(it); | 210 caches_.erase(it); |
| 210 } | 211 } |
| 211 } | 212 } |
| 212 | 213 |
| 213 } // namespace extensions | 214 } // namespace extensions |
| OLD | NEW |