Created
January 14, 2016 18:50
-
-
Save ehsan/f763d1981af2239eb431 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py | |
index d33973d9..a1a229e 100644 | |
--- a/dom/bindings/Codegen.py | |
+++ b/dom/bindings/Codegen.py | |
@@ -3240,7 +3240,7 @@ class CGConstructorEnabled(CGAbstractMethod): | |
conditions = [] | |
iface = self.descriptor.interface | |
- if not iface.isExposedInWindow(): | |
+ if not iface.isExposedOnMainThread(): | |
exposedInWindowCheck = dedent( | |
""" | |
MOZ_ASSERT(!NS_IsMainThread(), "Why did we even get called?"); | |
@@ -3259,7 +3259,7 @@ class CGConstructorEnabled(CGAbstractMethod): | |
} | |
""", workerCondition=workerCondition.define()) | |
exposedInWorkerCheck = CGGeneric(exposedInWorkerCheck) | |
- if iface.isExposedInWindow(): | |
+ if iface.isExposedOnMainThread(): | |
exposedInWorkerCheck = CGIfWrapper(exposedInWorkerCheck, | |
"!NS_IsMainThread()") | |
body.append(exposedInWorkerCheck) | |
diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py | |
index e664988..a2a83ce 100644 | |
--- a/dom/bindings/parser/WebIDL.py | |
+++ b/dom/bindings/parser/WebIDL.py | |
@@ -501,6 +501,10 @@ class IDLExposureMixins(): | |
def isExposedInWindow(self): | |
return 'Window' in self.exposureSet | |
+ def isExposedOnMainThread(self): | |
+ return 'Window' in self.exposureSet or | |
+ 'System' in self.exposureSet | |
+ | |
def isExposedInAnyWorker(self): | |
return len(self.getWorkerExposureSet()) > 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment