Backed out changeset 1a2c37d55e5e (bug 949666) for m-9 test failures in B2G ICS Emulator debug
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 10 Nov 2014 08:10:30 +0100
changeset 239119 0da722f1ddadae22f43b24ec7049055e104de000
parent 239118 ede99651d08916849d4b28ef3b4c51c09787d7a1
child 239120 cf287850e17c3cb5f1500f963c83b19468167dea
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs949666
milestone36.0a1
backs out1a2c37d55e5e7356bb91789ba8fe7af104fed7ee
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
Backed out changeset 1a2c37d55e5e (bug 949666) for m-9 test failures in B2G ICS Emulator debug
dom/html/HTMLInputElement.cpp
dom/ipc/FilePickerParent.cpp
dom/ipc/FilePickerParent.h
dom/ipc/PFilePicker.ipdl
widget/nsFilePickerProxy.cpp
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -1025,16 +1025,22 @@ UploadLastDir::FetchDirectoryAndDisplayP
 
   nsIURI* docURI = aDoc->GetDocumentURI();
   NS_PRECONDITION(docURI, "docURI is null");
 
   nsCOMPtr<nsILoadContext> loadContext = aDoc->GetLoadContext();
   nsCOMPtr<nsIContentPrefCallback2> prefCallback = 
     new UploadLastDir::ContentPrefCallback(aFilePicker, aFpCallback);
 
+  if (XRE_GetProcessType() == GeckoProcessType_Content) {
+    // FIXME (bug 949666): Run this code in the parent process.
+    prefCallback->HandleCompletion(nsIContentPrefCallback2::COMPLETE_ERROR);
+    return NS_OK;
+  }
+
   // Attempt to get the CPS, if it's not present we'll fallback to use the Desktop folder
   nsCOMPtr<nsIContentPrefService2> contentPrefService =
     do_GetService(NS_CONTENT_PREF_SERVICE_CONTRACTID);
   if (!contentPrefService) {
     prefCallback->HandleCompletion(nsIContentPrefCallback2::COMPLETE_ERROR);
     return NS_OK;
   }
 
@@ -1049,16 +1055,21 @@ UploadLastDir::FetchDirectoryAndDisplayP
 nsresult
 UploadLastDir::StoreLastUsedDirectory(nsIDocument* aDoc, nsIFile* aDir)
 {
   NS_PRECONDITION(aDoc, "aDoc is null");
   if (!aDir) {
     return NS_OK;
   }
 
+  if (XRE_GetProcessType() == GeckoProcessType_Content) {
+    // FIXME (bug 949666): Run this code in the parent process.
+    return NS_OK;
+  }
+
   nsCOMPtr<nsIURI> docURI = aDoc->GetDocumentURI();
   NS_PRECONDITION(docURI, "docURI is null");
 
   // Attempt to get the CPS, if it's not present we'll just return
   nsCOMPtr<nsIContentPrefService2> contentPrefService =
     do_GetService(NS_CONTENT_PREF_SERVICE_CONTRACTID);
   if (!contentPrefService)
     return NS_ERROR_NOT_AVAILABLE;
--- a/dom/ipc/FilePickerParent.cpp
+++ b/dom/ipc/FilePickerParent.cpp
@@ -197,42 +197,33 @@ FilePickerParent::CreateFilePicker()
 }
 
 bool
 FilePickerParent::RecvOpen(const int16_t& aSelectedType,
                            const bool& aAddToRecentDocs,
                            const nsString& aDefaultFile,
                            const nsString& aDefaultExtension,
                            const InfallibleTArray<nsString>& aFilters,
-                           const InfallibleTArray<nsString>& aFilterNames,
-                           const nsString& aDisplayDirectory)
+                           const InfallibleTArray<nsString>& aFilterNames)
 {
   if (!CreateFilePicker()) {
     unused << Send__delete__(this, void_t(), nsIFilePicker::returnCancel);
     return true;
   }
 
   mFilePicker->SetAddToRecentDocs(aAddToRecentDocs);
 
   for (uint32_t i = 0; i < aFilters.Length(); ++i) {
     mFilePicker->AppendFilter(aFilterNames[i], aFilters[i]);
   }
 
   mFilePicker->SetDefaultString(aDefaultFile);
   mFilePicker->SetDefaultExtension(aDefaultExtension);
   mFilePicker->SetFilterIndex(aSelectedType);
 
-  if (!aDisplayDirectory.IsEmpty()) {
-    nsCOMPtr<nsIFile> localFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
-    if (localFile) {
-      localFile->InitWithPath(aDisplayDirectory);
-      mFilePicker->SetDisplayDirectory(localFile);
-    }
-  }
-
   mCallback = new FilePickerShownCallback(this);
 
   mFilePicker->Open(mCallback);
   return true;
 }
 
 void
 FilePickerParent::ActorDestroy(ActorDestroyReason aWhy)
--- a/dom/ipc/FilePickerParent.h
+++ b/dom/ipc/FilePickerParent.h
@@ -31,18 +31,17 @@ class FilePickerParent : public PFilePic
   void Done(int16_t aResult);
   void SendFiles(const nsCOMArray<nsIDOMFile>& aDomfiles);
 
   virtual bool RecvOpen(const int16_t& aSelectedType,
                         const bool& aAddToRecentDocs,
                         const nsString& aDefaultFile,
                         const nsString& aDefaultExtension,
                         const InfallibleTArray<nsString>& aFilters,
-                        const InfallibleTArray<nsString>& aFilterNames,
-                        const nsString& aDisplayDirectory) MOZ_OVERRIDE;
+                        const InfallibleTArray<nsString>& aFilterNames) MOZ_OVERRIDE;
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
   class FilePickerShownCallback : public nsIFilePickerShownCallback
   {
   public:
     explicit FilePickerShownCallback(FilePickerParent* aFilePickerParent)
       : mFilePickerParent(aFilePickerParent)
--- a/dom/ipc/PFilePicker.ipdl
+++ b/dom/ipc/PFilePicker.ipdl
@@ -24,17 +24,16 @@ union MaybeInputFiles
 };
 
 protocol PFilePicker
 {
   manager PBrowser;
 
 parent:
     Open(int16_t selectedType, bool addToRecentDocs, nsString defaultFile,
-         nsString defaultExtension, nsString[] filters, nsString[] filterNames,
-         nsString displayDirectory);
+         nsString defaultExtension, nsString[] filters, nsString[] filterNames);
 
 child:
     __delete__(MaybeInputFiles files, int16_t result);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/widget/nsFilePickerProxy.cpp
+++ b/widget/nsFilePickerProxy.cpp
@@ -131,23 +131,18 @@ nsFilePickerProxy::Show(int16_t* aReturn
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsFilePickerProxy::Open(nsIFilePickerShownCallback* aCallback)
 {
   mCallback = aCallback;
 
-  nsString displayDirectory;
-  if (mDisplayDirectory) {
-    mDisplayDirectory->GetPath(displayDirectory);
-  }
-
-  SendOpen(mSelectedType, mAddToRecentDocs, mDefault, mDefaultExtension,
-           mFilters, mFilterNames, displayDirectory);
+  SendOpen(mSelectedType, mAddToRecentDocs, mDefault,
+           mDefaultExtension, mFilters, mFilterNames);
 
   return NS_OK;
 }
 
 bool
 nsFilePickerProxy::Recv__delete__(const MaybeInputFiles& aFiles,
                                   const int16_t& aResult)
 {