summaryrefslogtreecommitdiff
path: root/Source/WebKit2/PluginProcess
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/PluginProcess')
-rw-r--r--Source/WebKit2/PluginProcess/PluginControllerProxy.cpp15
-rw-r--r--Source/WebKit2/PluginProcess/PluginControllerProxy.h3
-rw-r--r--Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in9
-rw-r--r--Source/WebKit2/PluginProcess/PluginProcess.cpp4
-rw-r--r--Source/WebKit2/PluginProcess/PluginProcess.h1
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.cpp6
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.h1
-rw-r--r--Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm9
-rw-r--r--Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm5
-rw-r--r--Source/WebKit2/PluginProcess/unix/PluginControllerProxyUnix.cpp (renamed from Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp)0
-rw-r--r--Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp (renamed from Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp)64
-rw-r--r--Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.h (renamed from Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.h)6
-rw-r--r--Source/WebKit2/PluginProcess/unix/PluginProcessUnix.cpp (renamed from Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp)2
13 files changed, 88 insertions, 37 deletions
diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp b/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
index 31a5d61a6..cef3d40a4 100644
--- a/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -521,6 +521,21 @@ void PluginControllerProxy::handleKeyboardEvent(const WebKeyboardEvent& keyboard
handled = m_plugin->handleKeyboardEvent(keyboardEvent);
}
+void PluginControllerProxy::handleEditingCommand(const String& commandName, const String& argument, bool& handled)
+{
+ handled = m_plugin->handleEditingCommand(commandName, argument);
+}
+
+void PluginControllerProxy::isEditingCommandEnabled(const String& commandName, bool& enabled)
+{
+ enabled = m_plugin->isEditingCommandEnabled(commandName);
+}
+
+void PluginControllerProxy::handlesPageScaleFactor(bool& isHandled)
+{
+ isHandled = m_plugin->handlesPageScaleFactor();
+}
+
void PluginControllerProxy::paintEntirePlugin()
{
if (m_pluginSize.isEmpty())
diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.h b/Source/WebKit2/PluginProcess/PluginControllerProxy.h
index b4a40673e..83dd3fb74 100644
--- a/Source/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -137,6 +137,9 @@ private:
void handleMouseEnterEvent(const WebMouseEvent&, bool& handled);
void handleMouseLeaveEvent(const WebMouseEvent&, bool& handled);
void handleKeyboardEvent(const WebKeyboardEvent&, bool& handled);
+ void handleEditingCommand(const String&, const String&, bool&);
+ void isEditingCommandEnabled(const String&, bool&);
+ void handlesPageScaleFactor(bool&);
void paintEntirePlugin();
void snapshot(ShareableBitmap::Handle& backingStoreHandle);
void setFocus(bool);
diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in b/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in
index d7c2d02b2..0671a23c0 100644
--- a/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in
+++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in
@@ -73,6 +73,15 @@ messages -> PluginControllerProxy {
# Sent when a keyboard should be processed.
HandleKeyboardEvent(WebKit::WebKeyboardEvent keyboardEvent) -> (bool handled)
+
+ # Sent when an editing command should be processed.
+ HandleEditingCommand(WTF::String commandName, WTF::String argument) -> (bool handled);
+
+ # Return whether or not a plugin wants to enable the given editing command.
+ IsEditingCommandEnabled(WTF::String commandName) -> (bool enabled);
+
+ # Return whether or not a plugin wants to handle page scale factor itself.
+ HandlesPageScaleFactor() -> (bool enabled);
# Sent when the plug-in focus changes.
SetFocus(bool isFocused)
diff --git a/Source/WebKit2/PluginProcess/PluginProcess.cpp b/Source/WebKit2/PluginProcess/PluginProcess.cpp
index 1bffafe74..7125d7d86 100644
--- a/Source/WebKit2/PluginProcess/PluginProcess.cpp
+++ b/Source/WebKit2/PluginProcess/PluginProcess.cpp
@@ -150,10 +150,6 @@ void PluginProcess::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::Mess
{
}
-void PluginProcess::syncMessageSendTimedOut(CoreIPC::Connection*)
-{
-}
-
void PluginProcess::initializePluginProcess(const PluginProcessCreationParameters& parameters)
{
ASSERT(!m_pluginModule);
diff --git a/Source/WebKit2/PluginProcess/PluginProcess.h b/Source/WebKit2/PluginProcess/PluginProcess.h
index be34e9fce..645153cee 100644
--- a/Source/WebKit2/PluginProcess/PluginProcess.h
+++ b/Source/WebKit2/PluginProcess/PluginProcess.h
@@ -77,7 +77,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*);
// Message handlers.
void didReceivePluginProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
index 1d95df1ed..0507d613b 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
@@ -237,10 +237,6 @@ void WebProcessConnection::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIP
// FIXME: Implement.
}
-void WebProcessConnection::syncMessageSendTimedOut(CoreIPC::Connection*)
-{
-}
-
void WebProcessConnection::createPluginInternal(const PluginCreationParameters& creationParameters, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID)
{
OwnPtr<PluginControllerProxy> pluginControllerProxy = PluginControllerProxy::create(this, creationParameters);
@@ -260,6 +256,8 @@ void WebProcessConnection::createPluginInternal(const PluginCreationParameters&
wantsWheelEvents = pluginControllerProxyPtr->wantsWheelEvents();
#if PLATFORM(MAC)
remoteLayerClientID = pluginControllerProxyPtr->remoteLayerClientID();
+#else
+ UNUSED_PARAM(remoteLayerClientID);
#endif
}
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.h b/Source/WebKit2/PluginProcess/WebProcessConnection.h
index ce98e1036..8296b5470 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.h
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.h
@@ -66,7 +66,6 @@ private:
virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
- virtual void syncMessageSendTimedOut(CoreIPC::Connection*);
// Message handlers.
void didReceiveWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
diff --git a/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm b/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm
index 6a313f26c..de7d5831f 100644
--- a/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm
+++ b/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm
@@ -189,11 +189,18 @@ static unsigned modalCount = 0;
static void beginModal()
{
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
// Make sure to make ourselves the front process
ProcessSerialNumber psn;
GetCurrentProcess(&psn);
SetFrontProcess(&psn);
-
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
+
if (!modalCount++)
setModal(true);
}
diff --git a/Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm b/Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm
index 45b56b925..ffe1e2dd3 100644
--- a/Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm
+++ b/Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm
@@ -84,9 +84,10 @@ int PluginProcessMain(const CommandLine& commandLine)
}
String localization = commandLine["localization"];
- RetainPtr<CFStringRef> cfLocalization(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(localization.characters()), localization.length()));
- if (cfLocalization)
+ if (!localization.isEmpty()) {
+ RetainPtr<CFStringRef> cfLocalization(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(localization.characters()), localization.length()));
WKSetDefaultLocalization(cfLocalization.get());
+ }
#if defined(__i386__)
{
diff --git a/Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp b/Source/WebKit2/PluginProcess/unix/PluginControllerProxyUnix.cpp
index cbcc1d730..cbcc1d730 100644
--- a/Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp
+++ b/Source/WebKit2/PluginProcess/unix/PluginControllerProxyUnix.cpp
diff --git a/Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp b/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp
index 870c01c27..4113d3dfa 100644
--- a/Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp
+++ b/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.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
@@ -24,44 +26,65 @@
*/
#include "config.h"
-#include "PluginProcessMainGtk.h"
+#include "PluginProcessMainUnix.h"
+#include "Logging.h"
#include "NetscapePlugin.h"
#include "PluginProcess.h"
+#include "ScriptController.h"
#include <WebCore/RunLoop.h>
+#if PLATFORM(GTK)
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
-#include <runtime/InitializeThreading.h>
-#include <wtf/MainThread.h>
+#elif PLATFORM(EFL) && HAVE_ECORE_X
+#include <Ecore_X.h>
+#endif
using namespace WebCore;
namespace WebKit {
-static int webkitgtkXError(Display* xdisplay, XErrorEvent* error)
+#ifdef XP_UNIX
+
+#if !LOG_DISABLED
+static const char xErrorString[] = "The program '%s' received an X Window System error.\n"
+ "This probably reflects a bug in a browser plugin.\n"
+ "The error was '%s'.\n"
+ " (Details: serial %ld error_code %d request_code %d minor_code %d)\n";
+#endif /* !LOG_DISABLED */
+
+static char* programName = 0;
+
+static int webkitXError(Display* xdisplay, XErrorEvent* error)
{
- gchar errorMessage[64];
+ char errorMessage[64];
XGetErrorText(xdisplay, error->error_code, errorMessage, 63);
- g_warning("The program '%s' received an X Window System error.\n"
- "This probably reflects a bug in a browser plugin.\n"
- "The error was '%s'.\n"
- " (Details: serial %ld error_code %d request_code %d minor_code %d)\n",
- g_get_prgname(), errorMessage,
- error->serial, error->error_code,
- error->request_code, error->minor_code);
+
+ LOG(Plugins, xErrorString,
+ programName, errorMessage,
+ error->serial, error->error_code,
+ error->request_code, error->minor_code);
+
return 0;
}
+#endif
-WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[])
+WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
{
ASSERT(argc == 2 || argc == 3);
bool scanPlugin = !strcmp(argv[1], "-scanPlugin");
ASSERT(argc == 2 || (argc == 3 && scanPlugin));
+#if PLATFORM(GTK)
gtk_init(&argc, &argv);
+#elif PLATFORM(EFL)
+#ifdef HAVE_ECORE_X
+ if (!ecore_x_init(0))
+#endif
+ return 1;
+#endif
- JSC::initializeThreading();
- WTF::initializeMainThread();
+ ScriptController::initializeThreading();
if (scanPlugin) {
String pluginPath(argv[2]);
@@ -75,7 +98,10 @@ WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[])
// Plugins can produce X errors that are handled by the GDK X error handler, which
// exits the process. Since we don't want to crash due to plugin bugs, we install a
// custom error handler to show a warning when a X error happens without aborting.
- XSetErrorHandler(webkitgtkXError);
+#if defined(XP_UNIX)
+ programName = basename(argv[0]);
+ XSetErrorHandler(webkitXError);
+#endif
int socket = atoi(argv[1]);
WebKit::PluginProcess::shared().initialize(socket, RunLoop::main());
@@ -85,5 +111,3 @@ WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[])
}
} // namespace WebKit
-
-
diff --git a/Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.h b/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.h
index 39cc6e659..540c596aa 100644
--- a/Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.h
+++ b/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.h
@@ -24,8 +24,8 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PluginProcessMainGtk_h
-#define PluginProcessMainGtk_h
+#ifndef PluginProcessMainUnix_h
+#define PluginProcessMainUnix_h
#include <WebKit2/WKBase.h>
@@ -33,7 +33,7 @@ namespace WebKit {
#ifdef __cplusplus
extern "C" {
-WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[]);
+WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[]);
} // extern "C"
#endif // __cplusplus
diff --git a/Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp b/Source/WebKit2/PluginProcess/unix/PluginProcessUnix.cpp
index ee78f9a7b..50daa02aa 100644
--- a/Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp
+++ b/Source/WebKit2/PluginProcess/unix/PluginProcessUnix.cpp
@@ -33,7 +33,7 @@
namespace WebKit {
-void PluginProcess::platformInitialize(const PluginProcessCreationParameters& parameters)
+void PluginProcess::platformInitialize(const PluginProcessCreationParameters&)
{
notImplemented();
}