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

Side by Side Diff: chrome/browser/extensions/api/storage/managed_value_store_cache.cc

Issue 501263002: Remove implicit conversions from scoped_refptr to T* in chrome/browser/extensions/api/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just in case Created 6 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
OLDNEW
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/api/storage/managed_value_store_cache.h" 5 #include "chrome/browser/extensions/api/storage/managed_value_store_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 LoadSchemas( 154 LoadSchemas(
155 ExtensionRegistry::Get(profile_)->GenerateInstalledExtensionsSet()); 155 ExtensionRegistry::Get(profile_)->GenerateInstalledExtensionsSet());
156 } 156 }
157 157
158 void ManagedValueStoreCache::ExtensionTracker::LoadSchemas( 158 void ManagedValueStoreCache::ExtensionTracker::LoadSchemas(
159 scoped_ptr<ExtensionSet> added) { 159 scoped_ptr<ExtensionSet> added) {
160 // Filter out extensions that don't use managed storage. 160 // Filter out extensions that don't use managed storage.
161 ExtensionSet::const_iterator it = added->begin(); 161 ExtensionSet::const_iterator it = added->begin();
162 while (it != added->end()) { 162 while (it != added->end()) {
163 std::string to_remove; 163 std::string to_remove;
164 if (!UsesManagedStorage(*it)) 164 if (!UsesManagedStorage(it->get()))
165 to_remove = (*it)->id(); 165 to_remove = (*it)->id();
166 ++it; 166 ++it;
167 if (!to_remove.empty()) 167 if (!to_remove.empty())
168 added->Remove(to_remove); 168 added->Remove(to_remove);
169 } 169 }
170 170
171 // Load the schema files in a background thread. 171 // Load the schema files in a background thread.
172 BrowserThread::PostBlockingPoolSequencedTask( 172 BrowserThread::PostBlockingPoolSequencedTask(
173 kLoadSchemasBackgroundTaskTokenName, FROM_HERE, 173 kLoadSchemasBackgroundTaskTokenName, FROM_HERE,
174 base::Bind(&ExtensionTracker::LoadSchemasOnBlockingPool, 174 base::Bind(&ExtensionTracker::LoadSchemasOnBlockingPool,
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 return store; 369 return store;
370 } 370 }
371 371
372 bool ManagedValueStoreCache::HasStore(const std::string& extension_id) const { 372 bool ManagedValueStoreCache::HasStore(const std::string& extension_id) const {
373 // TODO(joaodasilva): move this check to a ValueStore method. 373 // TODO(joaodasilva): move this check to a ValueStore method.
374 return base::DirectoryExists(base_path_.AppendASCII(extension_id)); 374 return base::DirectoryExists(base_path_.AppendASCII(extension_id));
375 } 375 }
376 376
377 } // namespace extensions 377 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698