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

Unified Diff: chrome/browser/sync/test/integration/extension_settings_helper.cc

Issue 2944993002: Remove dependency on BrowserThread::FILE from Sync code (Closed)
Patch Set: More explicit about returning nullptr ModelSafeWorker for FILE group on Android and iOS Created 3 years, 6 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: chrome/browser/sync/test/integration/extension_settings_helper.cc
diff --git a/chrome/browser/sync/test/integration/extension_settings_helper.cc b/chrome/browser/sync/test/integration/extension_settings_helper.cc
index 521f813e1d9227992554bfa46a6c1d892d4e753f..9c01d26589140d0fef218bb2db69fbe03fbf0e97 100644
--- a/chrome/browser/sync/test/integration/extension_settings_helper.cc
+++ b/chrome/browser/sync/test/integration/extension_settings_helper.cc
@@ -11,18 +11,17 @@
#include "base/logging.h"
#include "base/synchronization/waitable_event.h"
#include "base/values.h"
+#include "chrome/browser/extensions/api/storage/backend_task_runner.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/test/integration/extensions_helper.h"
#include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
#include "chrome/browser/sync/test/integration/sync_extension_helper.h"
-#include "content/public/browser/browser_thread.h"
#include "extensions/browser/api/storage/storage_frontend.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/value_store/value_store.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
-using content::BrowserThread;
using extensions::ExtensionRegistry;
using sync_datatype_helper::test;
@@ -37,10 +36,10 @@ std::string ToJson(const base::Value& value) {
return json;
}
-void GetAllSettingsOnFileThread(base::DictionaryValue* out,
- base::WaitableEvent* signal,
- ValueStore* storage) {
- CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+void GetAllSettingsOnBackendSequence(base::DictionaryValue* out,
+ base::WaitableEvent* signal,
+ ValueStore* storage) {
+ EXPECT_TRUE(extensions::GetBackendTaskRunner()->RunsTasksInCurrentSequence());
out->Swap(&storage->Get()->settings());
signal->Signal();
}
@@ -53,7 +52,7 @@ std::unique_ptr<base::DictionaryValue> GetAllSettings(Profile* profile,
extensions::StorageFrontend::Get(profile)->RunWithStorage(
ExtensionRegistry::Get(profile)->enabled_extensions().GetByID(id),
extensions::settings_namespace::SYNC,
- base::Bind(&GetAllSettingsOnFileThread, settings.get(), &signal));
+ base::Bind(&GetAllSettingsOnBackendSequence, settings.get(), &signal));
signal.Wait();
return settings;
}
@@ -85,11 +84,10 @@ bool AreSettingsSame(Profile* expected_profile, Profile* actual_profile) {
return same;
}
-void SetSettingsOnFileThread(
- const base::DictionaryValue* settings,
- base::WaitableEvent* signal,
- ValueStore* storage) {
- CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+void SetSettingsOnBackendSequence(const base::DictionaryValue* settings,
+ base::WaitableEvent* signal,
+ ValueStore* storage) {
+ EXPECT_TRUE(extensions::GetBackendTaskRunner()->RunsTasksInCurrentSequence());
storage->Set(ValueStore::DEFAULTS, *settings);
signal->Signal();
}
@@ -105,7 +103,7 @@ void SetExtensionSettings(
extensions::StorageFrontend::Get(profile)->RunWithStorage(
ExtensionRegistry::Get(profile)->enabled_extensions().GetByID(id),
extensions::settings_namespace::SYNC,
- base::Bind(&SetSettingsOnFileThread, &settings, &signal));
+ base::Bind(&SetSettingsOnBackendSequence, &settings, &signal));
signal.Wait();
}
« no previous file with comments | « chrome/browser/sync/glue/extension_setting_data_type_controller.cc ('k') | ios/chrome/browser/sync/ios_chrome_sync_client.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698