Bug 1334564 - Deprecate URL.createObjectURL(mediastream), r=smaug, r=rjesup

This commit is contained in:
Andrea Marchesini 2017-02-07 08:58:35 +01:00
parent 3f7720742d
commit 16bc4a8d06
5 changed files with 19 additions and 2 deletions

View File

@ -50,3 +50,4 @@ DEPRECATED_OPERATION(PrefixedFullscreenAPI)
DEPRECATED_OPERATION(LenientSetter)
DEPRECATED_OPERATION(FileLastModifiedDate)
DEPRECATED_OPERATION(ImageBitmapRenderingContext_TransferImageBitmap)
DEPRECATED_OPERATION(URLCreateObjectURL_MediaStream)

View File

@ -3618,8 +3618,15 @@ DeprecationWarning(JSContext* aCx, JSObject* aObject,
return;
}
DeprecationWarning(global, aOperation);
}
void
DeprecationWarning(const GlobalObject& aGlobal,
nsIDocument::DeprecatedOperations aOperation)
{
if (NS_IsMainThread()) {
nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(global.GetAsSupports());
nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal.GetAsSupports());
if (window && window->GetExtantDoc()) {
window->GetExtantDoc()->WarnOnceAbout(aOperation);
}
@ -3627,7 +3634,7 @@ DeprecationWarning(JSContext* aCx, JSObject* aObject,
return;
}
WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aCx);
WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aGlobal.Context());
if (!workerPrivate) {
return;
}

View File

@ -3195,6 +3195,10 @@ void
DeprecationWarning(JSContext* aCx, JSObject* aObject,
nsIDocument::DeprecatedOperations aOperation);
void
DeprecationWarning(const GlobalObject& aGlobal,
nsIDocument::DeprecatedOperations aOperation);
// A callback to perform funToString on an interface object
JSString*
InterfaceObjectToString(JSContext* aCx, JS::Handle<JSObject*> aObject,

View File

@ -321,3 +321,5 @@ LargeAllocationNonE10S=A Large-Allocation header was ignored due to the document
GeolocationInsecureRequestIsForbidden=A Geolocation request can only be fulfilled in a secure context.
# LOCALIZATION NOTE: Do not translate "Large-Allocation", as it is a literal header name.
LargeAllocationNonWin32=This page would be loaded in a new process due to a Large-Allocation header, however Large-Allocation process creation is disabled on non-Win32 platforms.
# LOCALIZATION NOTE: Do not translate URL.createObjectURL(MediaStream).
URLCreateObjectURL_MediaStream=URL.createObjectURL(MediaStream) is deprecated and will be removed soon.

View File

@ -1727,6 +1727,9 @@ URL::CreateObjectURL(const GlobalObject& aGlobal, DOMMediaStream& aStream,
nsAString& aResult, ErrorResult& aRv)
{
MOZ_ASSERT(NS_IsMainThread());
DeprecationWarning(aGlobal, nsIDocument::eURLCreateObjectURL_MediaStream);
URLMainThread::CreateObjectURL(aGlobal, aStream, aResult, aRv);
}