<rdar://problem/7879485> Leopard: Crash after opening Software Update dialog
[WebKit-https.git] / JavaScriptGlue / JSUtils.h
index 3f2ee8c..cbd9912 100644 (file)
@@ -32,8 +32,9 @@
 #include "JavaScriptGlue.h"
 
 #include <JavaScriptCore/Collector.h>
-#include <JavaScriptCore/Completion.h>
 #include <JavaScriptCore/JSValue.h>
+#include <JavaScriptCore/Completion.h>
+#include <JavaScriptCore/Identifier.h>
 #include <JavaScriptCore/JSLock.h>
 #include <JavaScriptCore/JSObject.h>
 #include <JavaScriptCore/JSGlobalObject.h>
@@ -54,9 +55,9 @@ UString CFStringToUString(CFStringRef inCFString);
 CFStringRef UStringToCFString(const UString& inUString);
 Identifier CFStringToIdentifier(CFStringRef inCFString, ExecState*);
 CFStringRef IdentifierToCFString(const Identifier& inIdentifier);
-JSUserObject *KJSValueToJSObject(JSValue* inValue, ExecState *exec);
-CFTypeRef KJSValueToCFType(JSValue* inValue, ExecState *exec);
-JSValue* JSObjectKJSValue(JSUserObject* ptr);
+JSUserObject *KJSValueToJSObject(JSValue inValue, ExecState *exec);
+CFTypeRef KJSValueToCFType(JSValue inValue, ExecState *exec);
+JSValue JSObjectKJSValue(JSUserObject* ptr);
 CFTypeRef GetCFNull(void);
 
 inline CFTypeRef RetainCFType(CFTypeRef x) { if (x) x = CFRetain(x); return x; }
@@ -76,5 +77,24 @@ enum {
     kJSUserObjectDataTypeCFType
 };
 
+class JSGlueAPIEntry {
+public:
+    JSGlueAPIEntry();
+    JSGlueAPIEntry(JSGlobalObject*); // For use when it's not safe for JSGlueAPIEntry() to call getThreadGlobalObject() -- for example, from a thread-specific data destructor.
+    ~JSGlueAPIEntry();
+
+private:
+    JSLock m_lock;
+    IdentifierTable* m_storedIdentifierTable;
+};
+
+class JSGlueAPICallback {
+public:
+    JSGlueAPICallback(ExecState*);
+    ~JSGlueAPICallback();
+
+private:
+    JSLock::DropAllLocks m_dropLocks;
+};
 
 #endif