Title: [108281] trunk
Revision
108281
Author
commit-qu...@webkit.org
Date
2012-02-20 18:19:35 -0800 (Mon, 20 Feb 2012)

Log Message

[UNIX] Plugin information fields are not interpreted as UTF-8
https://bugs.webkit.org/show_bug.cgi?id=78635

Patch by Martin Robinson <mrobin...@igalia.com> on 2012-02-20
Reviewed by Gustavo Noronha Silva.

Source/WebCore:

Interpret plugin metadata as UTF8 aways. This matches the behavior
of Chromium and the Totem plugin.

This is tested by a change to TestNetscapePlugin and expectations updates.

* plugins/efl/PluginPackageEfl.cpp:
(WebCore::PluginPackage::fetchInfo): Use String::fromUTF8.
* plugins/gtk/PluginPackageGtk.cpp:
(WebCore::PluginPackage::fetchInfo): Use String::fromUTF8.
* plugins/qt/PluginPackageQt.cpp:
(WebCore::PluginPackage::fetchInfo): Use String::fromUTF8.

Source/WebKit2:

Interpret plugin metadata as UTF8 aways. This matches the behavior
of Chromium and the Totem plugin.

* Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
(WebKit::NetscapePluginModule::getPluginInfoForLoadedPlugin): Use String::fromUTF8.

Tools:

Interpret plugin metadata as UTF8 aways. This matches the behavior
of Chromium and the Totem plugin.

* DumpRenderTree/TestNetscapePlugIn/main.cpp:
(NPP_GetValue): Include a UTF-8 character in the description string for testing purposes.

LayoutTests:

Update expectations to match the fact that TestNetscapePlugin is now
returning a Unicode character in the description field.

* platform/chromium-linux/plugins/plugin-_javascript_-access-expected.txt:
* platform/gtk/plugins/plugin-_javascript_-access-expected.txt:
* platform/qt/plugins/plugin-_javascript_-access-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (108280 => 108281)


--- trunk/LayoutTests/ChangeLog	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/LayoutTests/ChangeLog	2012-02-21 02:19:35 UTC (rev 108281)
@@ -1,3 +1,17 @@
+2012-02-20  Martin Robinson  <mrobin...@igalia.com>
+
+        [UNIX] Plugin information fields are not interpreted as UTF-8
+        https://bugs.webkit.org/show_bug.cgi?id=78635
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Update expectations to match the fact that TestNetscapePlugin is now
+        returning a Unicode character in the description field.
+
+        * platform/chromium-linux/plugins/plugin-_javascript_-access-expected.txt:
+        * platform/gtk/plugins/plugin-_javascript_-access-expected.txt:
+        * platform/qt/plugins/plugin-_javascript_-access-expected.txt:
+
 2012-02-20  Kihong Kwon  <kihong.k...@samsung.com>
 
         Add a new test case for the Vibration API.

Modified: trunk/LayoutTests/platform/chromium-linux/plugins/plugin-_javascript_-access-expected.txt (108280 => 108281)


--- trunk/LayoutTests/platform/chromium-linux/plugins/plugin-_javascript_-access-expected.txt	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/LayoutTests/platform/chromium-linux/plugins/plugin-_javascript_-access-expected.txt	2012-02-21 02:19:35 UTC (rev 108281)
@@ -1,6 +1,6 @@
 Name: WebKit Test PlugIn
 
-Description: Simple Netscape plug-in that handles test content for WebKit
+Description: Simple Netscape® plug-in that handles test content for WebKit
 
 Filename: libTestNetscapePlugIn.so
 

Modified: trunk/LayoutTests/platform/gtk/plugins/plugin-_javascript_-access-expected.txt (108280 => 108281)


--- trunk/LayoutTests/platform/gtk/plugins/plugin-_javascript_-access-expected.txt	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/LayoutTests/platform/gtk/plugins/plugin-_javascript_-access-expected.txt	2012-02-21 02:19:35 UTC (rev 108281)
@@ -1,6 +1,6 @@
 Name: WebKit Test PlugIn
 
-Description: Simple Netscape plug-in that handles test content for WebKit
+Description: Simple Netscape® plug-in that handles test content for WebKit
 
 Filename: libtestnetscapeplugin.so
 

Modified: trunk/LayoutTests/platform/qt/plugins/plugin-_javascript_-access-expected.txt (108280 => 108281)


--- trunk/LayoutTests/platform/qt/plugins/plugin-_javascript_-access-expected.txt	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/LayoutTests/platform/qt/plugins/plugin-_javascript_-access-expected.txt	2012-02-21 02:19:35 UTC (rev 108281)
@@ -1,6 +1,6 @@
 Name: WebKit Test PlugIn
 
-Description: Simple Netscape plug-in that handles test content for WebKit
+Description: Simple Netscape® plug-in that handles test content for WebKit
 
 Filename: libTestNetscapePlugIn.so
 

Modified: trunk/Source/WebCore/ChangeLog (108280 => 108281)


--- trunk/Source/WebCore/ChangeLog	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/Source/WebCore/ChangeLog	2012-02-21 02:19:35 UTC (rev 108281)
@@ -1,5 +1,24 @@
 2012-02-20  Martin Robinson  <mrobin...@igalia.com>
 
+        [UNIX] Plugin information fields are not interpreted as UTF-8
+        https://bugs.webkit.org/show_bug.cgi?id=78635
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Interpret plugin metadata as UTF8 aways. This matches the behavior
+        of Chromium and the Totem plugin.
+
+        This is tested by a change to TestNetscapePlugin and expectations updates.
+
+        * plugins/efl/PluginPackageEfl.cpp:
+        (WebCore::PluginPackage::fetchInfo): Use String::fromUTF8.
+        * plugins/gtk/PluginPackageGtk.cpp:
+        (WebCore::PluginPackage::fetchInfo): Use String::fromUTF8.
+        * plugins/qt/PluginPackageQt.cpp:
+        (WebCore::PluginPackage::fetchInfo): Use String::fromUTF8.
+
+2012-02-20  Martin Robinson  <mrobin...@igalia.com>
+
         [GTK] Web content oftens steals focus from other widgets
         https://bugs.webkit.org/show_bug.cgi?id=77791
 

Modified: trunk/Source/WebCore/plugins/efl/PluginPackageEfl.cpp (108280 => 108281)


--- trunk/Source/WebCore/plugins/efl/PluginPackageEfl.cpp	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/Source/WebCore/plugins/efl/PluginPackageEfl.cpp	2012-02-21 02:19:35 UTC (rev 108281)
@@ -69,16 +69,16 @@
     NPError err = getValue(0, NPPVpluginNameString, static_cast<void*>(&buffer));
     if (err != NPERR_NO_ERROR)
         return false;
-    m_name = buffer;
+    m_name = String::fromUTF8(buffer);
 
     buffer = 0;
     err = getValue(0, NPPVpluginDescriptionString, static_cast<void*>(&buffer));
     if (err != NPERR_NO_ERROR)
         return false;
-    m_description = buffer;
+    m_description = String::fromUTF8(buffer);
     determineModuleVersionFromDescription();
 
-    String description = getMIMEDescription();
+    String description = String::fromUTF8(getMIMEDescription());
 
     Vector<String> types;
     description.split(UChar(';'), false, types);

Modified: trunk/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp (108280 => 108281)


--- trunk/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp	2012-02-21 02:19:35 UTC (rev 108281)
@@ -58,12 +58,12 @@
     char* buffer = 0;
     NPError err = NPP_GetValue(0, NPPVpluginNameString, &buffer);
     if (err == NPERR_NO_ERROR)
-        m_name = buffer;
+        m_name = String::fromUTF8(buffer);
 
     buffer = 0;
     err = NPP_GetValue(0, NPPVpluginDescriptionString, &buffer);
     if (err == NPERR_NO_ERROR) {
-        m_description = buffer;
+        m_description = String::fromUTF8(buffer);
         determineModuleVersionFromDescription();
     }
 

Modified: trunk/Source/WebCore/plugins/qt/PluginPackageQt.cpp (108280 => 108281)


--- trunk/Source/WebCore/plugins/qt/PluginPackageQt.cpp	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/Source/WebCore/plugins/qt/PluginPackageQt.cpp	2012-02-21 02:19:35 UTC (rev 108281)
@@ -51,16 +51,15 @@
     if (err != NPERR_NO_ERROR)
         return false;
 
-    m_name = buf;
+    m_name = String::fromUTF8(buf);
     err = gv(0, NPPVpluginDescriptionString, (void*) &buf);
     if (err != NPERR_NO_ERROR)
         return false;
 
-    m_description = buf;
+    m_description = String::fromUTF8(buf);
     determineModuleVersionFromDescription();
 
-    String mimeDescription = gm();
-    setMIMEDescription(mimeDescription);
+    setMIMEDescription(String::fromUTF8(gm()));
     m_infoIsFromCache = false;
 
     return true;

Modified: trunk/Source/WebKit2/ChangeLog (108280 => 108281)


--- trunk/Source/WebKit2/ChangeLog	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/Source/WebKit2/ChangeLog	2012-02-21 02:19:35 UTC (rev 108281)
@@ -1,3 +1,16 @@
+2012-02-20  Martin Robinson  <mrobin...@igalia.com>
+
+        [UNIX] Plugin information fields are not interpreted as UTF-8
+        https://bugs.webkit.org/show_bug.cgi?id=78635
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Interpret plugin metadata as UTF8 aways. This matches the behavior
+        of Chromium and the Totem plugin.
+
+        * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
+        (WebKit::NetscapePluginModule::getPluginInfoForLoadedPlugin): Use String::fromUTF8.
+
 2012-02-20  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK] Adding SOUP_TYPE_PROXY_RESOLVER_DEFAULT feature to soup session makes WebProcess to hang

Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp (108280 => 108281)


--- trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp	2012-02-21 02:19:35 UTC (rev 108281)
@@ -137,14 +137,14 @@
     char* buffer;
     NPError error = NPP_GetValue(0, NPPVpluginNameString, &buffer);
     if (error == NPERR_NO_ERROR)
-        plugin.info.name = buffer;
+        plugin.info.name = String::fromUTF8(buffer);
 
     error = NPP_GetValue(0, NPPVpluginDescriptionString, &buffer);
     if (error == NPERR_NO_ERROR)
-        plugin.info.desc = buffer;
+        plugin.info.desc = String::fromUTF8(buffer);
 
-    const char* mimeDescription = NP_GetMIMEDescription();
-    if (!mimeDescription)
+    String mimeDescription = String::fromUTF8(NP_GetMIMEDescription());
+    if (mimeDescription.isNull())
         return false;
 
     setMIMEDescription(mimeDescription, plugin);

Modified: trunk/Tools/ChangeLog (108280 => 108281)


--- trunk/Tools/ChangeLog	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/Tools/ChangeLog	2012-02-21 02:19:35 UTC (rev 108281)
@@ -1,5 +1,18 @@
 2012-02-20  Martin Robinson  <mrobin...@igalia.com>
 
+        [UNIX] Plugin information fields are not interpreted as UTF-8
+        https://bugs.webkit.org/show_bug.cgi?id=78635
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Interpret plugin metadata as UTF8 aways. This matches the behavior
+        of Chromium and the Totem plugin.
+
+        * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+        (NPP_GetValue): Include a UTF-8 character in the description string for testing purposes.
+
+2012-02-20  Martin Robinson  <mrobin...@igalia.com>
+
         [GTK] [Qt] Move the unix forwarding headers for TestNetscapePlugin to the TestNetscapePlugin directory
         https://bugs.webkit.org/show_bug.cgi?id=78935
 

Modified: trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp (108280 => 108281)


--- trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp	2012-02-21 02:16:13 UTC (rev 108280)
+++ trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp	2012-02-21 02:19:35 UTC (rev 108281)
@@ -773,7 +773,7 @@
         return NPERR_NO_ERROR;
     }
     if (variable == NPPVpluginDescriptionString) {
-        *((char **)value) = const_cast<char*>("Simple Netscape plug-in that handles test content for WebKit");
+        *((char **)value) = const_cast<char*>("Simple Netscape® plug-in that handles test content for WebKit");
         return NPERR_NO_ERROR;
     }
     if (variable == NPPVpluginNeedsXEmbed) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to