Bug 795150 - Add DOMCallbacks to worker thread JSRuntimes. (r=bz)
authorEric Faust <efaustbmo@gmail.com>
Wed, 03 Oct 2012 12:32:06 -0400
changeset 109083 e9633e93b7e262a679e9c7d70e89d1f3b499fdb2
parent 109082 e36042dd4b25c8a34fd1784a47abf00a0a18d70b
child 109084 eff426a003e17ee569060ea7b6bea027165669f3
push id23609
push userryanvm@gmail.com
push dateThu, 04 Oct 2012 01:43:15 +0000
treeherdermozilla-central@ae646840907e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs795150
milestone18.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 795150 - Add DOMCallbacks to worker thread JSRuntimes. (r=bz)
dom/workers/RuntimeService.cpp
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -397,16 +397,22 @@ CreateJSContextForWorker(WorkerPrivate* 
 
   // Security policy:
   static JSSecurityCallbacks securityCallbacks = {
     NULL,
     ContentSecurityPolicyAllows
   };
   JS_SetSecurityCallbacks(runtime, &securityCallbacks);
 
+  // DOM helpers:
+  static js::DOMCallbacks DOMCallbacks = {
+    InstanceClassHasProtoAtDepth
+  };
+  SetDOMCallbacks(runtime, &DOMCallbacks);
+
   JSContext* workerCx = JS_NewContext(runtime, 0);
   if (!workerCx) {
     JS_DestroyRuntime(runtime);
     NS_WARNING("Could not create new context!");
     return nullptr;
   }
 
   JS_SetContextPrivate(workerCx, aWorkerPrivate);