Bug 1245927: Innerize before creating DOM files from the file picker. r=baku
authorKyle Huey <khuey@kylehuey.com>
Fri, 05 Feb 2016 10:12:25 -0800
changeset 321520 c7da16370d892fdae917a0a47346f047c3f632ea
parent 321519 a1ab5849594427f8b176ccd398bb1b07fa719593
child 321521 5aaf42e26bf1c2612bd4d16d8ab7bba275b45c9f
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1245927
milestone47.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 1245927: Innerize before creating DOM files from the file picker. r=baku
widget/nsBaseFilePicker.cpp
--- a/widget/nsBaseFilePicker.cpp
+++ b/widget/nsBaseFilePicker.cpp
@@ -342,17 +342,19 @@ nsBaseFilePicker::GetDomFileOrDirectory(
   nsresult rv = GetFile(getter_AddRefs(localFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!localFile) {
     *aValue = nullptr;
     return NS_OK;
   }
 
-  RefPtr<File> domFile = File::CreateFromFile(mParent, localFile);
+  auto* innerParent = mParent ? mParent->GetCurrentInnerWindow() : nullptr;
+
+  RefPtr<File> domFile = File::CreateFromFile(innerParent, localFile);
   domFile->Impl()->SetIsDirectory(mMode == nsIFilePicker::modeGetFolder);
   nsCOMPtr<nsIDOMBlob>(domFile).forget(aValue);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsBaseFilePicker::GetDomFileOrDirectoryEnumerator(nsISimpleEnumerator** aValue)
 {