Bug 1442560 - Add a note for deprecating passing a storage option to indexedDB.open(). r=asuth
MozReview-Commit-ID: 44yCmYrPP26
--- a/dom/base/nsDeprecatedOperationList.h
+++ b/dom/base/nsDeprecatedOperationList.h
@@ -42,8 +42,9 @@ DEPRECATED_OPERATION(URLCreateObjectURL_
DEPRECATED_OPERATION(XMLBaseAttribute)
DEPRECATED_OPERATION(WindowContentUntrusted)
DEPRECATED_OPERATION(RegisterProtocolHandlerInsecure)
DEPRECATED_OPERATION(MixedDisplayObjectSubrequest)
DEPRECATED_OPERATION(MotionEvent)
DEPRECATED_OPERATION(OrientationEvent)
DEPRECATED_OPERATION(ProximityEvent)
DEPRECATED_OPERATION(AmbientLightEvent)
+DEPRECATED_OPERATION(IDBOpenDBOptions_StorageType)
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -449,16 +449,24 @@ IDBFactory::Open(JSContext* aCx,
const nsAString& aName,
const IDBOpenDBOptions& aOptions,
CallerType aCallerType,
ErrorResult& aRv)
{
if (!IsChrome() &&
aOptions.mStorage.WasPassed()) {
+ if (mWindow && mWindow->GetExtantDoc()) {
+ mWindow->GetExtantDoc()->WarnOnceAbout(nsIDocument::eIDBOpenDBOptions_StorageType);
+ } else if (!NS_IsMainThread()) {
+ // The method below reports on the main thread too, so we need to make sure we're on a worker.
+ // Workers don't have a WarnOnceAbout mechanism, so this will be reported every time.
+ WorkerPrivate::ReportErrorToConsole("IDBOpenDBOptions_StorageType");
+ }
+
bool ignore = false;
// Ignore internal usage on about: pages.
if (NS_IsMainThread()) {
nsCOMPtr<nsIPrincipal> principal = PrincipalInfoToPrincipal(*mPrincipalInfo);
if (principal) {
nsCOMPtr<nsIURI> uri;
nsresult rv = principal->GetURI(getter_AddRefs(uri));
if (NS_SUCCEEDED(rv) && uri) {
--- a/dom/locales/en-US/chrome/dom/dom.properties
+++ b/dom/locales/en-US/chrome/dom/dom.properties
@@ -354,8 +354,10 @@ InvalidKeyframePropertyValue=Keyframe property value “%1$S” is invalid according to the syntax for “%2$S”.
ReadableStreamReadingFailed=Failed to read data from the ReadableStream: “%S”.
# LOCALIZATION NOTE: Do not translate "registerProtocolHandler".
RegisterProtocolHandlerInsecureWarning=Use of the registerProtocolHandler for insecure connections will be removed in version 62.
MixedDisplayObjectSubrequestWarning=Loading insecure content within a plugin embedded in a secure connection is going to be removed.
MotionEventWarning=Use of the motion sensor is deprecated.
OrientationEventWarning=Use of the orientation sensor is deprecated.
ProximityEventWarning=Use of the proximity sensor is deprecated.
AmbientLightEventWarning=Use of the ambient light sensor is deprecated.
+# LOCALIZATION NOTE: Do not translate "storage", "indexedDB.open" and "navigator.storage.persist()".
+IDBOpenDBOptions_StorageTypeWarning=The ‘storage’ attribute in options passed to indexedDB.open is deprecated and will soon be removed. To get persistent storage, please use navigator.storage.persist() instead.