Gate performance.profile behind COOP/COEP

Requires strict cross origin isolation for the JS Self-Profiling API.

Bug: 956688
Change-Id: I63e2bd9b51c264f7fc1bc0844ab0c0d0bc40829d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2441533
Commit-Queue: Andrew Comminos <acomminos@fb.com>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814414}
diff --git a/js-self-profiling/__dir__.headers b/js-self-profiling/__dir__.headers
new file mode 100644
index 0000000..63b60e4
--- /dev/null
+++ b/js-self-profiling/__dir__.headers
@@ -0,0 +1,2 @@
+Cross-Origin-Opener-Policy: same-origin
+Cross-Origin-Embedder-Policy: require-corp
diff --git a/js-self-profiling/idlharness.any.js b/js-self-profiling/idlharness.any.js
deleted file mode 100644
index bbf38ed..0000000
--- a/js-self-profiling/idlharness.any.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// META: script=/resources/WebIDLParser.js
-// META: script=/resources/idlharness.js
-
-'use strict';
-
-idl_test(
-  ['js-self-profiling'],
-  ['hr-time', 'dom'],
-  async idl_array => {
-    idl_array.add_objects({
-      Performance: ['performance'],
-      Profiler: ['profiler'],
-    });
-
-    self.profiler = await performance.profile({
-      sampleInterval: 1,
-    });
-  }
-);
diff --git a/js-self-profiling/idlharness.https.html b/js-self-profiling/idlharness.https.html
new file mode 100644
index 0000000..0b6aa6c
--- /dev/null
+++ b/js-self-profiling/idlharness.https.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<meta charset=utf-8>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+<body>
+  <script>
+    'use strict';
+
+    idl_test(
+          ['js-self-profiling'],
+          ['hr-time', 'dom'],
+          async idl_array => {
+                idl_array.add_objects({
+                      Performance: ['performance'],
+                      Profiler: ['profiler'],
+                    });
+
+                self.profiler = await performance.profile({
+                      sampleInterval: 1,
+                    });
+              }
+        );
+  </script>