Changeset 236304 in webkit
- Timestamp:
- Sep 20, 2018 8:47:37 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r236291 r236304 1 2018-09-20 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r236289. 4 5 Caused 8 TestWebKitAPI.ContentFiltering test failures. 6 7 Reverted changeset: 8 9 "InjectedBundle parameters often need initialization function 10 called before unarchiving" 11 https://bugs.webkit.org/show_bug.cgi?id=189709 12 https://trac.webkit.org/changeset/236289 13 1 14 2018-09-20 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h
r236289 r236304 169 169 explicit InjectedBundle(const WebProcessCreationParameters&); 170 170 171 #if PLATFORM(COCOA) && WK_API_ENABLED172 void decodeBundleParameters(API::Data*);173 #endif174 175 171 String m_path; 176 172 PlatformBundle m_platformBundle; // This is leaked right now, since we never unload the bundle/module. -
trunk/Source/WebKit/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm
r236289 r236304 99 99 } 100 100 101 #if WK_API_ENABLED 102 if (parameters.bundleParameterData) { 103 auto bundleParameterData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(parameters.bundleParameterData->bytes())) length:parameters.bundleParameterData->size() freeWhenDone:NO]); 104 105 auto unarchiver = secureUnarchiverFromData(bundleParameterData.get()); 106 107 NSDictionary *dictionary = nil; 108 @try { 109 dictionary = [unarchiver.get() decodeObjectOfClass:[NSObject class] forKey:@"parameters"]; 110 ASSERT([dictionary isKindOfClass:[NSDictionary class]]); 111 } @catch (NSException *exception) { 112 LOG_ERROR("Failed to decode bundle parameters: %@", exception); 113 } 114 115 ASSERT(!m_bundleParameters); 116 m_bundleParameters = adoptNS([[WKWebProcessBundleParameters alloc] initWithDictionary:dictionary]); 117 } 118 #endif 119 101 120 if (!initializeFunction) 102 121 initializeFunction = bitwise_cast<WKBundleInitializeFunctionPtr>(CFBundleGetFunctionPointerForName([m_platformBundle _cfBundle], CFSTR("WKBundleInitialize"))); … … 105 124 if (initializeFunction) { 106 125 initializeFunction(toAPI(this), toAPI(initializationUserData)); 107 #if WK_API_ENABLED108 decodeBundleParameters(parameters.bundleParameterData.get());109 #endif110 126 return true; 111 127 } 112 128 113 129 #if WK_API_ENABLED 114 decodeBundleParameters(parameters.bundleParameterData.get());115 116 130 // Otherwise, look to see if the bundle has a principal class 117 131 Class principalClass = [m_platformBundle principalClass]; … … 192 206 return m_classesForCoder.get(); 193 207 } 194 195 void InjectedBundle::decodeBundleParameters(API::Data* bundleParameterDataPtr)196 {197 if (!bundleParameterDataPtr)198 return;199 200 auto bundleParameterData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(bundleParameterDataPtr->bytes())) length:bundleParameterDataPtr->size() freeWhenDone:NO]);201 202 auto unarchiver = secureUnarchiverFromData(bundleParameterData.get());203 204 NSDictionary *dictionary = nil;205 @try {206 dictionary = [unarchiver.get() decodeObjectOfClasses:classesForCoder() forKey:@"parameters"];207 ASSERT([dictionary isKindOfClass:[NSDictionary class]]);208 } @catch (NSException *exception) {209 LOG_ERROR("Failed to decode bundle parameters: %@", exception);210 return;211 }212 213 ASSERT(!m_bundleParameters || m_bundleParameters.get());214 m_bundleParameters = adoptNS([[WKWebProcessBundleParameters alloc] initWithDictionary:dictionary]);215 }216 217 208 #endif 218 209 … … 248 239 NSDictionary *parameters = nil; 249 240 @try { 250 parameters = [unarchiver decodeObjectOfClass es:classesForCoder()forKey:@"parameters"];241 parameters = [unarchiver decodeObjectOfClass:[NSDictionary class] forKey:@"parameters"]; 251 242 } @catch (NSException *exception) { 252 243 LOG_ERROR("Failed to decode bundle parameter: %@", exception); … … 255 246 if (!parameters) 256 247 return; 257 258 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION([parameters isKindOfClass:[NSDictionary class]]);259 248 260 249 if (!m_bundleParameters) {
Note: See TracChangeset
for help on using the changeset viewer.