[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

ap at apple.com ap at apple.com
Fri Feb 26 22:14:45 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit b601a00ae7fea2362620623547ed4a09d796f304
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Feb 8 20:53:49 2010 +0000

            Reviewed by Anders Carlsson.
    
            <rdar://problem/6530010> OOP: Support NPN_SetException
    
            Tested by plugins/netscape-throw-exception.html (removed it from skipped list).
    
            * Plugins/Hosted/NetscapePluginHostProxy.mm:
            (WKPCSetException):
            * Plugins/Hosted/NetscapePluginInstanceProxy.h:
            * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
            (WebKit::globalExceptionString):
            (WebKit::NetscapePluginInstanceProxy::setGlobalException):
            (WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState):
            * Plugins/Hosted/ProxyInstance.mm:
            (WebKit::ProxyInstance::invoke):
            (WebKit::ProxyInstance::getPropertyNames):
            (WebKit::ProxyInstance::fieldValue):
            (WebKit::ProxyInstance::setFieldValue):
            * Plugins/Hosted/WebKitPluginClient.defs:
            Route exception string to a global that's checked after calling into plug-in (just like in
            in-process case).
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54504 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 67febd1..ce9269b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,11 @@
+2010-02-08  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        <rdar://problem/6530010> OOP: Support NPN_SetException
+
+        * platform/mac-snowleopard/Skipped: Unskipped plugins/netscape-throw-exception.html.
+
 2010-02-08  Dirk Schulze  <krit at webkit.org>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/LayoutTests/platform/mac-snowleopard/Skipped b/LayoutTests/platform/mac-snowleopard/Skipped
index 6eeae21..1a135b6 100644
--- a/LayoutTests/platform/mac-snowleopard/Skipped
+++ b/LayoutTests/platform/mac-snowleopard/Skipped
@@ -1,6 +1,3 @@
-# <rdar://problem/6530010> NPN_SetException is not working
-plugins/netscape-throw-exception.html
-
 # <rdar://problem/7091352> Two plug-in tests show missing NPP_Destroy call
 plugins/netscape-destroy-plugin-script-objects.html
 plugins/open-and-close-window-with-plugin.html
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index fe49c07..ddf1dd8 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,27 @@
+2010-02-08  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        <rdar://problem/6530010> OOP: Support NPN_SetException
+
+        Tested by plugins/netscape-throw-exception.html (removed it from skipped list).
+
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (WKPCSetException):
+        * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::globalExceptionString):
+        (WebKit::NetscapePluginInstanceProxy::setGlobalException):
+        (WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState):
+        * Plugins/Hosted/ProxyInstance.mm:
+        (WebKit::ProxyInstance::invoke):
+        (WebKit::ProxyInstance::getPropertyNames):
+        (WebKit::ProxyInstance::fieldValue):
+        (WebKit::ProxyInstance::setFieldValue):
+        * Plugins/Hosted/WebKitPluginClient.defs:
+        Route exception string to a global that's checked after calling into plug-in (just like in
+        in-process case).
+
 2010-02-05  Kevin Decker  <kdecker at apple.com>
 
         Reviewed by Mark Rowe.
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
index 0e6c9a3..537033f 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
@@ -39,6 +39,7 @@
 #import <WebCore/Frame.h>
 #import <WebCore/IdentifierRep.h>
 #import <WebCore/ScriptController.h>
+#import <string>
 
 extern "C" {
 #import "WebKitPluginHost.h"
@@ -1149,4 +1150,14 @@ kern_return_t WKPCRunSyncOpenPanel(mach_port_t clientPort, data_t panelData, mac
 }
 #endif // !defined(BUILDING_ON_SNOW_LEOPARD)
 
+kern_return_t WKPCSetException(mach_port_t clientPort, data_t message, mach_msg_type_number_t messageCnt)
+{
+    DataDeallocator deallocator(message, messageCnt);
+
+    string str(message, messageCnt);
+    NetscapePluginInstanceProxy::setGlobalException(str.c_str());
+
+    return KERN_SUCCESS;
+}
+
 #endif // USE(PLUGIN_HOST_PROCESS)
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
index 2ef6b02..76981a4 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
@@ -140,7 +140,7 @@ public:
                                data_t& usernameData, mach_msg_type_number_t& usernameLength, data_t& passwordData, mach_msg_type_number_t& passwordLength);
     bool convertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace, 
                       double& destX, double& destY, NPCoordinateSpace destSpace);
-    
+
     PassRefPtr<JSC::Bindings::Instance> createBindingsInstance(PassRefPtr<JSC::Bindings::RootObject>);
     RetainPtr<NSData *> marshalValues(JSC::ExecState*, const JSC::ArgList& args);
     void marshalValue(JSC::ExecState*, JSC::JSValue value, data_t& resultData, mach_msg_type_number_t& resultLength);
@@ -167,6 +167,9 @@ public:
     void didDraw();
     void privateBrowsingModeDidChange(bool isPrivateBrowsingEnabled);
     
+    static void setGlobalException(const WebCore::String&);
+    static void moveGlobalExceptionToExecState(JSC::ExecState*);
+
     // Reply structs
     struct Reply {
         enum Type {
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index e4fe1d2..c09e3ea 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -40,6 +40,7 @@
 #import "WebUIDelegate.h"
 #import "WebUIDelegatePrivate.h"
 #import "WebViewInternal.h"
+#import <JavaScriptCore/Error.h>
 #import <JavaScriptCore/JSLock.h>
 #import <JavaScriptCore/PropertyNameArray.h>
 #import <WebCore/CString.h>
@@ -1492,6 +1493,30 @@ void NetscapePluginInstanceProxy::privateBrowsingModeDidChange(bool isPrivateBro
     _WKPHPluginInstancePrivateBrowsingModeDidChange(m_pluginHostProxy->port(), m_pluginID, isPrivateBrowsingEnabled);
 }
 
+static String& globalExceptionString()
+{
+    DEFINE_STATIC_LOCAL(String, exceptionString, ());
+    return exceptionString;
+}
+
+void NetscapePluginInstanceProxy::setGlobalException(const String& exception)
+{
+    globalExceptionString() = exception;
+}
+
+void NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(ExecState* exec)
+{
+    if (globalExceptionString().isNull())
+        return;
+
+    {
+        JSLock lock(SilenceAssertionsOnly);
+        throwError(exec, GeneralError, globalExceptionString());
+    }
+
+    globalExceptionString() = UString();
+}
+
 } // namespace WebKit
 
 #endif // USE(PLUGIN_HOST_PROCESS)
diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
index 1af2ef8..1587ad0 100644
--- a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
+++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
@@ -147,6 +147,7 @@ JSValue ProxyInstance::invoke(JSC::ExecState* exec, InvokeType type, uint64_t id
         return jsUndefined();
     
     auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
+    NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(exec);
     if (!reply.get() || !reply->m_returnValue)
         return jsUndefined();
     
@@ -253,7 +254,7 @@ void ProxyInstance::getPropertyNames(ExecState* exec, PropertyNameArray& nameArr
         return;
     
     auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
-  
+    NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(exec);
     if (!reply.get() || !reply->m_returnValue)
         return;
     
@@ -361,6 +362,7 @@ JSC::JSValue ProxyInstance::fieldValue(ExecState* exec, const Field* field) cons
         return jsUndefined();
     
     auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
+    NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(exec);
     if (!reply.get() || !reply->m_returnValue)
         return jsUndefined();
     
@@ -387,6 +389,7 @@ void ProxyInstance::setFieldValue(ExecState* exec, const Field* field, JSValue v
         return;
     
     auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
+    NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(exec);
 }
 
 void ProxyInstance::invalidate()
diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
index 0cf4005..579d52b 100644
--- a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
+++ b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
@@ -236,3 +236,6 @@ simpleroutine PCRunSyncOpenPanel(clientPort :mach_port_t;
 
 simpleroutine PCSetFullScreenWindowIsShowing(clientPort :mach_port_t;
                                              isShowing :boolean_t);
+
+simpleroutine PCSetException(clientPort :mach_port_t;
+                             message :data_t);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list