https://bugs.webkit.org/show_bug.cgi?id=127380

Add more methods to WKWebProcessPlugInNodeHandle.

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2014-01-22
Reviewed by Sam Weinig.

Add a static method that creates a WKWebProcessPlugInNodeHandle from a JSValue* and a JSContext*.  Also
add a method to return the iframe's content frame from a WKWebProcessPlugInNodeHandle.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]):
(-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162519 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3642be9f
2014-01-22 Yongjun Zhang <yongjun_zhang@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=127380
Add more methods to WKWebProcessPlugInNodeHandle.
Reviewed by Sam Weinig.
Add a static method that creates a WKWebProcessPlugInNodeHandle from a JSValue* and a JSContext*. Also
add a method to return the iframe's content frame from a WKWebProcessPlugInNodeHandle.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]):
(-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]):
2014-01-22 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ build with CUSTOM_PROTOCOL enabled after r162449.
......
......@@ -28,9 +28,16 @@
#if WK_API_ENABLED
#import <Foundation/Foundation.h>
#import <JavaScriptCore/JavaScriptCore.h>
@class WKWebProcessPlugInFrame;
WK_API_CLASS
@interface WKWebProcessPlugInNodeHandle : NSObject
+ (WKWebProcessPlugInNodeHandle *)nodeHandleWithJSValue:(JSValue *)value inContext:(JSContext *)context;
- (WKWebProcessPlugInFrame *)htmlIFrameElementContentFrame;
@end
#endif // WK_API_ENABLED
......@@ -26,6 +26,8 @@
#import "config.h"
#import "WKWebProcessPlugInNodeHandleInternal.h"
#import "WKWebProcessPlugInFrameInternal.h"
#if WK_API_ENABLED
using namespace WebKit;
......@@ -40,6 +42,21 @@ using namespace WebKit;
[super dealloc];
}
+ (WKWebProcessPlugInNodeHandle *)nodeHandleWithJSValue:(JSValue *)value inContext:(JSContext *)context
{
JSContextRef contextRef = [context JSGlobalContextRef];
JSObjectRef objectRef = JSValueToObject(contextRef, [value JSValueRef], 0);
RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(contextRef, objectRef);
return wrapper(*nodeHandle.release().leakRef());
}
- (WKWebProcessPlugInFrame *)htmlIFrameElementContentFrame
{
RefPtr<WebFrame> frame = _nodeHandle->htmlIFrameElementContentFrame();
return wrapper(*frame.release().leakRef());
}
#pragma mark WKObject protocol implementation
- (API::Object&)_apiObject
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment