+ // We can use a wrapper stored in a ScriptWrappable when we're in the main world.
+ // This method does the fast check if we're in the main world. If this method returns true,
+ // it is guaranteed that we're in the main world. On the other hand, if this method returns
+ // false, nothing is guaranteed (we might be in the main world).
+ template<typename T>
+ static bool canUseScriptWrappable(T* object)
+ {
+ return !DOMWrapperWorld::isolatedWorldsExist()
+ && !canExistInWorker(object)
+ && ScriptWrappable::wrapperCanBeStoredInObject(object);
+ }
+