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

Unified Diff: extensions/browser/value_store/legacy_value_store_factory.cc

Issue 2965153002: Migrate Extensions code to Task Scheduler API (Closed)
Patch Set: Self review Created 3 years, 5 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
Index: extensions/browser/value_store/legacy_value_store_factory.cc
diff --git a/extensions/browser/value_store/legacy_value_store_factory.cc b/extensions/browser/value_store/legacy_value_store_factory.cc
index 3bede532d4882123968d5dc7ab5460634b4970ce..e46a69aee52e758cc5b42959457be8300fd74fd7 100644
--- a/extensions/browser/value_store/legacy_value_store_factory.cc
+++ b/extensions/browser/value_store/legacy_value_store_factory.cc
@@ -9,12 +9,11 @@
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
-#include "content/public/browser/browser_thread.h"
+#include "base/threading/thread_restrictions.h"
#include "extensions/browser/value_store/leveldb_value_store.h"
#include "extensions/common/constants.h"
using base::AutoLock;
-using content::BrowserThread;
namespace {
@@ -59,7 +58,7 @@ bool LegacyValueStoreFactory::ModelSettings::DataExists(
std::set<ExtensionId>
LegacyValueStoreFactory::ModelSettings::GetKnownExtensionIDs() const {
- DCHECK_CURRENTLY_ON(BrowserThread::FILE);
+ base::ThreadRestrictions::AssertIOAllowed();
std::set<ExtensionId> result;
// Leveldb databases are directories inside |base_path_|.
@@ -128,7 +127,7 @@ LegacyValueStoreFactory::SettingsRoot::GetModel(ModelType model_type) {
std::set<ExtensionId>
LegacyValueStoreFactory::SettingsRoot::GetKnownExtensionIDs(
ModelType model_type) const {
- DCHECK_CURRENTLY_ON(BrowserThread::FILE);
+ base::ThreadRestrictions::AssertIOAllowed();
switch (model_type) {
case ValueStoreFactory::ModelType::APP:
DCHECK(apps_ != nullptr);
@@ -192,8 +191,7 @@ void LegacyValueStoreFactory::DeleteSettings(
settings_namespace::Namespace settings_namespace,
ModelType model_type,
const ExtensionId& extension_id) {
- // TODO(cmumford): Verify that we always need to be called on FILE thread.
- DCHECK_CURRENTLY_ON(BrowserThread::FILE);
+ base::ThreadRestrictions::AssertIOAllowed();
ModelSettings* model_settings =
GetSettingsRoot(settings_namespace).GetModel(model_type);
if (model_settings == nullptr) {

Powered by Google App Engine
This is Rietveld 408576698