Changeset 160245 in webkit
- Timestamp:
- Dec 6, 2013 1:40:34 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r160227 r160245 1 2013-12-06 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/15606872> REGRESSION (r160148): Mail throws an exception during launch 4 https://bugs.webkit.org/show_bug.cgi?id=125362 5 6 Reviewed by Sam Weinig. 7 8 There were two problems in how WKConnection was made to work with WKObject: first, 9 API::Object::newObject() was not updated to allocate the correct wrapper class, and second, 10 WebConnection has subclasses with additional data members, which don’t fit in the object 11 storage ivar. 12 13 * Shared/Cocoa/APIObject.mm: 14 (API::Object::newObject): Changed to allocate a WKConnection of the required size. 15 * UIProcess/API/Cocoa/WKConnection.mm: 16 Removed _connection ivar. 17 (-[WKConnection dealloc]): Changed to use -_connection accessor instead of ivar. 18 (-[WKConnection setDelegate:]): Ditto. 19 (-[WKConnection sendMessageWithName:body:]): Ditto. 20 (-[WKConnection remoteObjectRegistry]): Ditto. 21 (-[WKConnection _connection]): Added. 22 (-[WKConnection _apiObject]): Changed to return the object in the instance extra storage. 23 1 24 2013-12-06 Dan Bernstein <mitz@apple.com> 2 25 -
trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm
r160227 r160245 34 34 #import "WKBrowsingContextGroupInternal.h" 35 35 #import "WKNSArray.h" 36 #import "WKConnectionInternal.h" 36 37 #import "WKNSDictionary.h" 37 38 #import "WKNSError.h" … … 78 79 case Type::BackForwardListItem: 79 80 wrapper = [WKBackForwardListItem alloc]; 81 break; 82 83 case Type::Connection: 84 wrapper = NSAllocateObject([WKConnection self], size, nullptr); 80 85 break; 81 86 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKConnection.mm
r160191 r160245 41 41 42 42 @implementation WKConnection { 43 API::ObjectStorage<WebConnection> _connection;44 43 RetainPtr<WKRemoteObjectRegistry> _remoteObjectRegistry; 45 46 44 WeakObjCPtr<id <WKConnectionDelegate>> _delegate; 47 45 } … … 49 47 - (void)dealloc 50 48 { 51 _connection->~WebConnection();49 self._connection.~WebConnection(); 52 50 53 51 [super dealloc]; … … 99 97 _delegate = delegate; 100 98 if (delegate) 101 setUpClient(self, *_connection);99 setUpClient(self, self._connection); 102 100 else 103 _connection->initializeConnectionClient(nullptr);101 self._connection.initializeConnectionClient(nullptr); 104 102 } 105 103 … … 107 105 { 108 106 RefPtr<ObjCObjectGraph> wkMessageBody = ObjCObjectGraph::create(messageBody); 109 _connection->postMessage(messageName, wkMessageBody.get());107 self._connection.postMessage(messageName, wkMessageBody.get()); 110 108 } 111 109 … … 113 111 { 114 112 if (!_remoteObjectRegistry) 115 _remoteObjectRegistry = adoptNS([[WKRemoteObjectRegistry alloc] _initWithConnectionRef:toAPI( _connection.get())]);113 _remoteObjectRegistry = adoptNS([[WKRemoteObjectRegistry alloc] _initWithConnectionRef:toAPI(&self._connection)]); 116 114 117 115 return _remoteObjectRegistry.get(); 116 } 117 118 - (WebConnection&)_connection 119 { 120 return *static_cast<WebConnection*>(object_getIndexedIvars(self)); 118 121 } 119 122 … … 122 125 - (API::Object&)_apiObject 123 126 { 124 return * _connection;127 return *static_cast<API::Object*>(object_getIndexedIvars(self)); 125 128 } 126 129
Note: See TracChangeset
for help on using the changeset viewer.