Changeset 160803 in webkit
- Timestamp:
- Dec 18, 2013 3:50:19 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r160801 r160803 1 2013-12-18 Yongjun Zhang <yongjun_zhang@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=125941 4 Add Obj C API for injected bundle PageGroup class. 5 6 Reviewed by Dan Bernstein. 7 8 Add Obj C API (WKWebProcessPlugInPageGroup) for injected bundle PageGroup class. And add APIs to 9 expose the main frame and page group from WKWebProcessPlugInBrowsingContextController. 10 11 * Shared/Cocoa/APIObject.mm: 12 (API::Object::newObject): Create wrapper object for InjectedPageGroup object. 13 * WebKit2.xcodeproj/project.pbxproj: 14 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h: Added. 15 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm: Added. 16 (-[WKWebProcessPlugInPageGroup identifier]): 17 (-[WKWebProcessPlugInPageGroup dealloc]): 18 (-[WKWebProcessPlugInPageGroup API::]): 19 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h: Added. 20 (WebKit::wrapper): 21 * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h: Add API to expose the main frame and page group 22 for WKWebPocessPlugInBrowserContextController. 23 * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: 24 (-[WKWebProcessPlugInBrowserContextController mainFrame]): 25 (-[WKWebProcessPlugInBrowserContextController pageGroup]): 26 1 27 2013-12-18 Tim Horton <timothy_horton@apple.com> 2 28 -
trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm
r160530 r160803 49 49 #import "WKWebProcessPlugInInternal.h" 50 50 #import "WKWebProcessPlugInNodeHandleInternal.h" 51 #import "WKWebProcessPlugInPageGroupInternal.h" 51 52 #import "WKWebProcessPlugInScriptWorldInternal.h" 52 53 … … 152 153 break; 153 154 155 case Type::BundlePageGroup: 156 wrapper = [WKWebProcessPlugInPageGroup alloc]; 157 break; 158 154 159 case Type::BundleScriptWorld: 155 160 wrapper = [WKWebProcessPlugInScriptWorld alloc]; -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r160787 r160803 350 350 1F7506B71859165A00EC0FF7 /* WKWebProcessPlugInHitTestResultInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F01816E1858DC1600F92884 /* WKWebProcessPlugInHitTestResultInternal.h */; }; 351 351 1F7506B81859165D00EC0FF7 /* WKWebProcessPlugInFrameInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F01816B1858DC1500F92884 /* WKWebProcessPlugInFrameInternal.h */; }; 352 1FB00AC7185F76460019142E /* WKWebProcessPlugInPageGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FB00AC4185F76460019142E /* WKWebProcessPlugInPageGroup.h */; settings = {ATTRIBUTES = (Public, ); }; }; 353 1FB00AC8185F76460019142E /* WKWebProcessPlugInPageGroup.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1FB00AC5185F76460019142E /* WKWebProcessPlugInPageGroup.mm */; }; 354 1FB00AC9185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */; }; 352 355 1QQ417CB12C00CCA002BE67B /* TextCheckerCompletion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CC417C912C00CCA002BE67B /* TextCheckerCompletion.h */; }; 353 356 1ZZ417EF12C00D87002BE67B /* TextCheckerCompletion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1BB417C912C00CCA002BE67B /* TextCheckerCompletion.cpp */; }; … … 1917 1920 1F0181741858DC1600F92884 /* WKWebProcessPlugInScriptWorldInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInScriptWorldInternal.h; sourceTree = "<group>"; }; 1918 1921 1F335BBF185B84D8001A201A /* WKWebProcessPlugInLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInLoadDelegate.h; sourceTree = "<group>"; }; 1922 1FB00AC4185F76460019142E /* WKWebProcessPlugInPageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInPageGroup.h; sourceTree = "<group>"; }; 1923 1FB00AC5185F76460019142E /* WKWebProcessPlugInPageGroup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebProcessPlugInPageGroup.mm; sourceTree = "<group>"; }; 1924 1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInPageGroupInternal.h; sourceTree = "<group>"; }; 1919 1925 26659AA0185FAAED004303DD /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; }; 1920 1926 290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildProcessSupplement.h; sourceTree = "<group>"; }; … … 3771 3777 1F0181701858DC1600F92884 /* WKWebProcessPlugInNodeHandle.mm */, 3772 3778 1F0181711858DC1600F92884 /* WKWebProcessPlugInNodeHandleInternal.h */, 3779 1FB00AC4185F76460019142E /* WKWebProcessPlugInPageGroup.h */, 3780 1FB00AC5185F76460019142E /* WKWebProcessPlugInPageGroup.mm */, 3781 1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */, 3773 3782 1F0181721858DC1600F92884 /* WKWebProcessPlugInScriptWorld.h */, 3774 3783 1F0181731858DC1600F92884 /* WKWebProcessPlugInScriptWorld.mm */, … … 5948 5957 757AF978184D131400E6316E /* IteratorPair.h in Headers */, 5949 5958 E1790891169BAA82006904C7 /* SecItemShimMessages.h in Headers */, 5959 1FB00AC7185F76460019142E /* WKWebProcessPlugInPageGroup.h in Headers */, 5950 5960 E18E690C169B563F009B6670 /* SecItemShimProxy.h in Headers */, 5951 5961 E18E6918169B667B009B6670 /* SecItemShimProxyMessages.h in Headers */, … … 6150 6160 51F060E01654317F00F3281B /* WebResourceLoaderMessages.h in Headers */, 6151 6161 D3B9484911FF4B6500032B39 /* WebSearchPopupMenu.h in Headers */, 6162 1FB00AC9185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h in Headers */, 6152 6163 F634445612A885C8000612D8 /* WebSecurityOrigin.h in Headers */, 6153 6164 37D0B5C61845218400F6CE7D /* WKErrorRecoveryAttempting.h in Headers */, … … 7417 7428 755422BD18062BB20046F6A8 /* WKOriginDataManager.cpp in Sources */, 7418 7429 CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */, 7430 1FB00AC8185F76460019142E /* WKWebProcessPlugInPageGroup.mm in Sources */, 7419 7431 CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */, 7420 7432 CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */, -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h
r160802 r160803 1 1 /* 2 * Copyright (C) 201 2Apple Inc. All rights reserved.2 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 #import <Foundation/Foundation.h> 31 31 32 @class WKDOMDocument; 33 @class WKDOMRange; 34 @protocol WKWebProcessPlugInLoadDelegate; 32 WK_API_CLASS 33 @interface WKWebProcessPlugInPageGroup : NSObject 35 34 36 WK_API_CLASS 37 @interface WKWebProcessPlugInBrowserContextController : NSObject 38 39 @property(readonly) WKDOMDocument *mainFrameDocument; 40 41 @property(readonly) WKDOMRange *selectedRange; 42 43 @property (weak) id <WKWebProcessPlugInLoadDelegate> loadDelegate; 35 @property (readonly) NSString *identifier; 44 36 45 37 @end -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm
r160802 r160803 1 1 /* 2 * Copyright (C) 201 2Apple Inc. All rights reserved.2 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #import <WebKit2/WKFoundation.h> 26 #import "config.h" 27 #import "WKWebProcessPlugInPageGroupInternal.h" 27 28 28 29 #if WK_API_ENABLED 29 30 30 #import <Foundation/Foundation.h> 31 #import "WKBundlePageGroup.h" 32 #import "WKAPICast.h" 33 #import "WKNSString.h" 34 #import "WKRetainPtr.h" 35 #import "WebPageGroupProxy.h" 31 36 32 @class WKDOMDocument; 33 @class WKDOMRange; 34 @protocol WKWebProcessPlugInLoadDelegate; 37 using namespace WebKit; 35 38 36 WK_API_CLASS 37 @interface WKWebProcessPlugInBrowserContextController : NSObject 39 @implementation WKWebProcessPlugInPageGroup { 40 API::ObjectStorage<WebPageGroupProxy> _bundlePageGroup; 41 } 38 42 39 @property(readonly) WKDOMDocument *mainFrameDocument; 43 - (NSString *)identifier 44 { 45 return _bundlePageGroup->identifier(); 46 } 40 47 41 @property(readonly) WKDOMRange *selectedRange; 48 - (void)dealloc 49 { 50 _bundlePageGroup->~WebPageGroupProxy(); 51 [super dealloc]; 52 } 42 53 43 @property (weak) id <WKWebProcessPlugInLoadDelegate> loadDelegate; 54 #pragma mark WKObject protocol implementation 55 56 - (API::Object&)_apiObject 57 { 58 return *_bundlePageGroup; 59 } 44 60 45 61 @end -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h
r160802 r160803 1 1 /* 2 * Copyright (C) 201 2Apple Inc. All rights reserved.2 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #import <WebKit2/WKFoundation.h>26 #import "WKWebProcessPlugInPageGroup.h" 27 27 28 28 #if WK_API_ENABLED 29 29 30 #import <Foundation/Foundation.h> 30 #import "WKBase.h" 31 #import "WebPageGroupProxy.h" 31 32 32 @class WKDOMDocument; 33 @class WKDOMRange; 34 @protocol WKWebProcessPlugInLoadDelegate; 33 namespace WebKit { 35 34 36 WK_API_CLASS 37 @interface WKWebProcessPlugInBrowserContextController : NSObject 35 inline WKWebProcessPlugInPageGroup *wrapper(WebPageGroupProxy& pageGroup) 36 { 37 ASSERT([pageGroup.wrapper() isKindOfClass:[WKWebProcessPlugInPageGroup class]]); 38 return (WKWebProcessPlugInPageGroup *)pageGroup.wrapper(); 39 } 40 41 } 38 42 39 @property(readonly) WKDOMDocument *mainFrameDocument; 40 41 @property(readonly) WKDOMRange *selectedRange; 42 43 @property (weak) id <WKWebProcessPlugInLoadDelegate> loadDelegate; 44 43 @interface WKWebProcessPlugInPageGroup () <WKObject> 45 44 @end 46 45 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h
r160616 r160803 32 32 @class WKDOMDocument; 33 33 @class WKDOMRange; 34 @class WKWebProcessPlugInFrame; 35 @class WKWebProcessPlugInPageGroup; 34 36 @protocol WKWebProcessPlugInLoadDelegate; 35 37 … … 37 39 @interface WKWebProcessPlugInBrowserContextController : NSObject 38 40 39 @property (readonly) WKDOMDocument *mainFrameDocument;41 @property (readonly) WKDOMDocument *mainFrameDocument; 40 42 41 @property(readonly) WKDOMRange *selectedRange; 43 @property (readonly) WKDOMRange *selectedRange; 44 45 @property (readonly) WKWebProcessPlugInFrame *mainFrame; 46 47 @property (readonly) WKWebProcessPlugInPageGroup *pageGroup; 42 48 43 49 @property (weak) id <WKWebProcessPlugInLoadDelegate> loadDelegate; -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm
r160787 r160803 41 41 #import "WKWebProcessPlugInInternal.h" 42 42 #import "WKWebProcessPlugInLoadDelegate.h" 43 #import "WKWebProcessPlugInPageGroupInternal.h" 43 44 #import "WKWebProcessPlugInScriptWorldInternal.h" 44 45 #import "WeakObjCPtr.h" … … 139 140 } 140 141 142 - (WKWebProcessPlugInFrame *)mainFrame 143 { 144 WebFrame *webKitMainFrame = _page->mainWebFrame(); 145 if (!webKitMainFrame) 146 return nil; 147 148 return wrapper(*webKitMainFrame); 149 } 150 151 - (WKWebProcessPlugInPageGroup *)pageGroup 152 { 153 return wrapper(*_page->pageGroup()); 154 } 155 141 156 #pragma mark WKObject protocol implementation 142 157
Note: See TracChangeset
for help on using the changeset viewer.