Reviewed by Darin Adler.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2008 00:55:41 +0000 (00:55 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2008 00:55:41 +0000 (00:55 +0000)
        ASSERTION FAILED: JSLock::lockCount() > 0 when opening the
        Web Inspector on a page with a Database.

        Fix the ASSERT by taking a JSLock before calling toJS().

        * page/InspectorController.cpp:
        (WebCore::InspectorController::addDatabaseScriptResource):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/InspectorController.cpp

index 3b1ffff..05e8490 100644 (file)
@@ -1,3 +1,15 @@
+2008-01-30  Timothy Hatcher  <timothy@apple.com>
+
+        Reviewed by Darin Adler.
+
+        ASSERTION FAILED: JSLock::lockCount() > 0 when opening the
+        Web Inspector on a page with a Database.
+
+        Fix the ASSERT by taking a JSLock before calling toJS().
+
+        * page/InspectorController.cpp:
+        (WebCore::InspectorController::addDatabaseScriptResource):
+
 2008-01-30  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Darin.
index 5235723..5f791f2 100644 (file)
@@ -1175,7 +1175,12 @@ JSObjectRef InspectorController::addDatabaseScriptResource(InspectorDatabaseReso
     JSRetainPtr<JSStringRef> databaseString(Adopt, JSStringCreateWithUTF8CString("Database"));
     JSObjectRef databaseConstructor = JSValueToObject(m_scriptContext, JSObjectGetProperty(m_scriptContext, m_scriptObject, databaseString.get(), 0), 0);
 
-    JSValueRef database = toRef(toJS(toJS(m_scriptContext), resource->database.get()));
+    JSValueRef database;
+
+    {
+        KJS::JSLock lock;
+        database = toRef(toJS(toJS(m_scriptContext), resource->database.get()));
+    }
 
     JSRetainPtr<JSStringRef> domain(Adopt, JSStringCreateWithCharacters(resource->domain.characters(), resource->domain.length()));
     JSValueRef domainValue = JSValueMakeString(m_scriptContext, domain.get());