Bug 1206030 - Remove nsIDOMHTMLCanvasElement::MozFetchAsStream() f=Ms2ger r=jst
authorTim Taubert <ttaubert@mozilla.com>
Fri, 18 Sep 2015 12:21:27 +0200
changeset 263247 045b1309490f8d1de44768effd16fe7b997ba19d
parent 263246 eb30e5ee32f0a11e3df594b5b3e69d0a5566bb63
child 263248 ef74a17b0963c6d1fc21e888b68bc67d9196ef7a
push id65254
push userttaubert@mozilla.com
push dateFri, 18 Sep 2015 14:40:59 +0000
treeherdermozilla-inbound@045b1309490f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs1206030
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1206030 - Remove nsIDOMHTMLCanvasElement::MozFetchAsStream() f=Ms2ger r=jst
dom/html/HTMLCanvasElement.cpp
dom/html/HTMLCanvasElement.h
dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
dom/webidl/HTMLCanvasElement.webidl
--- a/dom/html/HTMLCanvasElement.cpp
+++ b/dom/html/HTMLCanvasElement.cpp
@@ -485,45 +485,16 @@ HTMLCanvasElement::ToDataURL(const nsASt
   // do a trust check if this is a write-only canvas
   if (mWriteOnly && !nsContentUtils::IsCallerChrome()) {
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   return ToDataURLImpl(aCx, aType, aParams, aDataURL);
 }
 
-// HTMLCanvasElement::mozFetchAsStream
-
-NS_IMETHODIMP
-HTMLCanvasElement::MozFetchAsStream(nsIInputStreamCallback *aCallback,
-                                    const nsAString& aType)
-{
-  if (!nsContentUtils::IsCallerChrome())
-    return NS_ERROR_FAILURE;
-
-  nsresult rv;
-  nsCOMPtr<nsIInputStream> inputData;
-
-  nsAutoString type(aType);
-  rv = ExtractData(type, EmptyString(), getter_AddRefs(inputData));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIAsyncInputStream> asyncData = do_QueryInterface(inputData, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIThread> mainThread;
-  rv = NS_GetMainThread(getter_AddRefs(mainThread));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIInputStreamCallback> asyncCallback =
-    NS_NewInputStreamReadyEvent(aCallback, mainThread);
-
-  return asyncCallback->OnInputStreamReady(asyncData);
-}
-
 void
 HTMLCanvasElement::SetMozPrintCallback(PrintCallback* aCallback)
 {
   mPrintCallback = aCallback;
 }
 
 PrintCallback*
 HTMLCanvasElement::GetMozPrintCallback() const
--- a/dom/html/HTMLCanvasElement.h
+++ b/dom/html/HTMLCanvasElement.h
@@ -155,21 +155,16 @@ public:
                                       ErrorResult& aRv);
   already_AddRefed<nsISupports> MozGetIPCContext(const nsAString& aContextId,
                                                  ErrorResult& aRv)
   {
     nsCOMPtr<nsISupports> context;
     aRv = MozGetIPCContext(aContextId, getter_AddRefs(context));
     return context.forget();
   }
-  void MozFetchAsStream(nsIInputStreamCallback* aCallback,
-                        const nsAString& aType, ErrorResult& aRv)
-  {
-    aRv = MozFetchAsStream(aCallback, aType);
-  }
   PrintCallback* GetMozPrintCallback() const;
   void SetMozPrintCallback(PrintCallback* aCallback);
 
   already_AddRefed<CanvasCaptureMediaStream>
   CaptureStream(const Optional<double>& aFrameRate, ErrorResult& aRv);
 
   /**
    * Get the size in pixels of this canvas element
--- a/dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
@@ -14,17 +14,17 @@
  *
  * @status UNDER_DEVELOPMENT
  */
 
 interface nsIDOMBlob;
 interface nsIVariant;
 interface nsIInputStreamCallback;
 
-[uuid(2c984658-2e7c-4774-8ac5-cf1b39f8bec3)]
+[uuid(4e8f1316-b601-471d-8f44-3c650d91ee9b)]
 interface nsIDOMHTMLCanvasElement : nsISupports
 {
   attribute unsigned long width;
   attribute unsigned long height;
   attribute boolean mozOpaque;
 
   // Valid calls are:
   //  toDataURL();              -- defaults to image/png
@@ -38,15 +38,10 @@ interface nsIDOMHTMLCanvasElement : nsIS
   // mozGetAsFile(name);              -- defaults to image/png
   // mozGetAsFile(name, type);        -- uses given type
   // The return value is a File object.
   nsISupports mozGetAsFile(in DOMString name, [optional] in DOMString type);
 
   // A Mozilla-only extension to get a canvas context backed by double-buffered
   // shared memory. Only privileged callers can call this.
   nsISupports MozGetIPCContext(in DOMString contextId);
-
-  // A Mozilla-only extension that returns the canvas' image data as a data
-  // stream in the desired image format.
-  void mozFetchAsStream(in nsIInputStreamCallback callback,
-                                        [optional] in DOMString type);
 };
 
--- a/dom/webidl/HTMLCanvasElement.webidl
+++ b/dom/webidl/HTMLCanvasElement.webidl
@@ -35,18 +35,16 @@ interface HTMLCanvasElement : HTMLElemen
 // Mozilla specific bits
 partial interface HTMLCanvasElement {
   [Pure, SetterThrows]
            attribute boolean mozOpaque;
   [Throws]
   File mozGetAsFile(DOMString name, optional DOMString? type = null);
   [ChromeOnly, Throws]
   nsISupports? MozGetIPCContext(DOMString contextId);
-  [ChromeOnly]
-  void mozFetchAsStream(nsIInputStreamCallback callback, optional DOMString? type = null);
            attribute PrintCallback? mozPrintCallback;
 
   [Throws, UnsafeInPrerendering, Pref="canvas.capturestream.enabled"]
   CanvasCaptureMediaStream captureStream(optional double frameRate);
 };
 
 [ChromeOnly]
 interface MozCanvasPrintState