diff --git a/content/html/content/src/nsHTMLCanvasElement.cpp b/content/html/content/src/nsHTMLCanvasElement.cpp
index 1d4a405297e..f3aea5ad8f3 100644
--- a/content/html/content/src/nsHTMLCanvasElement.cpp
+++ b/content/html/content/src/nsHTMLCanvasElement.cpp
@@ -354,8 +354,7 @@ nsHTMLCanvasElement::MozGetAsFileImpl(const nsAString& aName,
// The DOMFile takes ownership of the buffer
nsRefPtr file =
- new nsDOMMemoryFile((void*)imgData, imgSize, aName, type,
- GetDocument());
+ new nsDOMMemoryFile((void*)imgData, imgSize, aName, type);
return CallQueryInterface(file, aResult);
}