[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tony at chromium.org tony at chromium.org
Wed Dec 22 15:34:32 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2bfc876de33e00bc3f288de3156b8017896d31c1
Author: tony at chromium.org <tony at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 8 17:56:42 2010 +0000

    2010-11-08  Tony Chang  <tony at chromium.org>
    
            Reviewed by Adam Barth.
    
            run platform/chromium/plugins/nested-plugin-objects.html on all platforms
            https://bugs.webkit.org/show_bug.cgi?id=49094
    
            * plugins/nested-plugin-objects-expected.txt: Renamed from LayoutTests/platform/chromium/plugins/nested-plugin-objects-expected.txt.
            * plugins/nested-plugin-objects.html: Renamed from LayoutTests/platform/chromium/plugins/nested-plugin-objects.html.
    2010-11-08  Tony Chang  <tony at chromium.org>
    
            Reviewed by Adam Barth.
    
            run platform/chromium/plugins/nested-plugin-objects.html on all platforms
            https://bugs.webkit.org/show_bug.cgi?id=49094
    
            This tests that objects created by plugins are proplery cleaned up.
    
            * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
            (testPassTestObject):
            (pluginInvoke):
            * DumpRenderTree/TestNetscapePlugIn/TestObject.cpp:
            (testAllocate):
            (testDeallocate):
            (testGetProperty):
            (testConstruct):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71537 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 0871833..216d83c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-08  Tony Chang  <tony at chromium.org>
+
+        Reviewed by Adam Barth.
+
+        run platform/chromium/plugins/nested-plugin-objects.html on all platforms
+        https://bugs.webkit.org/show_bug.cgi?id=49094
+
+        * plugins/nested-plugin-objects-expected.txt: Renamed from LayoutTests/platform/chromium/plugins/nested-plugin-objects-expected.txt.
+        * plugins/nested-plugin-objects.html: Renamed from LayoutTests/platform/chromium/plugins/nested-plugin-objects.html.
+
 2010-11-08  Adam Roben  <aroben at apple.com>
 
         Add a sometimes-failing test to the Windows Skipped file
diff --git a/LayoutTests/platform/chromium/plugins/nested-plugin-objects-expected.txt b/LayoutTests/plugins/nested-plugin-objects-expected.txt
similarity index 100%
rename from LayoutTests/platform/chromium/plugins/nested-plugin-objects-expected.txt
rename to LayoutTests/plugins/nested-plugin-objects-expected.txt
diff --git a/LayoutTests/platform/chromium/plugins/nested-plugin-objects.html b/LayoutTests/plugins/nested-plugin-objects.html
similarity index 100%
rename from LayoutTests/platform/chromium/plugins/nested-plugin-objects.html
rename to LayoutTests/plugins/nested-plugin-objects.html
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 0bdf2e3..6aef1cd 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,21 @@
+2010-11-08  Tony Chang  <tony at chromium.org>
+
+        Reviewed by Adam Barth.
+
+        run platform/chromium/plugins/nested-plugin-objects.html on all platforms
+        https://bugs.webkit.org/show_bug.cgi?id=49094
+
+        This tests that objects created by plugins are proplery cleaned up.
+
+        * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+        (testPassTestObject):
+        (pluginInvoke):
+        * DumpRenderTree/TestNetscapePlugIn/TestObject.cpp:
+        (testAllocate):
+        (testDeallocate):
+        (testGetProperty):
+        (testConstruct):
+
 2010-11-08  Adam Roben  <aroben at apple.com>
 
         Mark Windows builds triggered from Perl as being non-interactive
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
index e58152e..7f1c4b4 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
@@ -176,6 +176,7 @@ enum {
     ID_TEST_GET_PROPERTY_RETURN_VALUE,
     ID_TEST_IDENTIFIER_TO_STRING,
     ID_TEST_IDENTIFIER_TO_INT,
+    ID_TEST_PASS_TEST_OBJECT,
     ID_TEST_POSTURL_FILE,
     ID_TEST_CONSTRUCT,
     ID_TEST_THROW_EXCEPTION_METHOD,
@@ -212,6 +213,7 @@ static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = {
     "testGetPropertyReturnValue",
     "testIdentifierToString",
     "testIdentifierToInt",
+    "testPassTestObject",
     "testPostURLFile",
     "testConstruct",
     "testThrowException",
@@ -439,6 +441,26 @@ static bool testIdentifierToInt(PluginObject*, const NPVariant* args, uint32_t a
     return true;
 }
 
+static bool testPassTestObject(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+    if (argCount != 2 || !NPVARIANT_IS_STRING(args[0]))
+        return false;
+
+    NPObject* windowScriptObject;
+    browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject);
+
+    NPUTF8* callbackString = createCStringFromNPVariant(&args[0]);
+    NPIdentifier callbackIdentifier = browser->getstringidentifier(callbackString);
+    free(callbackString);
+
+    NPVariant browserResult;
+    browser->invoke(obj->npp, windowScriptObject, callbackIdentifier, &args[1], 1, &browserResult);
+    browser->releasevariantvalue(&browserResult);
+
+    VOID_TO_NPVARIANT(*result);
+    return true;
+}
+
 static bool testCallback(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
 {
     if (!argCount || !NPVARIANT_IS_STRING(args[0]))
@@ -900,6 +922,8 @@ static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* a
         return testIdentifierToString(plugin, args, argCount, result);
     if (name == pluginMethodIdentifiers[ID_TEST_IDENTIFIER_TO_INT])
         return testIdentifierToInt(plugin, args, argCount, result);
+    if (name == pluginMethodIdentifiers[ID_TEST_PASS_TEST_OBJECT])
+        return testPassTestObject(plugin, args, argCount, result);
     if (name == pluginMethodIdentifiers[ID_TEST_POSTURL_FILE])
         return testPostURLFile(plugin, args, argCount, result);
     if (name == pluginMethodIdentifiers[ID_TEST_CONSTRUCT])
@@ -914,7 +938,7 @@ static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* a
         browser->invoke(plugin->npp, windowScriptObject, name, args, argCount, result);
         return false;
     }
-    if (name == pluginMethodIdentifiers[ID_DESTROY_NULL_STREAM]) 
+    if (name == pluginMethodIdentifiers[ID_DESTROY_NULL_STREAM])
         return destroyNullStream(plugin, args, argCount, result);
     if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_NO_PAGES]) {
         browser->reloadplugins(false);
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp
index ce9f73e..8946c0e 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp
@@ -59,6 +59,11 @@ NPClass *getTestClass(void)
     return &testClass;
 }
 
+typedef struct {
+    NPObject header;
+    NPObject* testObject;
+} TestObject;
+
 static bool identifiersInitialized = false;
 
 #define NUM_ENUMERATABLE_TEST_IDENTIFIERS 2
@@ -67,6 +72,7 @@ enum {
     ID_PROPERTY_FOO = 0,
     ID_PROPERTY_BAR,
     ID_PROPERTY_OBJECT_POINTER,
+    ID_PROPERTY_TEST_OBJECT,
     NUM_TEST_IDENTIFIERS,
 };
 
@@ -75,6 +81,7 @@ static const NPUTF8 *testIdentifierNames[NUM_TEST_IDENTIFIERS] = {
     "foo",
     "bar",
     "objectPointer",
+    "testObject",
 };
 
 #define ID_THROW_EXCEPTION_METHOD   0
@@ -91,20 +98,24 @@ static void initializeIdentifiers(void)
     browser->getstringidentifiers(testMethodIdentifierNames, NUM_METHOD_IDENTIFIERS, testMethodIdentifiers);
 }
 
-static NPObject *testAllocate(NPP /*npp*/, NPClass* /*theClass*/)
+static NPObject* testAllocate(NPP /*npp*/, NPClass* /*theClass*/)
 {
-    NPObject *newInstance = static_cast<NPObject*>(malloc(sizeof(NPObject)));
-    
+    TestObject* newInstance = static_cast<TestObject*>(malloc(sizeof(TestObject)));
+    newInstance->testObject = 0;
+
     if (!identifiersInitialized) {
         identifiersInitialized = true;
         initializeIdentifiers();
     }
-    
-    return newInstance;
+
+    return reinterpret_cast<NPObject*>(newInstance);
 }
 
 static void testDeallocate(NPObject *obj) 
 {
+    TestObject* testObject = reinterpret_cast<TestObject*>(obj);
+    if (testObject->testObject)
+        browser->releaseobject(testObject->testObject);
     free(obj);
 }
 
@@ -150,11 +161,18 @@ static bool testGetProperty(NPObject* npobj, NPIdentifier name, NPVariant* resul
         INT32_TO_NPVARIANT(objectPointer, *result);
         return true;
     }
+    if (name == testIdentifiers[ID_PROPERTY_TEST_OBJECT]) {
+        TestObject* testObject = reinterpret_cast<TestObject*>(npobj);
+        if (!testObject->testObject)
+            testObject->testObject = browser->createobject(0, &testClass);
+        browser->retainobject(testObject->testObject);
+        OBJECT_TO_NPVARIANT(testObject->testObject, *result);
+        return true;
+    }
     
     return false;
 }
 
-
 static bool testEnumerate(NPObject* /*npobj*/, NPIdentifier **value, uint32_t *count)
 {
     *count = NUM_ENUMERATABLE_TEST_IDENTIFIERS;
@@ -173,5 +191,3 @@ static bool testConstruct(NPObject* npobj, const NPVariant* /*args*/, uint32_t /
     OBJECT_TO_NPVARIANT(npobj, *result);
     return true;
 }
-
-

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list