Changeset 174054 in webkit
- Timestamp:
- Sep 29, 2014 1:51:51 AM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r174052 r174054 1 2014-09-29 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 REGRESSION(r172919): WebKitPluginProcess fails to scan GTK+2 plugins after r172919. 4 https://bugs.webkit.org/show_bug.cgi?id=137191 5 6 Reviewed by Philippe Normand. 7 8 In r172919 I moved the GTK+ symbols mix check earlier, before the 9 plugin is loaded and initialized. That made impossible to use the 10 GTK3 plugin process to scan gtk2 plugins, because we need to load 11 the plugin to get its metadata. But we don't need to initialize 12 the plugin to check if it requires GTK2, so we can do that check 13 in the UI process to decide which plugin process to use. 14 15 * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: 16 (WebKit::NetscapePluginModule::getPluginInfoForLoadedPlugin): 17 Remove the requires GTK2 check. 18 (WebKit::NetscapePluginModule::scanPlugin): Don't write 19 requires-gtk2 to stdout. 20 * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: 21 (WebKit::pluginRequiresGtk2): Helper function to check if the 22 given plugin path requires GTK2. 23 (WebKit::PluginProcessProxy::scanPlugin): Check if the plugin path 24 requires GTK2 and use WebKitPluginProcess2 in such case, or return 25 early if GTK2 plugins are not enabled. Log error messages when 26 something fails scanning the plugin to make it easiert to debug 27 problems in the future. 28 1 29 2014-09-28 Myles C. Maxfield <mmaxfield@apple.com> 2 30 -
trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
r172724 r174054 153 153 metaData.mimeDescription = mimeDescription; 154 154 155 #if PLATFORM(GTK)156 metaData.requiresGtk2 = module->functionPointer<void (*)()>("gtk_progress_get_type");157 #endif158 159 155 return true; 160 156 } … … 245 241 writeLine(metaData.description); 246 242 writeLine(metaData.mimeDescription); 247 #if PLATFORM(GTK)248 if (metaData.requiresGtk2)249 writeLine("requires-gtk2");250 #endif251 243 252 244 fflush(stdout); -
trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
r167885 r174054 1 1 /* 2 * Copyright (C) 2011 Igalia S.L.2 * Copyright (C) 2011, 2014 Igalia S.L. 3 3 * Copyright (C) 2011 Apple Inc. 4 4 * Copyright (C) 2012 Samsung Electronics … … 34 34 #include "ProcessExecutablePath.h" 35 35 #include <WebCore/FileSystem.h> 36 #include <sys/wait.h> 36 37 #include <wtf/text/CString.h> 37 38 #include <wtf/text/WTFString.h> 39 38 40 #if PLATFORM(GTK) || PLATFORM(EFL) 39 41 #include <glib.h> … … 41 43 #endif 42 44 43 #include <sys/wait.h> 45 #if PLATFORM(GTK) 46 #include "Module.h" 47 #endif 44 48 45 49 using namespace WebCore; … … 66 70 } 67 71 72 #if PLATFORM(GTK) 73 static bool pluginRequiresGtk2(const String& pluginPath) 74 { 75 std::unique_ptr<Module> module = std::make_unique<Module>(pluginPath); 76 if (!module->load()) 77 return false; 78 return module->functionPointer<gpointer>("gtk_object_get_type"); 79 } 80 #endif 81 68 82 #if PLUGIN_ARCHITECTURE(X11) 69 83 bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result) 70 84 { 71 85 #if PLATFORM(GTK) || PLATFORM(EFL) 72 CString binaryPath = fileSystemRepresentation(executablePathOfPluginProcess()); 86 String pluginProcessPath = executablePathOfPluginProcess(); 87 88 #if PLATFORM(GTK) 89 bool requiresGtk2 = pluginRequiresGtk2(pluginPath); 90 if (requiresGtk2) 91 #if ENABLE(PLUGIN_PROCESS_GTK2) 92 pluginProcessPath.append('2'); 93 #else 94 return false; 95 #endif 96 #endif 97 98 CString binaryPath = fileSystemRepresentation(pluginProcessPath); 73 99 CString pluginPathCString = fileSystemRepresentation(pluginPath); 74 100 char* argv[4]; … … 76 102 argv[1] = const_cast<char*>("-scanPlugin"); 77 103 argv[2] = const_cast<char*>(pluginPathCString.data()); 78 argv[3] = 0; 79 80 int status; 81 GUniqueOutPtr<char> stdOut; 104 argv[3] = nullptr; 82 105 83 106 // If the disposition of SIGCLD signal is set to SIG_IGN (default) … … 95 118 #endif 96 119 97 if (!g_spawn_sync(0, argv, 0, G_SPAWN_STDERR_TO_DEV_NULL, 0, 0, &stdOut.outPtr(), 0, &status, 0)) 120 int status; 121 GUniqueOutPtr<char> stdOut; 122 GUniqueOutPtr<GError> error; 123 if (!g_spawn_sync(nullptr, argv, nullptr, G_SPAWN_STDERR_TO_DEV_NULL, nullptr, nullptr, &stdOut.outPtr(), nullptr, &status, &error.outPtr())) { 124 WTFLogAlways("Failed to launch %s: %s", argv[0], error->message); 98 125 return false; 126 } 99 127 100 if (!WIFEXITED(status) || WEXITSTATUS(status) != EXIT_SUCCESS || !stdOut) 128 if (!WIFEXITED(status) || WEXITSTATUS(status) != EXIT_SUCCESS) { 129 WTFLogAlways("Error scanning plugin %s, %s returned %d exit status", argv[2], argv[0], status); 101 130 return false; 131 } 102 132 103 String stdOutString = String::fromUTF8(stdOut.get()); 133 if (!stdOut) { 134 WTFLogAlways("Error scanning plugin %s, %s didn't write any output to stdout", argv[2], argv[0]); 135 return false; 136 } 104 137 105 138 Vector<String> lines; 106 stdOutString.split(UChar('\n'), true, lines);139 String::fromUTF8(stdOut.get()).split(UChar('\n'), true, lines); 107 140 108 if (lines.size() < 3) 141 if (lines.size() < 3) { 142 WTFLogAlways("Error scanning plugin %s, too few lines of output provided", argv[2]); 109 143 return false; 144 } 110 145 111 146 result.name.swap(lines[0]); … … 113 148 result.mimeDescription.swap(lines[2]); 114 149 #if PLATFORM(GTK) 115 if (lines.size() > 3) 116 result.requiresGtk2 = lines[3] == "requires-gtk2"; 150 result.requiresGtk2 = requiresGtk2; 117 151 #endif 118 152 return !result.mimeDescription.isEmpty();
Note: See TracChangeset
for help on using the changeset viewer.