Changeset 102616 in webkit
- Timestamp:
- Dec 12, 2011 1:41:34 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r102615 r102616 1 2011-12-12 Sam Weinig <sam@webkit.org> 2 3 Add WKConnection objective-c wrapper around WKConnectionRef 4 <rdar://problem/10446092> 5 https://bugs.webkit.org/show_bug.cgi?id=74324 6 7 Reviewed by Anders Carlsson. 8 9 * UIProcess/API/mac/WKConnection.h: Added. 10 * UIProcess/API/mac/WKConnection.mm: Added. 11 (-[WKConnection dealloc]): 12 (-[WKConnection connectionRef]): 13 (-[WKConnection delegate]): 14 (-[WKConnection setDelegate:]): 15 (didReceiveMessage): 16 (didClose): 17 (setUpClient): 18 (-[WKConnection initWithConnectionRef:]): 19 * UIProcess/API/mac/WKConnectionInternal.h: Added. 20 Added new class. 21 22 * UIProcess/API/mac/WKProcessGroup.h: 23 * UIProcess/API/mac/WKProcessGroup.mm: 24 (didCreateConnection): 25 (setUpConnectionClient): 26 (-[WKProcessGroup initWithInjectedBundleURL:]): 27 (-[WKProcessGroup delegate]): 28 (-[WKProcessGroup setDelegate:]): 29 Add WKProcessGroupDelegate to inform the user of when connections are established. 30 31 * WebKit2.xcodeproj/project.pbxproj: 32 Add new files. 33 1 34 2011-12-12 Anders Carlsson <andersca@apple.com> 2 35 -
trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm
r101574 r102616 92 92 } 93 93 94 95 94 #pragma mark Loading 96 95 -
trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.h
r98160 r102616 27 27 #import <WebKit2/WKBase.h> 28 28 29 @class WKProcessGroupData; 29 @class WKProcessGroup, WKProcessGroupData, WKConnection; 30 31 @protocol WKProcessGroupDelegate <NSObject> 32 33 - (void)processGroup:(WKProcessGroup *)processGroup didCreateConnectionToWebProcessPlugIn:(WKConnection *)connection; 34 35 @end 30 36 31 37 WK_EXPORT … … 37 43 - (id)initWithInjectedBundleURL:(NSURL *)bundleURL; 38 44 45 46 #pragma mark Delegates 47 48 @property(assign) id<WKProcessGroupDelegate> delegate; 49 39 50 @end -
trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm
r98184 r102616 28 28 #import "WKProcessGroupInternal.h" 29 29 30 #import "WKConnectionInternal.h" 30 31 #import "WKContext.h" 31 32 #import "WKRetainPtr.h" 32 33 #import "WKStringCF.h" 34 #import <wtf/RetainPtr.h> 33 35 34 36 @interface WKProcessGroupData : NSObject { 35 37 @public 38 // Underlying context object. 36 39 WKRetainPtr<WKContextRef> _contextRef; 40 41 // Delegate for callbacks. 42 id<WKProcessGroupDelegate> _delegate; 37 43 } 38 44 @end … … 42 48 43 49 @implementation WKProcessGroup 50 51 static void didCreateConnection(WKContextRef, WKConnectionRef connectionRef, const void* clientInfo) 52 { 53 WKProcessGroup *processGroup = (WKProcessGroup *)clientInfo; 54 if ([processGroup.delegate respondsToSelector:@selector(processGroup:didCreateConnectionToWebProcessPlugIn:)]) { 55 RetainPtr<WKConnection> connection = adoptNS([[WKConnection alloc] initWithConnectionRef:connectionRef]); 56 [processGroup.delegate processGroup:processGroup didCreateConnectionToWebProcessPlugIn:connection.get()]; 57 } 58 } 59 60 static void setUpConnectionClient(WKProcessGroup *processGroup, WKContextRef contextRef) 61 { 62 WKContextConnectionClient connectionClient; 63 memset(&connectionClient, 0, sizeof(connectionClient)); 64 65 connectionClient.version = kWKContextConnectionClientCurrentVersion; 66 connectionClient.clientInfo = processGroup; 67 connectionClient.didCreateConnection = didCreateConnection; 68 69 WKContextSetConnectionClient(contextRef, &connectionClient); 70 } 44 71 45 72 - (id)init … … 61 88 _data->_contextRef = adoptWK(WKContextCreate()); 62 89 90 setUpConnectionClient(self, _data->_contextRef.get()); 91 63 92 return self; 64 93 } … … 68 97 [_data release]; 69 98 [super dealloc]; 99 } 100 101 - (id<WKProcessGroupDelegate>)delegate 102 { 103 return _data->_delegate; 104 } 105 106 - (void)setDelegate:(id<WKProcessGroupDelegate>)delegate 107 { 108 _data->_delegate = delegate; 70 109 } 71 110 -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r102497 r102616 639 639 BC59534210FC04520098F82D /* WebLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC59534010FC04520098F82D /* WebLoaderClient.h */; }; 640 640 BC597075116591D000551FCA /* ProcessModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BC597074116591D000551FCA /* ProcessModel.h */; }; 641 BC5C75C814954DA600BC4775 /* WKConnectionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5C75C614954DA600BC4775 /* WKConnectionInternal.h */; }; 641 642 BC60C5791240A546008C5E29 /* WKBundleRangeHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = BC60C5771240A546008C5E29 /* WKBundleRangeHandle.h */; settings = {ATTRIBUTES = (Private, ); }; }; 642 643 BC60C57A1240A546008C5E29 /* WKBundleRangeHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC60C5781240A546008C5E29 /* WKBundleRangeHandle.cpp */; }; … … 701 702 BCA0EF9F12332642007D3CFB /* WebEditCommandProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA0EF9D12332642007D3CFB /* WebEditCommandProxy.h */; }; 702 703 BCA0EFA012332642007D3CFB /* WebEditCommandProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA0EF9E12332642007D3CFB /* WebEditCommandProxy.cpp */; }; 704 BCA284D61492F2C7001F9042 /* WKConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA284D41492F2C7001F9042 /* WKConnection.mm */; }; 705 BCA284D71492F2C7001F9042 /* WKConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA284D51492F2C7001F9042 /* WKConnection.h */; }; 703 706 BCA56A1C12F9028E00C566C7 /* WebGraphicsContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA56A1A12F9028E00C566C7 /* WebGraphicsContext.h */; }; 704 707 BCA56A1D12F9028E00C566C7 /* WebGraphicsContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA56A1B12F9028E00C566C7 /* WebGraphicsContext.cpp */; }; … … 1658 1661 BC59534010FC04520098F82D /* WebLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebLoaderClient.h; sourceTree = "<group>"; }; 1659 1662 BC597074116591D000551FCA /* ProcessModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessModel.h; sourceTree = "<group>"; }; 1663 BC5C75C614954DA600BC4775 /* WKConnectionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKConnectionInternal.h; sourceTree = "<group>"; }; 1660 1664 BC60C5771240A546008C5E29 /* WKBundleRangeHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleRangeHandle.h; sourceTree = "<group>"; }; 1661 1665 BC60C5781240A546008C5E29 /* WKBundleRangeHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleRangeHandle.cpp; sourceTree = "<group>"; }; … … 1718 1722 BCA0EF9D12332642007D3CFB /* WebEditCommandProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebEditCommandProxy.h; sourceTree = "<group>"; }; 1719 1723 BCA0EF9E12332642007D3CFB /* WebEditCommandProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebEditCommandProxy.cpp; sourceTree = "<group>"; }; 1724 BCA284D41492F2C7001F9042 /* WKConnection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKConnection.mm; sourceTree = "<group>"; }; 1725 BCA284D51492F2C7001F9042 /* WKConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKConnection.h; sourceTree = "<group>"; }; 1720 1726 BCA56A1A12F9028E00C566C7 /* WebGraphicsContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGraphicsContext.h; sourceTree = "<group>"; }; 1721 1727 BCA56A1B12F9028E00C566C7 /* WebGraphicsContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGraphicsContext.cpp; sourceTree = "<group>"; }; … … 3092 3098 BCBAACF0145232480053F82F /* WKBrowsingContextGroupInternal.h */, 3093 3099 BCBAAD0A14560A430053F82F /* WKBrowsingContextLoadDelegate.h */, 3100 BCA284D51492F2C7001F9042 /* WKConnection.h */, 3101 BCA284D41492F2C7001F9042 /* WKConnection.mm */, 3102 BC5C75C614954DA600BC4775 /* WKConnectionInternal.h */, 3094 3103 BCBAACE5145225C90053F82F /* WKProcessGroup.h */, 3095 3104 BCBAACE6145225CA0053F82F /* WKProcessGroup.mm */, … … 4118 4127 3131261F148FF82C00BA2A39 /* NotificationPermissionRequestManager.h in Headers */, 4119 4128 31312621148FF82C00BA2A39 /* WebNotificationManager.h in Headers */, 4129 BCA284D71492F2C7001F9042 /* WKConnection.h in Headers */, 4130 BC5C75C814954DA600BC4775 /* WKConnectionInternal.h in Headers */, 4120 4131 5DA6ED0A1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h in Headers */, 4121 4132 ); … … 4837 4848 3131261E148FF82C00BA2A39 /* NotificationPermissionRequestManager.cpp in Sources */, 4838 4849 31312620148FF82C00BA2A39 /* WebNotificationManager.cpp in Sources */, 4850 BCA284D61492F2C7001F9042 /* WKConnection.mm in Sources */, 4839 4851 5DA6ED0B1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm in Sources */, 4840 4852 );
Note: See TracChangeset
for help on using the changeset viewer.