2009-01-20 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
Add ProxyInstance files.
* WebKit.xcodeproj/project.pbxproj:
WebKit/mac:
2009-01-19 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
Add and implement GetScriptableNPObject.
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WKPCGetScriptableNPObjectReply):
Create a new reply struct and set it as the current reply.
(WKPCEvaluate):
Get rid of an unused variable.
* Plugins/Hosted/NetscapePluginInstanceProxy.h:
(WebKit::NetscapePluginInstanceProxy::Reply::):
(WebKit::NetscapePluginInstanceProxy::GetScriptableNPObjectReply::GetScriptableNPObjectReply):
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::createBindingsInstance):
Call _WKPHGetScriptableNPObject and wait for a reply.
* Plugins/Hosted/ProxyInstance.h: Added.
* Plugins/Hosted/ProxyInstance.mm: Added.
Add empty files.
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(-[WebHostedNetscapePluginView JSC::Bindings::createPluginBindingsInstance:JSC::Bindings::]):
Call NetscapePluginInstanceProxy::createBindingsInstance.
* Plugins/Hosted/WebKitPluginClient.defs:
* Plugins/Hosted/WebKitPluginHost.defs:
Add new declarations.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40061
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-01-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add ProxyInstance files.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
2009-01-04 David Kilzer <ddkilzer@apple.com>
Don't install internal headers in WebKit framework
1A2D754D0DE480B900F0A648 /* WebIconFetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2D754B0DE480B900F0A648 /* WebIconFetcher.h */; settings = {ATTRIBUTES = (Private, ); }; };
1A2D754E0DE480B900F0A648 /* WebIconFetcher.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A2D754C0DE480B900F0A648 /* WebIconFetcher.mm */; };
1A2D75500DE4810E00F0A648 /* WebIconFetcherInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2D754F0DE4810E00F0A648 /* WebIconFetcherInternal.h */; };
+ 1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */; };
+ 1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */; };
1A4DF5220EC8C74D006BD4B4 /* WebNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4DF5200EC8C74D006BD4B4 /* WebNetscapePluginView.h */; };
1A4DF5230EC8C74D006BD4B4 /* WebNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
1A4DF5E40EC8D104006BD4B4 /* WebBaseNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4DF5E20EC8D104006BD4B4 /* WebBaseNetscapePluginView.h */; };
1A2D754B0DE480B900F0A648 /* WebIconFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconFetcher.h; sourceTree = "<group>"; };
1A2D754C0DE480B900F0A648 /* WebIconFetcher.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebIconFetcher.mm; sourceTree = "<group>"; };
1A2D754F0DE4810E00F0A648 /* WebIconFetcherInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconFetcherInternal.h; sourceTree = "<group>"; };
+ 1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyInstance.h; sourceTree = "<group>"; };
+ 1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProxyInstance.mm; sourceTree = "<group>"; };
1A4DF5200EC8C74D006BD4B4 /* WebNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginView.h; sourceTree = "<group>"; };
1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapePluginView.mm; sourceTree = "<group>"; };
1A4DF5E20EC8D104006BD4B4 /* WebBaseNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBaseNetscapePluginView.h; sourceTree = "<group>"; };
1AAF5CE70EDDE1FE008D883D /* NetscapePluginHostProxy.mm */,
1AAF5CE80EDDE1FE008D883D /* NetscapePluginInstanceProxy.h */,
1AAF5CE90EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm */,
+ 1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */,
+ 1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */,
1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */,
1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */,
1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */,
9398109B0824BF01008DF038 /* WebViewInternal.h in Headers */,
939810710824BF01008DF038 /* WebViewPrivate.h in Headers */,
1A7F9C4C0DD3DDEA0028F8A5 /* nptextinput.h in Headers */,
+ 1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
939811070824BF01008DF038 /* WebView.mm in Sources */,
939810E80824BF01008DF038 /* WebViewFactory.mm in Sources */,
939810DD0824BF01008DF038 /* npapi.mm in Sources */,
+ 1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
+2009-01-19 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add and implement GetScriptableNPObject.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WKPCGetScriptableNPObjectReply):
+ Create a new reply struct and set it as the current reply.
+
+ (WKPCEvaluate):
+ Get rid of an unused variable.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ (WebKit::NetscapePluginInstanceProxy::Reply::):
+ (WebKit::NetscapePluginInstanceProxy::GetScriptableNPObjectReply::GetScriptableNPObjectReply):
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::createBindingsInstance):
+ Call _WKPHGetScriptableNPObject and wait for a reply.
+
+ * Plugins/Hosted/ProxyInstance.h: Added.
+ * Plugins/Hosted/ProxyInstance.mm: Added.
+ Add empty files.
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView JSC::Bindings::createPluginBindingsInstance:JSC::Bindings::]):
+ Call NetscapePluginInstanceProxy::createBindingsInstance.
+
+ * Plugins/Hosted/WebKitPluginClient.defs:
+ * Plugins/Hosted/WebKitPluginHost.defs:
+ Add new declarations.
+
2009-01-19 Sam Weinig <sam@webkit.org>
Rubber-stamped by Gavin Barraclough.
return KERN_SUCCESS;
}
+kern_return_t WKPCGetScriptableNPObjectReply(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID)
+{
+ NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
+ if (!hostProxy)
+ return KERN_FAILURE;
+
+ NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
+ if (!instanceProxy)
+ return KERN_FAILURE;
+
+ instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::GetScriptableNPObjectReply(objectID));
+ return KERN_SUCCESS;
+}
+
kern_return_t WKPCInstantiatePluginReply(mach_port_t clientPort, uint32_t pluginID, kern_return_t result, uint32_t renderContextID, boolean_t useSoftwareRenderer)
{
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
boolean_t returnValue = instanceProxy->evaluate(objectID, script, resultData, resultLength);
- kern_return_t kr = _WKPHEvaluateReply(hostProxy->port(), instanceProxy->pluginID(), returnValue, resultData, resultLength);
+ _WKPHEvaluateReply(hostProxy->port(), instanceProxy->pluginID(), returnValue, resultData, resultLength);
mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
return KERN_SUCCESS;
class String;
}
+namespace JSC {
+ namespace Bindings {
+ class Instance;
+ class RootObject;
+ }
+}
@class WebHostedNetscapePluginView;
namespace WebKit {
void status(const char* message);
NPError loadURL(const char* url, const char* target, const char* postData, uint32_t postDataLength, LoadURLFlags, uint32_t& requestID);
+ PassRefPtr<JSC::Bindings::Instance> createBindingsInstance(PassRefPtr<JSC::Bindings::RootObject>);
+
// Reply structs
struct Reply {
enum Type {
- InstantiatePlugin
+ InstantiatePlugin,
+ GetScriptableNPObject
};
Reply(Type type) : m_type(type) { }
boolean_t m_useSoftwareRenderer;
};
+ struct GetScriptableNPObjectReply : public Reply {
+ static const int ReplyType = GetScriptableNPObject;
+
+ GetScriptableNPObjectReply(uint32_t objectID)
+ : Reply(GetScriptableNPObject)
+ , m_objectID(objectID)
+ {
+ }
+
+ uint32_t m_objectID;
+ };
+
void setCurrentReply(Reply* reply)
{
ASSERT(!m_currentReply.get());
#import "HostedNetscapePluginStream.h"
#import "NetscapePluginHostProxy.h"
+#import "ProxyInstance.h"
#import "WebDataSourceInternal.h"
#import "WebFrameInternal.h"
#import "WebHostedNetscapePluginView.h"
}
using namespace JSC;
+using namespace JSC::Bindings;
using namespace std;
using namespace WebCore;
result.append(value);
}
+PassRefPtr<Instance> NetscapePluginInstanceProxy::createBindingsInstance(PassRefPtr<RootObject>)
+{
+ if (_WKPHGetScriptableNPObject(m_pluginHostProxy->port(), m_pluginID) != KERN_SUCCESS)
+ return 0;
+
+ auto_ptr<GetScriptableNPObjectReply> reply = waitForReply<GetScriptableNPObjectReply>();
+ if (!reply.get())
+ return 0;
+
+ // FIXME: Implement
+ return 0;
+}
+
} // namespace WebKit
#endif // USE(PLUGIN_HOST_PROCESS)
--- /dev/null
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * 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. ``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
+ * 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 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if USE(PLUGIN_HOST_PROCESS)
+
+#ifndef ProxyInstance_h
+#define ProxyInstance_h
+
+#include <WebCore/runtime.h>
+
+namespace WebKit {
+}
+
+#endif // ProxyInstance_h
+#endif // USE(PLUGIN_HOST_PROCESS)
--- /dev/null
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * 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. ``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
+ * 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 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if USE(PLUGIN_HOST_PROCESS)
+
+#import "ProxyInstance.h"
+
+namespace WebKit {
+
+} // namespace WebKit
+
+#endif // USE(PLUGIN_HOST_PROCESS)
+
#import "WebUIDelegate.h"
#import <CoreFoundation/CoreFoundation.h>
+#import <WebCore/runtime.h>
+#import <WebCore/runtime_root.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <runtime/InitializeThreading.h>
#import <wtf/Assertions.h>
}
}
+- (PassRefPtr<JSC::Bindings::Instance>)createPluginBindingsInstance:(PassRefPtr<JSC::Bindings::RootObject>)rootObject
+{
+ return _proxy->createBindingsInstance(rootObject);
+}
+
@end
#endif
renderContextID :uint32_t;
useSoftwareRenderer :boolean_t);
+simpleroutine GetScriptableNPObjectReply(clientPort :mach_port_t;
+ pluginID :uint32_t;
+ objectID :uint32_t);
+
streamID :uint32_t;
reason :int16_t);
+// NPRuntime
+
+simpleroutine GetScriptableNPObject(pluginHostPort :mach_port_t;
+ pluginID :uint32_t);
+
// Replies
simpleroutine EvaluateReply(pluginHostPort :mach_port_t;