Backed out changeset ac697e112134 (bug 1105468) for m5 test failures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 10 Dec 2014 11:44:24 +0100
changeset 219068 28545193d61d93069c37816dbfd7a8b1eb441641
parent 219067 173bf96bed724c07e7be57d17c3611c2eea236f5
child 219069 6bfaf3bde1a00cc8e5d02b406c2dd1d8af8052bf
push id27954
push userryanvm@gmail.com
push dateWed, 10 Dec 2014 21:10:24 +0000
treeherdermozilla-central@0cf461e62ce5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1105468
milestone37.0a1
backs outac697e1121348618643867a0a6196b7a6c6f2912
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 ac697e112134 (bug 1105468) for m5 test failures
dom/ipc/TabParent.cpp
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -113,17 +113,16 @@ public:
 
         nsresult rv = mEventTarget->Dispatch(this, NS_DISPATCH_NORMAL);
         NS_ENSURE_SUCCESS_VOID(rv);
     }
 
 private:
     ~OpenFileAndSendFDRunnable()
     {
-        MOZ_ASSERT(NS_IsMainThread());
         MOZ_ASSERT(!mFD);
     }
 
     // This shouldn't be called directly except by the event loop. Use Dispatch
     // to start the sequence.
     NS_IMETHOD Run()
     {
         if (NS_IsMainThread()) {
@@ -166,46 +165,34 @@ private:
             NS_WARNING("Failed to dispatch to stream transport service!");
 
             // It's probably safer to take the main thread IO hit here rather
             // than leak a file descriptor.
             CloseFile();
         }
     }
 
-    // Helper method to avoid gnarly control flow for failures.
-    void OpenFileImpl()
+    void OpenFile()
     {
         MOZ_ASSERT(!NS_IsMainThread());
         MOZ_ASSERT(!mFD);
 
         nsCOMPtr<nsIFile> file;
         nsresult rv = NS_NewLocalFile(mPath, false, getter_AddRefs(file));
         NS_ENSURE_SUCCESS_VOID(rv);
 
         PRFileDesc* fd;
         rv = file->OpenNSPRFileDesc(PR_RDONLY, 0, &fd);
         NS_ENSURE_SUCCESS_VOID(rv);
 
         mFD = fd;
-    }
-
-    void OpenFile()
-    {
-        MOZ_ASSERT(!NS_IsMainThread());
-
-        OpenFileImpl();
 
         if (NS_FAILED(NS_DispatchToMainThread(this))) {
             NS_WARNING("Failed to dispatch to main thread!");
 
-            // Intentionally leak the runnable (but not the fd) rather
-            // than crash when trying to release a main thread object
-            // off the main thread.
-            NS_ADDREF(this);
             CloseFile();
         }
     }
 
     void CloseFile()
     {
         // It's possible for this to happen on the main thread if the dispatch
         // to the stream service fails after we've already opened the file so