Diff
Modified: trunk/Source/WebKit2/ChangeLog (160802 => 160803)
--- trunk/Source/WebKit2/ChangeLog 2013-12-18 23:33:59 UTC (rev 160802)
+++ trunk/Source/WebKit2/ChangeLog 2013-12-18 23:50:19 UTC (rev 160803)
@@ -1,3 +1,29 @@
+2013-12-18 Yongjun Zhang <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=125941
+ Add Obj C API for injected bundle PageGroup class.
+
+ Reviewed by Dan Bernstein.
+
+ Add Obj C API (WKWebProcessPlugInPageGroup) for injected bundle PageGroup class. And add APIs to
+ expose the main frame and page group from WKWebProcessPlugInBrowsingContextController.
+
+ * Shared/Cocoa/APIObject.mm:
+ (API::Object::newObject): Create wrapper object for InjectedPageGroup object.
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h: Added.
+ * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm: Added.
+ (-[WKWebProcessPlugInPageGroup identifier]):
+ (-[WKWebProcessPlugInPageGroup dealloc]):
+ (-[WKWebProcessPlugInPageGroup API::]):
+ * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h: Added.
+ (WebKit::wrapper):
+ * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h: Add API to expose the main frame and page group
+ for WKWebPocessPlugInBrowserContextController.
+ * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+ (-[WKWebProcessPlugInBrowserContextController mainFrame]):
+ (-[WKWebProcessPlugInBrowserContextController pageGroup]):
+
2013-12-18 Tim Horton <[email protected]>
PDFPlugin: Never make a NSEventType = 0
Modified: trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm (160802 => 160803)
--- trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm 2013-12-18 23:33:59 UTC (rev 160802)
+++ trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm 2013-12-18 23:50:19 UTC (rev 160803)
@@ -48,6 +48,7 @@
#import "WKWebProcessPlugInHitTestResultInternal.h"
#import "WKWebProcessPlugInInternal.h"
#import "WKWebProcessPlugInNodeHandleInternal.h"
+#import "WKWebProcessPlugInPageGroupInternal.h"
#import "WKWebProcessPlugInScriptWorldInternal.h"
namespace API {
@@ -151,6 +152,10 @@
wrapper = [WKWebProcessPlugInNodeHandle alloc];
break;
+ case Type::BundlePageGroup:
+ wrapper = [WKWebProcessPlugInPageGroup alloc];
+ break;
+
case Type::BundleScriptWorld:
wrapper = [WKWebProcessPlugInScriptWorld alloc];
break;
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (160802 => 160803)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-12-18 23:33:59 UTC (rev 160802)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-12-18 23:50:19 UTC (rev 160803)
@@ -349,6 +349,9 @@
1F7506B61859165700EC0FF7 /* WKWebProcessPlugInNodeHandleInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F0181711858DC1600F92884 /* WKWebProcessPlugInNodeHandleInternal.h */; };
1F7506B71859165A00EC0FF7 /* WKWebProcessPlugInHitTestResultInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F01816E1858DC1600F92884 /* WKWebProcessPlugInHitTestResultInternal.h */; };
1F7506B81859165D00EC0FF7 /* WKWebProcessPlugInFrameInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F01816B1858DC1500F92884 /* WKWebProcessPlugInFrameInternal.h */; };
+ 1FB00AC7185F76460019142E /* WKWebProcessPlugInPageGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FB00AC4185F76460019142E /* WKWebProcessPlugInPageGroup.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 1FB00AC8185F76460019142E /* WKWebProcessPlugInPageGroup.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1FB00AC5185F76460019142E /* WKWebProcessPlugInPageGroup.mm */; };
+ 1FB00AC9185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */; };
1QQ417CB12C00CCA002BE67B /* TextCheckerCompletion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CC417C912C00CCA002BE67B /* TextCheckerCompletion.h */; };
1ZZ417EF12C00D87002BE67B /* TextCheckerCompletion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1BB417C912C00CCA002BE67B /* TextCheckerCompletion.cpp */; };
290F4272172A0C7400939FF0 /* ChildProcessSupplement.h in Headers */ = {isa = PBXBuildFile; fileRef = 290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */; };
@@ -1916,6 +1919,9 @@
1F0181731858DC1600F92884 /* WKWebProcessPlugInScriptWorld.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebProcessPlugInScriptWorld.mm; sourceTree = "<group>"; };
1F0181741858DC1600F92884 /* WKWebProcessPlugInScriptWorldInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInScriptWorldInternal.h; sourceTree = "<group>"; };
1F335BBF185B84D8001A201A /* WKWebProcessPlugInLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInLoadDelegate.h; sourceTree = "<group>"; };
+ 1FB00AC4185F76460019142E /* WKWebProcessPlugInPageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInPageGroup.h; sourceTree = "<group>"; };
+ 1FB00AC5185F76460019142E /* WKWebProcessPlugInPageGroup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebProcessPlugInPageGroup.mm; sourceTree = "<group>"; };
+ 1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInPageGroupInternal.h; sourceTree = "<group>"; };
26659AA0185FAAED004303DD /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; };
290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildProcessSupplement.h; sourceTree = "<group>"; };
293EBEA91627D9C9005F89F1 /* WKDOMText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDOMText.h; sourceTree = "<group>"; };
@@ -3770,6 +3776,9 @@
1F01816F1858DC1600F92884 /* WKWebProcessPlugInNodeHandle.h */,
1F0181701858DC1600F92884 /* WKWebProcessPlugInNodeHandle.mm */,
1F0181711858DC1600F92884 /* WKWebProcessPlugInNodeHandleInternal.h */,
+ 1FB00AC4185F76460019142E /* WKWebProcessPlugInPageGroup.h */,
+ 1FB00AC5185F76460019142E /* WKWebProcessPlugInPageGroup.mm */,
+ 1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */,
1F0181721858DC1600F92884 /* WKWebProcessPlugInScriptWorld.h */,
1F0181731858DC1600F92884 /* WKWebProcessPlugInScriptWorld.mm */,
1F0181741858DC1600F92884 /* WKWebProcessPlugInScriptWorldInternal.h */,
@@ -5947,6 +5956,7 @@
511F8A7B138B460900A95F44 /* SecItemShimLibrary.h in Headers */,
757AF978184D131400E6316E /* IteratorPair.h in Headers */,
E1790891169BAA82006904C7 /* SecItemShimMessages.h in Headers */,
+ 1FB00AC7185F76460019142E /* WKWebProcessPlugInPageGroup.h in Headers */,
E18E690C169B563F009B6670 /* SecItemShimProxy.h in Headers */,
E18E6918169B667B009B6670 /* SecItemShimProxyMessages.h in Headers */,
33152976130D0CB200ED2483 /* SecurityOriginData.h in Headers */,
@@ -6149,6 +6159,7 @@
510AFFBA16542048001BA05E /* WebResourceLoader.h in Headers */,
51F060E01654317F00F3281B /* WebResourceLoaderMessages.h in Headers */,
D3B9484911FF4B6500032B39 /* WebSearchPopupMenu.h in Headers */,
+ 1FB00AC9185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h in Headers */,
F634445612A885C8000612D8 /* WebSecurityOrigin.h in Headers */,
37D0B5C61845218400F6CE7D /* WKErrorRecoveryAttempting.h in Headers */,
BCC5715B115ADAEF001CCAF9 /* WebSystemInterface.h in Headers */,
@@ -7416,6 +7427,7 @@
CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */,
755422BD18062BB20046F6A8 /* WKOriginDataManager.cpp in Sources */,
CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */,
+ 1FB00AC8185F76460019142E /* WKWebProcessPlugInPageGroup.mm in Sources */,
CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */,
CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */,
BC1BE1E112D54A410004A228 /* WebGeolocationClient.cpp in Sources */,
Copied: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h (from rev 160802, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h) (0 => 160803)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h 2013-12-18 23:50:19 UTC (rev 160803)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2013 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. AND ITS 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
+ * 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.
+ */
+
+#import <WebKit2/WKFoundation.h>
+
+#if WK_API_ENABLED
+
+#import <Foundation/Foundation.h>
+
+WK_API_CLASS
+@interface WKWebProcessPlugInPageGroup : NSObject
+
+@property (readonly) NSString *identifier;
+
+@end
+
+#endif // WK_API_ENABLED
Copied: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm (from rev 160802, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h) (0 => 160803)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm 2013-12-18 23:50:19 UTC (rev 160803)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2013 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. AND ITS 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
+ * 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.
+ */
+
+#import "config.h"
+#import "WKWebProcessPlugInPageGroupInternal.h"
+
+#if WK_API_ENABLED
+
+#import "WKBundlePageGroup.h"
+#import "WKAPICast.h"
+#import "WKNSString.h"
+#import "WKRetainPtr.h"
+#import "WebPageGroupProxy.h"
+
+using namespace WebKit;
+
+@implementation WKWebProcessPlugInPageGroup {
+ API::ObjectStorage<WebPageGroupProxy> _bundlePageGroup;
+}
+
+- (NSString *)identifier
+{
+ return _bundlePageGroup->identifier();
+}
+
+- (void)dealloc
+{
+ _bundlePageGroup->~WebPageGroupProxy();
+ [super dealloc];
+}
+
+#pragma mark WKObject protocol implementation
+
+- (API::Object&)_apiObject
+{
+ return *_bundlePageGroup;
+}
+
+@end
+
+#endif // WK_API_ENABLED
Copied: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h (from rev 160802, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h) (0 => 160803)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h 2013-12-18 23:50:19 UTC (rev 160803)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2013 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. AND ITS 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
+ * 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.
+ */
+
+#import "WKWebProcessPlugInPageGroup.h"
+
+#if WK_API_ENABLED
+
+#import "WKBase.h"
+#import "WebPageGroupProxy.h"
+
+namespace WebKit {
+
+inline WKWebProcessPlugInPageGroup *wrapper(WebPageGroupProxy& pageGroup)
+{
+ ASSERT([pageGroup.wrapper() isKindOfClass:[WKWebProcessPlugInPageGroup class]]);
+ return (WKWebProcessPlugInPageGroup *)pageGroup.wrapper();
+}
+
+}
+
+@interface WKWebProcessPlugInPageGroup () <WKObject>
+@end
+
+#endif // WK_API_ENABLED
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h (160802 => 160803)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h 2013-12-18 23:33:59 UTC (rev 160802)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h 2013-12-18 23:50:19 UTC (rev 160803)
@@ -31,15 +31,21 @@
@class WKDOMDocument;
@class WKDOMRange;
+@class WKWebProcessPlugInFrame;
+@class WKWebProcessPlugInPageGroup;
@protocol WKWebProcessPlugInLoadDelegate;
WK_API_CLASS
@interface WKWebProcessPlugInBrowserContextController : NSObject
-@property(readonly) WKDOMDocument *mainFrameDocument;
+@property (readonly) WKDOMDocument *mainFrameDocument;
-@property(readonly) WKDOMRange *selectedRange;
+@property (readonly) WKDOMRange *selectedRange;
+@property (readonly) WKWebProcessPlugInFrame *mainFrame;
+
+@property (readonly) WKWebProcessPlugInPageGroup *pageGroup;
+
@property (weak) id <WKWebProcessPlugInLoadDelegate> loadDelegate;
@end
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (160802 => 160803)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm 2013-12-18 23:33:59 UTC (rev 160802)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm 2013-12-18 23:50:19 UTC (rev 160803)
@@ -40,6 +40,7 @@
#import "WKWebProcessPluginFrameInternal.h"
#import "WKWebProcessPlugInInternal.h"
#import "WKWebProcessPlugInLoadDelegate.h"
+#import "WKWebProcessPlugInPageGroupInternal.h"
#import "WKWebProcessPlugInScriptWorldInternal.h"
#import "WeakObjCPtr.h"
#import "WebPage.h"
@@ -138,6 +139,20 @@
return toWKDOMRange(range.get());
}
+- (WKWebProcessPlugInFrame *)mainFrame
+{
+ WebFrame *webKitMainFrame = _page->mainWebFrame();
+ if (!webKitMainFrame)
+ return nil;
+
+ return wrapper(*webKitMainFrame);
+}
+
+- (WKWebProcessPlugInPageGroup *)pageGroup
+{
+ return wrapper(*_page->pageGroup());
+}
+
#pragma mark WKObject protocol implementation
- (API::Object&)_apiObject