Bug 1196975 - part6: SDK Worker should not support CPOWs. r=mossop
authorGabor Krizsanits <gkrizsanits>
Fri, 09 Oct 2015 06:09:00 +0200
changeset 293026 528efd62f1c453b1739cadcc187be91d4fac07d0
parent 293025 955cf6de17ba4ab8ef23f17d1eb91dcd91f5e35d
child 293027 4657cb34d1e3e99e854f89cc033872fac6f22805
push id8824
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:18:56 +0000
treeherdermozilla-aurora@e2031358e2a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1196975
milestone45.0a1
Bug 1196975 - part6: SDK Worker should not support CPOWs. r=mossop
addon-sdk/source/lib/sdk/content/worker.js
--- a/addon-sdk/source/lib/sdk/content/worker.js
+++ b/addon-sdk/source/lib/sdk/content/worker.js
@@ -112,16 +112,21 @@ const Worker = Class({
 
   detach: method(detach),
   destroy: method(destroy),
 })
 exports.Worker = Worker;
 
 attach.define(Worker, function(worker, window) {
   // This method of attaching should be deprecated
+
+  if (Cu.isCrossProcessWrapper(window))
+    throw new Error("Attaching worker to a window from another " +
+                    "process directly is not supported.");
+
   let model = modelFor(worker);
   if (model.attached)
     detach(worker);
 
   model.window = window;
   let frame = null;
   let tab = getTabForContentWindowNoShim(window);
   if (tab)