Changeset 159887 in webkit
- Timestamp:
- Nov 30, 2013 10:49:53 AM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r159884 r159887 1 2013-11-30 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/15560240> ResourceError encoding drops NSURL-valued keys in the NSError’s userInfo, including NSErrorFailingURLKey 4 https://bugs.webkit.org/show_bug.cgi?id=125016 5 6 Reviewed by Anders “happy name day” Carlsson. 7 8 * Shared/mac/WebCoreArgumentCodersMac.mm: 9 (CoreIPC::::encodePlatformData): Encode all string- and URL-valued keys as a dictionary. 10 (CoreIPC::::decodePlatformData): Decode user info as a dictionary. 11 1 12 2013-11-29 Zan Dobersek <zdobersek@igalia.com> 2 13 -
trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm
r159647 r159887 156 156 encoder << code; 157 157 158 HashMap<String, String> stringUserInfoMap; 159 160 NSDictionary* userInfo = [nsError userInfo]; 161 for (NSString *key in userInfo) { 162 id value = [userInfo objectForKey:key]; 163 if (![value isKindOfClass:[NSString class]]) 164 continue; 165 166 stringUserInfoMap.set(key, (NSString *)value); 167 continue; 168 } 169 encoder << stringUserInfoMap; 158 NSDictionary *userInfo = [nsError userInfo]; 159 160 RetainPtr<CFMutableDictionaryRef> filteredUserInfo = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, userInfo.count, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); 161 162 [userInfo enumerateKeysAndObjectsUsingBlock:^(id key, id value, BOOL*) { 163 if ([value isKindOfClass:[NSString class]] || [value isKindOfClass:[NSURL class]]) 164 CFDictionarySetValue(filteredUserInfo.get(), key, value); 165 }]; 166 167 CoreIPC::encode(encoder, filteredUserInfo.get()); 170 168 171 169 id peerCertificateChain = [userInfo objectForKey:@"NSErrorPeerCertificateChainKey"]; … … 193 191 return false; 194 192 195 HashMap<String, String> stringUserInfoMap;196 if (! decoder.decode(stringUserInfoMap))193 RetainPtr<CFDictionaryRef> userInfo; 194 if (!CoreIPC::decode(decoder, userInfo)) 197 195 return false; 198 196 … … 201 199 return false; 202 200 203 NSUInteger userInfoSize = stringUserInfoMap.size(); 204 if (certificate.certificateChain()) 205 userInfoSize++; 206 207 NSMutableDictionary* userInfo = [NSMutableDictionary dictionaryWithCapacity:userInfoSize]; 208 209 HashMap<String, String>::const_iterator it = stringUserInfoMap.begin(); 210 HashMap<String, String>::const_iterator end = stringUserInfoMap.end(); 211 for (; it != end; ++it) 212 [userInfo setObject:nsString(it->value) forKey:nsString(it->key)]; 213 214 if (certificate.certificateChain()) 215 [userInfo setObject:(NSArray *)certificate.certificateChain() forKey:@"NSErrorPeerCertificateChainKey"]; 216 217 RetainPtr<NSError> nsError = adoptNS([[NSError alloc] initWithDomain:nsString(domain) code:code userInfo:userInfo]); 201 if (certificate.certificateChain()) { 202 userInfo = adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, CFDictionaryGetCount(userInfo.get()) + 1, userInfo.get())); 203 CFDictionarySetValue((CFMutableDictionaryRef)userInfo.get(), CFSTR("NSErrorPeerCertificateChainKey"), (CFArrayRef)certificate.certificateChain()); 204 } 205 206 RetainPtr<NSError> nsError = adoptNS([[NSError alloc] initWithDomain:nsString(domain) code:code userInfo:(NSDictionary *)userInfo.get()]); 218 207 219 208 resourceError = ResourceError(nsError.get());
Note: See TracChangeset
for help on using the changeset viewer.