Bug 1942014 - QM: Add a new environment variable for enabling incremental origin initialization; r=dom-storage-reviewers,hsingh
- Updated QuotaPrefs::IncrementalOriginInitializationEnabled to check for the environment variable MOZ_ENABLE_INC_ORIGIN_INIT. - If the environment variable is set to 1, it enables incremental origin initialization regardless of the preference value. - Retained the existing behavior of using the dom.quotaManager.temporaryStorage.incrementalOriginInitialization preference as the primary configuration. - The environment variable is primarily intended for use in testing infrastructure and harnesses Differential Revision: https://phabricator.services.mozilla.com/D234578
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "QuotaPrefs.h"
|
||||
|
||||
#include "mozilla/StaticPrefs_dom.h"
|
||||
#include "prenv.h"
|
||||
|
||||
// The STATIC_PREF macro helps avoid lines exceeding 80 characters due to
|
||||
// long method names generated from StaticPrefList.yaml. It constructs
|
||||
@@ -32,8 +33,13 @@ bool QuotaPrefs::TriggerOriginInitializationInBackgroundEnabled() {
|
||||
|
||||
// static
|
||||
bool QuotaPrefs::IncrementalOriginInitializationEnabled() {
|
||||
return STATIC_PREF(dom, quotaManager, temporaryStorage,
|
||||
incrementalOriginInitialization)();
|
||||
if (STATIC_PREF(dom, quotaManager, temporaryStorage,
|
||||
incrementalOriginInitialization)()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* env = PR_GetEnv("MOZ_ENABLE_INC_ORIGIN_INIT");
|
||||
return (env && *env == '1');
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom::quota
|
||||
|
||||
Reference in New Issue
Block a user