Bug 743615 - MainThreadWorkerStructuredCloneCallbacks should not call the WorkerStructuredCloneCallbacks variants. r=bent
authorBobby Holley <bobbyholley@gmail.com>
Tue, 24 Apr 2012 12:58:07 +0200
changeset 95509 ed667638551d653fab36990703ca55a61a373529
parent 95508 db555180be49430fec73cd0eca77091e8293c5c0
child 95510 da2791698bf8389bf3ab10327b5c70280f2bb69b
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs743615
milestone14.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 743615 - MainThreadWorkerStructuredCloneCallbacks should not call the WorkerStructuredCloneCallbacks variants. r=bent Doing so makes no sense. It seems like a no-op right now because we handle all the same cases first. But it's a hazard, and a problem for my upcoming patches.
dom/workers/WorkerPrivate.cpp
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -461,22 +461,16 @@ struct MainThreadWorkerStructuredCloneCa
           Error(aCx, DATA_CLONE_ERR);
           return nsnull;
         }
 
         return JSVAL_TO_OBJECT(wrappedBlob);
       }
     }
 
-    JSObject* clone =
-      WorkerStructuredCloneCallbacks::Read(aCx, aReader, aTag, aData, aClosure);
-    if (clone) {
-      return clone;
-    }
-
     JS_ClearPendingException(aCx);
     return NS_DOMReadStructuredClone(aCx, aReader, aTag, aData, nsnull);
   }
 
   static JSBool
   Write(JSContext* aCx, JSStructuredCloneWriter* aWriter, JSObject* aObj,
         void* aClosure)
   {
@@ -522,22 +516,16 @@ struct MainThreadWorkerStructuredCloneCa
               JS_WriteBytes(aWriter, &blobPtr, sizeof(blobPtr))) {
             clonedObjects->AppendElement(blob);
             return true;
           }
         }
       }
     }
 
-    JSBool ok =
-      WorkerStructuredCloneCallbacks::Write(aCx, aWriter, aObj, aClosure);
-    if (ok) {
-      return ok;
-    }
-
     JS_ClearPendingException(aCx);
     return NS_DOMWriteStructuredClone(aCx, aWriter, aObj, nsnull);
   }
 
   static void
   Error(JSContext* aCx, uint32_t aErrorId)
   {
     AssertIsOnMainThread();