Bug 1490165 - WorkerPrivate must set the CSPEventListener at any CSP internal object, r=ckerschb
authorAndrea Marchesini <amarchesini@mozilla.com>
Mon, 17 Sep 2018 17:53:10 +0200
changeset 436810 cc8df9e94e81b0dd6b9145469a84ff14ea1172e8
parent 436809 28025c893d7853142edd91840ea801b6f599b8be
child 436811 f628cd83dd097889d9cc2a7198196e930e6ae1aa
push id34660
push userbtara@mozilla.com
push dateMon, 17 Sep 2018 21:58:52 +0000
treeherdermozilla-central@87a95e1b7ec6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckerschb
bugs1490165
milestone64.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 1490165 - WorkerPrivate must set the CSPEventListener at any CSP internal object, r=ckerschb
dom/workers/WorkerPrivate.cpp
testing/web-platform/meta/content-security-policy/inside-worker/dedicated-script.html.ini
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3445,16 +3445,20 @@ WorkerPrivate::EnsureClientSource()
 bool
 WorkerPrivate::EnsureCSPEventListener()
 {
   mCSPEventListener = WorkerCSPEventListener::Create(this);
   if (NS_WARN_IF(!mCSPEventListener)) {
     return false;
   }
 
+  if (mLoadInfo.mCSP) {
+    mLoadInfo.mCSP->SetEventListener(mCSPEventListener);
+  }
+
   return true;
 }
 
 void
 WorkerPrivate::EnsurePerformanceStorage()
 {
   AssertIsOnWorkerThread();
 
--- a/testing/web-platform/meta/content-security-policy/inside-worker/dedicated-script.html.ini
+++ b/testing/web-platform/meta/content-security-policy/inside-worker/dedicated-script.html.ini
@@ -1,13 +1,9 @@
 [dedicated-script.html]
-  expected: ERROR
-  [`setTimeout([string\])` blocked in blob:]
-    expected: TIMEOUT
-
   [Cross-origin `importScripts()` blocked in http:]
     expected: FAIL
 
   [Cross-origin `importScripts()` blocked in http:?pipe=sub|header(Content-Security-Policy,script-src%20*)]
     expected: FAIL
 
   [Cross-origin `importScripts()` blocked in http:?pipe=sub|header(Content-Security-Policy,default-src%20*)]
     expected: FAIL