mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00
Bug 1517089 - Part 5: Move storage service initialization to InitializeLocalStorage; r=asuth
This commit is contained in:
parent
01b23e7ba8
commit
5302b36c41
@ -2944,6 +2944,14 @@ void InitializeLocalStorage() {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(!gLocalStorageInitialized);
|
||||
|
||||
if (!QuotaManager::IsRunningGTests()) {
|
||||
// This service has to be started on the main thread currently.
|
||||
nsCOMPtr<mozIStorageService> ss;
|
||||
if (NS_WARN_IF(!(ss = do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID)))) {
|
||||
NS_WARNING("Failed to get storage service!");
|
||||
}
|
||||
}
|
||||
|
||||
if (NS_FAILED(QuotaClient::Initialize())) {
|
||||
NS_WARNING("Failed to initialize quota client!");
|
||||
}
|
||||
@ -5652,12 +5660,6 @@ nsresult PrepareDatastoreOp::Open() {
|
||||
}
|
||||
}
|
||||
|
||||
// This service has to be started on the main thread currently.
|
||||
nsCOMPtr<mozIStorageService> ss;
|
||||
if (NS_WARN_IF(!(ss = do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID)))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mState = State::Nesting;
|
||||
mNestedState = NestedState::CheckExistingOperations;
|
||||
|
||||
|
@ -104,6 +104,11 @@ class QuotaManager final : public BackgroundThreadObject {
|
||||
return kRunningXPCShellTests;
|
||||
}
|
||||
|
||||
static bool IsRunningGTests() {
|
||||
static bool kRunningGTests = !!PR_GetEnv("MOZ_RUN_GTEST");
|
||||
return kRunningGTests;
|
||||
}
|
||||
|
||||
static const char kReplaceChars[];
|
||||
|
||||
static void GetOrCreate(nsIRunnable* aCallback,
|
||||
|
Loading…
x
Reference in New Issue
Block a user