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

andersca at apple.com andersca at apple.com
Wed Dec 22 17:51:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 62e55c531f696d98a333e93bb4fa31f537566971
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 1 20:12:50 2010 +0000

    Return a correct user agent if NPN_UserAgent is called with a null NPP from NPP_New.
    https://bugs.webkit.org/show_bug.cgi?id=50336
    
    Reviewed by Darin Adler.
    
    WebKit2:
    
    * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
    (WebKit::NPN_UserAgent):
    Call the static NetscapePlugin::userAgent function instead.
    
    * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
    (WebKit::NetscapePlugin::userAgent):
    If the passed in NPP is null, get the NetscapePlugin currently executing NPP_New.
    
    (WebKit::NetscapePlugin::initialize):
    Keep track of the plug-in currently executing NPP_New.
    
    * WebProcess/Plugins/Netscape/NetscapePlugin.h:
    
    WebKitTools:
    
    * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
    Add new test.
    
    * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
    (PluginTest::NPP_New):
    Add default implementation/
    
    * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
    * DumpRenderTree/TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp: Added.
    (GetUserAgentWithNullNPPFromNPPNew::GetUserAgentWithNullNPPFromNPPNew):
    (GetUserAgentWithNullNPPFromNPPNew::NPP_New):
    Get the user agent.
    
    * DumpRenderTree/TestNetscapePlugIn/main.cpp:
    (NPP_New):
    Call PluginTest::NPP_New.
    
    * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
    * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
    Add new files.
    
    * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
    (webkit_test_plugin_new_instance):
    Call PluginTest::NPP_New.
    
    LayoutTests:
    
    Add tests.
    
    * plugins/get-user-agent-with-null-npp-from-npp-new-expected.txt: Added.
    * plugins/get-user-agent-with-null-npp-from-npp-new.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73057 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6d2d007..7823aac 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-01  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Return a correct user agent if NPN_UserAgent is called with a null NPP from NPP_New.
+        https://bugs.webkit.org/show_bug.cgi?id=50336
+
+        Add tests.
+
+        * plugins/get-user-agent-with-null-npp-from-npp-new-expected.txt: Added.
+        * plugins/get-user-agent-with-null-npp-from-npp-new.html: Added.
+
 2010-12-01  Gavin Barraclough  <barraclough at apple.com>
 
         Rubber stamped by Sam Weinig.
diff --git a/LayoutTests/plugins/get-user-agent-with-null-npp-from-npp-new-expected.txt b/LayoutTests/plugins/get-user-agent-with-null-npp-from-npp-new-expected.txt
new file mode 100644
index 0000000..cb2af41
--- /dev/null
+++ b/LayoutTests/plugins/get-user-agent-with-null-npp-from-npp-new-expected.txt
@@ -0,0 +1,3 @@
+CONSOLE MESSAGE: line 0: PLUGIN: SUCCESS!
+
+This tests that we can get a user agent when calling NPN_UserAgent with a null NPP from NPP_New.
diff --git a/LayoutTests/plugins/get-user-agent-with-null-npp-from-npp-new.html b/LayoutTests/plugins/get-user-agent-with-null-npp-from-npp-new.html
new file mode 100644
index 0000000..64f5abc
--- /dev/null
+++ b/LayoutTests/plugins/get-user-agent-with-null-npp-from-npp-new.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script>
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+    </script>
+</head>
+<body>
+    <div>
+        <embed id=testPlugin type="application/x-webkit-test-netscape" test="get-user-agent-with-null-npp-from-npp-new"></embed>
+    </div>
+    <p>This tests that we can get a user agent when calling NPN_UserAgent with a null NPP from NPP_New.</p>
+</body>
+</html>
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 6d01249..97c16d5 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,23 @@
+2010-12-01  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Return a correct user agent if NPN_UserAgent is called with a null NPP from NPP_New.
+        https://bugs.webkit.org/show_bug.cgi?id=50336
+
+        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+        (WebKit::NPN_UserAgent):
+        Call the static NetscapePlugin::userAgent function instead.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::userAgent):
+        If the passed in NPP is null, get the NetscapePlugin currently executing NPP_New.
+
+        (WebKit::NetscapePlugin::initialize):
+        Keep track of the plug-in currently executing NPP_New.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+
 2010-12-01  Brian Weinstein  <bweinstein at apple.com>
 
         One last Windows build fix.
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
index 9703d25..bb59cb7 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
@@ -327,11 +327,7 @@ static void NPN_Status(NPP npp, const char* message)
     
 static const char* NPN_UserAgent(NPP npp)
 {
-    if (!npp)
-        return 0;
-    
-    RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
-    return plugin->userAgent();
+    return NetscapePlugin::userAgent(npp);
 }
 
 static void* NPN_MemAlloc(uint32_t size)
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
index 3910743..29095e6 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
@@ -40,6 +40,9 @@ using namespace std;
 
 namespace WebKit {
 
+// The plug-in that we're currently calling NPP_New for.
+static NetscapePlugin* currentNPPNewPlugin;
+    
 NetscapePlugin::NetscapePlugin(PassRefPtr<NetscapePluginModule> pluginModule)
     : m_pluginController(0)
     , m_nextRequestID(0)
@@ -101,6 +104,17 @@ void NetscapePlugin::invalidate(const NPRect* invalidRect)
     m_pluginController->invalidate(rect);
 }
 
+const char* NetscapePlugin::userAgent(NPP npp)
+{
+    if (npp)
+        return fromNPP(npp)->userAgent();
+
+    if (currentNPPNewPlugin)
+        return currentNPPNewPlugin->userAgent();
+
+    return 0;
+}
+
 const char* NetscapePlugin::userAgent()
 {
     if (m_userAgent.isNull()) {
@@ -358,7 +372,6 @@ bool NetscapePlugin::initialize(PluginController* pluginController, const Parame
     uint16_t mode = parameters.loadManually ? NP_FULL : NP_EMBED;
     
     m_loadManually = parameters.loadManually;
-    m_inNPPNew = true;
 
     CString mimeTypeCString = parameters.mimeType.utf8();
 
@@ -378,10 +391,17 @@ bool NetscapePlugin::initialize(PluginController* pluginController, const Parame
         names.append(paramNames[i].data());
         values.append(paramValues[i].data());
     }
+
+    NetscapePlugin* previousNPPNewPlugin = currentNPPNewPlugin;
     
+    m_inNPPNew = true;
+    currentNPPNewPlugin = this;
+
     NPError error = NPP_New(const_cast<char*>(mimeTypeCString.data()), mode, names.size(),
                             const_cast<char**>(names.data()), const_cast<char**>(values.data()), 0);
+
     m_inNPPNew = false;
+    currentNPPNewPlugin = previousNPPNewPlugin;
 
     if (error != NPERR_NO_ERROR)
         return false;
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
index fda5350..bafa3fa 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
@@ -64,7 +64,7 @@ public:
 #endif
 
     void invalidate(const NPRect*);
-    const char* userAgent();
+    static const char* userAgent(NPP);
     void loadURL(const String& method, const String& urlString, const String& target, const WebCore::HTTPHeaderMap& headerFields,
                  const Vector<uint8_t>& httpBody, bool sendNotification, void* notificationData);
     NPError destroyStream(NPStream*, NPReason);
@@ -110,6 +110,8 @@ private:
     void stopAllStreams();
     bool allowPopups() const;
 
+    const char* userAgent();
+
     bool platformPostInitialize();
     void platformDestroy();
     bool platformInvalidate(const WebCore::IntRect&);
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 5966923..65ff05f 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,35 @@
+2010-12-01  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Return a correct user agent if NPN_UserAgent is called with a null NPP from NPP_New.
+        https://bugs.webkit.org/show_bug.cgi?id=50336
+
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+        Add new test.
+
+        * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+        (PluginTest::NPP_New):
+        Add default implementation/
+
+        * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
+        * DumpRenderTree/TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp: Added.
+        (GetUserAgentWithNullNPPFromNPPNew::GetUserAgentWithNullNPPFromNPPNew):
+        (GetUserAgentWithNullNPPFromNPPNew::NPP_New):
+        Get the user agent.
+
+        * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+        (NPP_New):
+        Call PluginTest::NPP_New.
+
+        * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+        * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+        Add new files.
+
+        * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+        (webkit_test_plugin_new_instance):
+        Call PluginTest::NPP_New.
+
 2010-12-01  Kevin Ollivier  <kevino at theolliviers.com>
 
         [wx] Build fixes after recent trunk changes.
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
index b2eb8e9..34ff710 100644
--- a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
+++ b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
@@ -41,6 +41,7 @@
 		1AC6C84A0D07638600CD3161 /* PluginObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C7800D07589B00CD3161 /* PluginObject.cpp */; };
 		1AC6C84B0D07638600CD3161 /* TestObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C7810D07589B00CD3161 /* TestObject.cpp */; };
 		1AC77DCF120605B6005C19EF /* NPRuntimeRemoveProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */; };
+		1AD4CB2212A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD4CB2012A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp */; };
 		1AD9D2FE12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */; };
 		23BCB8900EA57623003C6289 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23BCB88F0EA57623003C6289 /* OpenGL.framework */; };
 		29CFBA10122736E600BC30C0 /* AccessibilityTextMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CFBA0E122736E600BC30C0 /* AccessibilityTextMarker.h */; };
@@ -209,6 +210,7 @@
 		1AC6C7800D07589B00CD3161 /* PluginObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginObject.cpp; sourceTree = "<group>"; };
 		1AC6C7810D07589B00CD3161 /* TestObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestObject.cpp; sourceTree = "<group>"; };
 		1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeRemoveProperty.cpp; sourceTree = "<group>"; };
+		1AD4CB2012A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetUserAgentWithNullNPPFromNPPNew.cpp; sourceTree = "<group>"; };
 		1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginScriptableNPObjectInvokeDefault.cpp; sourceTree = "<group>"; };
 		23BCB88F0EA57623003C6289 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
 		29CFBA0E122736E600BC30C0 /* AccessibilityTextMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTextMarker.h; sourceTree = "<group>"; };
@@ -465,6 +467,7 @@
 			children = (
 				1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */,
 				C0E720741281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp */,
+				1AD4CB2012A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp */,
 				1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */,
 				1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */,
 				C0EC3C9B12787F0500939164 /* NullNPPGetValuePointer.cpp */,
@@ -755,6 +758,7 @@
 				C06F9ABC1267A7060058E1F6 /* PassDifferentNPPStruct.cpp in Sources */,
 				C0EC3C9C12787F0500939164 /* NullNPPGetValuePointer.cpp in Sources */,
 				C0E720751281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp in Sources */,
+				1AD4CB2212A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
index 06c9953..703d9d5 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
@@ -50,6 +50,11 @@ PluginTest::~PluginTest()
 {
 }
 
+NPError PluginTest::NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved)
+{
+    return NPERR_NO_ERROR;
+}
+
 NPError PluginTest::NPP_Destroy(NPSavedData**)
 {
     return NPERR_NO_ERROR;
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
index ae9bd82..2c06079 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
@@ -55,6 +55,7 @@ public:
     virtual ~PluginTest();
 
     // NPP functions.
+    virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved);
     virtual NPError NPP_Destroy(NPSavedData**);
     virtual NPError NPP_DestroyStream(NPStream* stream, NPReason reason);
     virtual NPError NPP_GetValue(NPPVariable, void* value);
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp
new file mode 100644
index 0000000..7c536d1
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "PluginTest.h"
+
+#include "PluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// Trying to get the user agent with a null instance from NPP_New.
+
+class GetUserAgentWithNullNPPFromNPPNew : public PluginTest {
+public:
+    GetUserAgentWithNullNPPFromNPPNew(NPP npp, const string& identifier)
+        : PluginTest(npp, identifier)
+    {
+    }
+
+private:
+    virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved)
+    {
+        if (!browser->uagent(0))
+            pluginLog(m_npp, "FAILURE: Null user agent returned.");
+        else
+            pluginLog(m_npp, "SUCCESS!");
+
+        return NPERR_NO_ERROR;
+    }
+
+};
+
+static PluginTest::Register<GetUserAgentWithNullNPPFromNPPNew> getUserAgentWithNullNPPFromNPPNew("get-user-agent-with-null-npp-from-npp-new");
+
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
index 2110a8a..266b4b5 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
@@ -268,10 +268,10 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc
 
 #ifdef XP_UNIX
     // On Unix, plugins only get events if they are windowless.
-    return browser->setvalue(instance, NPPVpluginWindowBool, 0);
-#else
-    return NPERR_NO_ERROR;
+    browser->setvalue(instance, NPPVpluginWindowBool, 0);
 #endif
+
+    return obj->pluginTest->NPP_New(pluginType, mode, argc, argn, argv, saved);
 }
 
 NPError NPP_Destroy(NPP instance, NPSavedData **save)
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
index 347d66e..4464e2e 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
@@ -399,6 +399,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\Tests\GetUserAgentWithNullNPPFromNPPNew.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\Tests\NPRuntimeObjectFromDestroyedPlugin.cpp"
 				>
 			</File>
diff --git a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
index 1d460d7..de3cf6a 100644
--- a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
+++ b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
@@ -30,6 +30,7 @@ SOURCES = PluginObject.cpp \
           TestObject.cpp \
           Tests/DocumentOpenInDestroyStream.cpp \
           Tests/EvaluateJSAfterRemovingPluginElement.cpp \
+          Tests/GetUserAgentWithNullNPPFromNPPNew.cpp \
           Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \
           Tests/NPRuntimeRemoveProperty.cpp \
           Tests/NullNPPGetValuePointer.cpp \
diff --git a/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
index a4f7f04..2f7288a 100644
--- a/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
+++ b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
@@ -53,13 +53,13 @@ extern "C" {
 static void executeScript(const PluginObject* obj, const char* script);
 
 static NPError
-webkit_test_plugin_new_instance(NPMIMEType /*mimetype*/,
+webkit_test_plugin_new_instance(NPMIMEType mimetype,
                                 NPP instance,
-                                uint16_t /*mode*/,
+                                uint16_t mode,
                                 int16_t argc,
                                 char *argn[],
                                 char *argv[],
-                                NPSavedData* /*savedData*/)
+                                NPSavedData* savedData)
 {
     if (browser->version >= 14) {
         PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass());
@@ -100,6 +100,8 @@ webkit_test_plugin_new_instance(NPMIMEType /*mimetype*/,
         browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode);
 
         obj->pluginTest = PluginTest::create(instance, testIdentifier);
+
+        return obj->pluginTest->NPP_New(mimetype, mode, argc, argn, argv, savedData);
     }
 
     return NPERR_NO_ERROR;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list