[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
aroben at apple.com
aroben at apple.com
Wed Dec 22 14:48:38 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit a18eebbe7f29b6990856d59dd65fb38231c8ca28
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 20 23:39:37 2010 +0000
Don't require the plugin to always use the same NPP struct we gave it in NPP_New
Neither WebCore, nor WebKit/mac, nor Firefox requires this, and
Shockwave (at least) seems to use a different NPP struct that contains
the same ndata member. So we shouldn't enforce it, either.
Fixes <http://webkit.org/b/47690> <rdar://problem/8553020> Assertion
failure in NetscapePlugin::fromNPP when using Shockwave in WebKit2
Reviewed by John Sullivan.
WebKit2:
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::fromNPP): Removed the bogus assertion.
WebKitTools:
Test that passing a different NPP struct back to the browser doesn't
cause an assertion failure
* DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp: Copied from WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp.
(PassDifferentNPPStruct::PassDifferentNPPStruct): Initialize our
members.
(PassDifferentNPPStruct::NPP_SetWindow): Pass a different NPP to the
browser than the one it gave us in NPP_New and see if it works.
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
Added PassDifferentNPPStruct.
LayoutTests:
Test that passing a different NPP struct back to the browser doesn't
cause an assertion failure
* plugins/pass-different-npp-struct-expected.txt: Added.
* plugins/pass-different-npp-struct.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 97f6e9c..22484cc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-14 Adam Roben <aroben at apple.com>
+
+ Test that passing a different NPP struct back to the browser doesn't
+ cause an assertion failure
+
+ Test for <http://webkit.org/b/47690> <rdar://problem/8553020>
+ Assertion failure in NetscapePlugin::fromNPP when using Shockwave in
+ WebKit2
+
+ Reviewed by John Sullivan.
+
+ * plugins/pass-different-npp-struct-expected.txt: Added.
+ * plugins/pass-different-npp-struct.html: Added.
+
2010-10-20 Kenneth Russell <kbr at google.com>
Unreviewed, test expectations update.
diff --git a/LayoutTests/plugins/pass-different-npp-struct-expected.txt b/LayoutTests/plugins/pass-different-npp-struct-expected.txt
new file mode 100644
index 0000000..9693aea
--- /dev/null
+++ b/LayoutTests/plugins/pass-different-npp-struct-expected.txt
@@ -0,0 +1,3 @@
+CONSOLE MESSAGE: line 0: PLUGIN: NPN_GetValue(NPNVprivateModeBool) with a different NPP struct succeeded
+
+This tests that no assertions fire when a plugin passes a different NPP struct to one of the NPN* functions (specifically, NPN_GetValue).
diff --git a/LayoutTests/plugins/pass-different-npp-struct.html b/LayoutTests/plugins/pass-different-npp-struct.html
new file mode 100644
index 0000000..3869bd0
--- /dev/null
+++ b/LayoutTests/plugins/pass-different-npp-struct.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<body>
+<embed id="testPlugin"
+ type="application/x-webkit-test-netscape"
+ src="data:text/plain,"
+ test="pass-different-npp-struct">
+</embed>
+
+<div>
+ This tests that no assertions fire when a plugin passes a different NPP struct to one of the NPN* functions (specifically, NPN_GetValue).
+</div>
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+</body>
+</html>
+
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index b66f444..25b9452 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,20 @@
+2010-10-14 Adam Roben <aroben at apple.com>
+
+ Don't require the plugin to always use the same NPP struct we gave it
+ in NPP_New
+
+ Neither WebCore, nor WebKit/mac, nor Firefox requires this, and
+ Shockwave (at least) seems to use a different NPP struct that contains
+ the same ndata member. So we shouldn't enforce it, either.
+
+ Fixes <http://webkit.org/b/47690> <rdar://problem/8553020> Assertion
+ failure in NetscapePlugin::fromNPP when using Shockwave in WebKit2
+
+ Reviewed by John Sullivan.
+
+ * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+ (WebKit::NetscapePlugin::fromNPP): Removed the bogus assertion.
+
2010-10-20 Anders Carlsson <andersca at apple.com>
Fix clang++ build.
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
index c32e4a0..5e8b64f 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
@@ -77,12 +77,8 @@ NetscapePlugin::~NetscapePlugin()
PassRefPtr<NetscapePlugin> NetscapePlugin::fromNPP(NPP npp)
{
- if (npp) {
- NetscapePlugin* plugin = static_cast<NetscapePlugin*>(npp->ndata);
- ASSERT(npp == &plugin->m_npp);
-
- return plugin;
- }
+ if (npp)
+ return static_cast<NetscapePlugin*>(npp->ndata);
// FIXME: Return the current NetscapePlugin here.
ASSERT_NOT_REACHED();
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 745847e..f6bd350 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,24 @@
+2010-10-14 Adam Roben <aroben at apple.com>
+
+ Test that passing a different NPP struct back to the browser doesn't
+ cause an assertion failure
+
+ Test for <http://webkit.org/b/47690> <rdar://problem/8553020>
+ Assertion failure in NetscapePlugin::fromNPP when using Shockwave in
+ WebKit2
+
+ Reviewed by John Sullivan.
+
+ * DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp: Copied from WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp.
+ (PassDifferentNPPStruct::PassDifferentNPPStruct): Initialize our
+ members.
+ (PassDifferentNPPStruct::NPP_SetWindow): Pass a different NPP to the
+ browser than the one it gave us in NPP_New and see if it works.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ Added PassDifferentNPPStruct.
+
2010-10-19 Adam Roben <aroben at apple.com>
Gently nudge old-run-webkit-tests toward working with Win32 Perl
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
index acdac3d..51d8e7f 100644
--- a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
+++ b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
@@ -130,6 +130,7 @@
BCD08B3A0E1057EF00A7D0C1 /* AccessibilityController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */; };
BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */; };
BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF6C64F0C98E9C000AC063E /* GCController.cpp */; };
+ C06F9ABC1267A7060058E1F6 /* PassDifferentNPPStruct.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */; };
E1B7816511AF31B7007E1BC2 /* MockGeolocationProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */; };
E1B7816711AF31C3007E1BC2 /* MockGeolocationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */; };
/* End PBXBuildFile section */
@@ -302,6 +303,7 @@
BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityController.cpp; sourceTree = "<group>"; };
BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityControllerMac.mm; path = mac/AccessibilityControllerMac.mm; sourceTree = "<group>"; };
BCF6C64F0C98E9C000AC063E /* GCController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = GCController.cpp; sourceTree = "<group>"; };
+ C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PassDifferentNPPStruct.cpp; sourceTree = "<group>"; };
E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockGeolocationProvider.h; path = mac/MockGeolocationProvider.h; sourceTree = "<group>"; };
E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockGeolocationProvider.mm; path = mac/MockGeolocationProvider.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -457,6 +459,7 @@
1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */,
1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */,
1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */,
+ C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */,
1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */,
);
path = Tests;
@@ -733,6 +736,7 @@
1AD9D2FE12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp in Sources */,
1AC77DCF120605B6005C19EF /* NPRuntimeRemoveProperty.cpp in Sources */,
1A24BAA9120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp in Sources */,
+ C06F9ABC1267A7060058E1F6 /* PassDifferentNPPStruct.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp
new file mode 100644
index 0000000..e464996
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp
@@ -0,0 +1,70 @@
+/*
+ * 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 "PluginObject.h"
+
+using namespace std;
+
+// Passing a different NPP struct that has the same ndata value as the one passed to NPP_New should
+// not trigger an assertion failure.
+
+class PassDifferentNPPStruct : public PluginTest {
+public:
+ PassDifferentNPPStruct(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_didReceiveInitialSetWindowCall(false)
+ {
+ }
+
+private:
+ virtual NPError NPP_SetWindow(NPP instance, NPWindow* window)
+ {
+ if (m_didReceiveInitialSetWindowCall)
+ return NPERR_NO_ERROR;
+ m_didReceiveInitialSetWindowCall = true;
+
+ NPP oldNPP = m_npp;
+ NPP_t differentNPP = *m_npp;
+ m_npp = &differentNPP;
+
+ NPBool privateMode;
+ NPError error = NPN_GetValue(NPNVprivateModeBool, &privateMode);
+
+ m_npp = oldNPP;
+
+ if (error != NPERR_NO_ERROR) {
+ pluginLog(instance, "NPN_GetValue(NPNVprivateModeBool) with a different NPP struct failed with error %d", error);
+ return NPERR_GENERIC_ERROR;
+ }
+ pluginLog(instance, "NPN_GetValue(NPNVprivateModeBool) with a different NPP struct succeeded");
+ return NPERR_NO_ERROR;
+ }
+
+ bool m_didReceiveInitialSetWindowCall;
+};
+
+static PluginTest::Register<PassDifferentNPPStruct> getValueNetscapeWindow("pass-different-npp-struct");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
index 5444346..cdd7729 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
@@ -383,6 +383,10 @@
>
</File>
<File
+ RelativePath="..\Tests\PassDifferentNPPStruct.cpp"
+ >
+ </File>
+ <File
RelativePath="..\Tests\PluginScriptableNPObjectInvokeDefault.cpp"
>
</File>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list