diff options
Diffstat (limited to 'Source/WebKit2/UIProcess/Plugins')
-rw-r--r-- | Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp | 9 | ||||
-rw-r--r-- | Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h | 2 | ||||
-rw-r--r-- | Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp | 8 | ||||
-rw-r--r-- | Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h | 1 | ||||
-rw-r--r-- | Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp | 4 | ||||
-rw-r--r-- | Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm | 45 | ||||
-rw-r--r-- | Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp (renamed from Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp) | 34 |
7 files changed, 71 insertions, 32 deletions
diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp b/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp index cebf4f7b2..f497895db 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp +++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp @@ -74,15 +74,6 @@ void PluginProcessManager::clearSiteData(const PluginModuleInfo& plugin, WebPlug pluginProcess->clearSiteData(webPluginSiteDataManager, sites, flags, maxAgeInSeconds, callbackID); } -void PluginProcessManager::pluginSyncMessageSendTimedOut(const String& pluginPath) -{ - PluginProcessProxy* pluginProcess = pluginProcessWithPath(pluginPath); - if (!pluginProcess) - return; - - pluginProcess->terminate(); -} - PluginProcessProxy* PluginProcessManager::pluginProcessWithPath(const String& pluginPath) { for (size_t i = 0; i < m_pluginProcesses.size(); ++i) { diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h b/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h index 19aafe860..37824c4aa 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h +++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h @@ -56,8 +56,6 @@ public: void getSitesWithData(const PluginModuleInfo&, WebPluginSiteDataManager*, uint64_t callbackID); void clearSiteData(const PluginModuleInfo&, WebPluginSiteDataManager*, const Vector<String>& sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID); - void pluginSyncMessageSendTimedOut(const String& pluginPath); - private: PluginProcessManager(); diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp index cfdff9efb..7796cfe97 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp +++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp @@ -152,10 +152,10 @@ void PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch() } while (!m_pendingGetSitesReplies.isEmpty()) - didGetSitesWithData(Vector<String>(), m_pendingGetSitesReplies.begin()->first); + didGetSitesWithData(Vector<String>(), m_pendingGetSitesReplies.begin()->key); while (!m_pendingClearSiteDataReplies.isEmpty()) - didClearSiteData(m_pendingClearSiteDataReplies.begin()->first); + didClearSiteData(m_pendingClearSiteDataReplies.begin()->key); // Tell the plug-in process manager to forget about this plug-in process proxy. This may cause us to be deleted. m_pluginProcessManager->removePluginProcessProxy(this); @@ -188,10 +188,6 @@ void PluginProcessProxy::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC: { } -void PluginProcessProxy::syncMessageSendTimedOut(CoreIPC::Connection*) -{ -} - void PluginProcessProxy::didFinishLaunching(ProcessLauncher*, CoreIPC::Connection::Identifier connectionIdentifier) { ASSERT(!m_connection); diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h index e0fe15ff0..4b50e6b80 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h +++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h @@ -101,7 +101,6 @@ private: virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); virtual void didClose(CoreIPC::Connection*); virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID); - virtual void syncMessageSendTimedOut(CoreIPC::Connection*); // ProcessLauncher::Client virtual void didFinishLaunching(ProcessLauncher*, CoreIPC::Connection::Identifier); diff --git a/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp b/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp index a26bbbdb8..246eeb447 100644 --- a/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp +++ b/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp @@ -163,8 +163,6 @@ void WebPluginSiteDataManager::getSitesWithData(PassRefPtr<ArrayCallback> prpCal m_pendingGetSitesWithData.set(callbackID, state); state->getSitesWithDataForNextPlugin(); #else - m_webContext->relaunchProcessIfNecessary(); - Vector<PluginModuleInfo> plugins = m_webContext->pluginInfoStore().plugins(); Vector<String> pluginPaths; for (size_t i = 0; i < plugins.size(); ++i) @@ -225,8 +223,6 @@ void WebPluginSiteDataManager::clearSiteData(ImmutableArray* sites, uint64_t fla m_pendingClearSiteData.set(callbackID, state); state->clearSiteDataForNextPlugin(); #else - m_webContext->relaunchProcessIfNecessary(); - Vector<PluginModuleInfo> plugins = m_webContext->pluginInfoStore().plugins(); Vector<String> pluginPaths; for (size_t i = 0; i < plugins.size(); ++i) diff --git a/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm b/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm index 5137968e6..2150c06f2 100644 --- a/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm +++ b/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm @@ -145,7 +145,14 @@ void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationPa bool PluginProcessProxy::getPluginProcessSerialNumber(ProcessSerialNumber& pluginProcessSerialNumber) { pid_t pluginProcessPID = m_processLauncher->processIdentifier(); +#if COMPILER(CLANG) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif return GetProcessForPID(pluginProcessPID, &pluginProcessSerialNumber) == noErr; +#if COMPILER(CLANG) +#pragma clang diagnostic pop +#endif } void PluginProcessProxy::makePluginProcessTheFrontProcess() @@ -154,14 +161,28 @@ void PluginProcessProxy::makePluginProcessTheFrontProcess() if (!getPluginProcessSerialNumber(pluginProcessSerialNumber)) return; +#if COMPILER(CLANG) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif SetFrontProcess(&pluginProcessSerialNumber); +#if COMPILER(CLANG) +#pragma clang diagnostic pop +#endif } void PluginProcessProxy::makeUIProcessTheFrontProcess() { ProcessSerialNumber processSerialNumber; +#if COMPILER(CLANG) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif GetCurrentProcess(&processSerialNumber); SetFrontProcess(&processSerialNumber); +#if COMPILER(CLANG) +#pragma clang diagnostic pop +#endif } void PluginProcessProxy::setFullscreenWindowIsShowing(bool fullscreenWindowIsShowing) @@ -193,7 +214,14 @@ void PluginProcessProxy::exitFullscreen() { // If the plug-in host is the current application then we should bring ourselves to the front when it exits full-screen mode. ProcessSerialNumber frontProcessSerialNumber; +#if COMPILER(CLANG) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif GetFrontProcess(&frontProcessSerialNumber); +#if COMPILER(CLANG) +#pragma clang diagnostic pop +#endif // The UI process must be the front process in order to change the presentation mode. makeUIProcessTheFrontProcess(); @@ -206,9 +234,24 @@ void PluginProcessProxy::exitFullscreen() // If the plug-in process was not the front process, switch back to the previous front process. // (Otherwise we'll keep the UI process as the front process). Boolean isPluginProcessFrontProcess; +#if COMPILER(CLANG) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif SameProcess(&frontProcessSerialNumber, &pluginProcessSerialNumber, &isPluginProcessFrontProcess); - if (!isPluginProcessFrontProcess) +#if COMPILER(CLANG) +#pragma clang diagnostic pop +#endif + if (!isPluginProcessFrontProcess) { +#if COMPILER(CLANG) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif SetFrontProcess(&frontProcessSerialNumber); +#if COMPILER(CLANG) +#pragma clang diagnostic pop +#endif + } } void PluginProcessProxy::setModalWindowIsShowing(bool modalWindowIsShowing) diff --git a/Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp b/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp index fa9339d09..3febb069a 100644 --- a/Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp +++ b/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp @@ -1,5 +1,7 @@ /* * Copyright (C) 2011 Igalia S.L. + * Copyright (C) 2011 Apple Inc. + * Copyright (C) 2012 Samsung Electronics * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,10 +12,10 @@ * 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'' + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 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 @@ -31,10 +33,11 @@ #include "PluginProcessCreationParameters.h" #include "ProcessExecutablePath.h" #include <WebCore/FileSystem.h> -#include <WebCore/GOwnPtrGtk.h> -#include <glib.h> #include <wtf/text/CString.h> #include <wtf/text/WTFString.h> +#if PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT)) +#include <glib.h> +#endif using namespace WebCore; @@ -46,6 +49,7 @@ void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationPa bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result) { +#if PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT)) CString binaryPath = fileSystemRepresentation(executablePathOfPluginProcess()); CString pluginPathCString = fileSystemRepresentation(pluginPath); char* argv[4]; @@ -54,27 +58,39 @@ bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& argv[2] = const_cast<char*>(pluginPathCString.data()); argv[3] = 0; - gint status; - GOwnPtr<gchar> stdOut; - if (!g_spawn_sync(0, argv, 0, G_SPAWN_STDERR_TO_DEV_NULL, 0, 0, &stdOut.outPtr(), 0, &status, 0)) + int status; + char* stdOut = 0; + + if (!g_spawn_sync(0, argv, 0, G_SPAWN_STDERR_TO_DEV_NULL, 0, 0, &stdOut, 0, &status, 0)) return false; - if (!WIFEXITED(status) || WEXITSTATUS(status) != EXIT_SUCCESS) + + if (!WIFEXITED(status) || WEXITSTATUS(status) != EXIT_SUCCESS) { + free(stdOut); return false; + } const unsigned kNumLinesExpected = 3; String lines[kNumLinesExpected]; unsigned lineIndex = 0; - const UChar* current = reinterpret_cast<const UChar*>(stdOut.get()); + + const UChar* current = reinterpret_cast<const UChar*>(stdOut); + while (lineIndex < kNumLinesExpected) { const UChar* start = current; while (*current++ != UChar('\n')) { } lines[lineIndex++] = String(start, current - start - 1); } + if (stdOut) + free(stdOut); + result.name.swap(lines[0]); result.description.swap(lines[1]); result.mimeDescription.swap(lines[2]); return !result.mimeDescription.isEmpty(); +#else // PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT)) + return false; +#endif // PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT)) } } // namespace WebKit |