Changeset 17352 in webkit
- Timestamp:
- Oct 26, 2006, 7:55:45 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r17351 r17352 1 2006-10-26 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Darin, Maciej. 4 5 Removed many uses of NSString *. 6 Moved a few methods from WebCoreFrameBridge to FrameLoader, replacing 7 stringByCollapsingNonPrintingCharacters with a c++ equivalent. 8 9 PLT says no performance regression. 10 11 * WebCore.exp: 12 * bridge/mac/WebCoreFrameBridge.mm: 13 (-[WebCoreFrameBridge receivedData:textEncodingName:]): 14 * loader/mac/FrameLoader.h: 15 * loader/mac/FrameLoader.mm: 16 (WebCore::FrameLoader::setupForReplaceByMIMEType): 17 (WebCore::FrameLoader::load): 18 (WebCore::FrameLoader::canShowMIMEType): 19 (WebCore::FrameLoader::representationExistsForURLScheme): 20 (WebCore::FrameLoader::generatedMIMETypeForURLScheme): 21 (WebCore::FrameLoader::checkContentPolicy): 22 (WebCore::FrameLoader::reloadAllowingStaleData): 23 (WebCore::FrameLoader::invalidatePendingPolicyDecision): 24 (WebCore::FrameLoader::checkNewWindowPolicy): 25 (WebCore::FrameLoader::continueAfterNewWindowPolicy): 26 (WebCore::FrameLoader::transitionToCommitted): 27 (WebCore::FrameLoader::continueLoadRequestAfterNewWindowPolicy): 28 (WebCore::FrameLoader::post): 29 * loader/mac/WebDocumentLoader.h: 30 * loader/mac/WebDocumentLoader.mm: 31 (WebCore::DocumentLoader::doesProgressiveLoad): 32 (WebCore::DocumentLoader::setupForReplaceByMIMEType): 33 (WebCore::DocumentLoader::title): 34 (WebCore::DocumentLoader::setOverrideEncoding): 35 (WebCore::DocumentLoader::overrideEncoding): 36 (WebCore::DocumentLoader::setTitle): 37 * loader/mac/WebFrameLoaderClient.h: 38 * loader/mac/WebMainResourceLoader.mm: 39 (WebCore::MainResourceLoader::continueAfterContentPolicy): 40 1 41 2006-10-26 Timothy Hatcher <timothy@apple.com> 2 42 -
trunk/WebCore/WebCore.exp
r17349 r17352 142 142 __ZN7WebCore11FrameLoader22defersCallbacksChangedEv 143 143 __ZN7WebCore11FrameLoader23addExtraFieldsToRequestEP19NSMutableURLRequestbb 144 __ZN7WebCore11FrameLoader23reloadAllowingStaleDataE P8NSString144 __ZN7WebCore11FrameLoader23reloadAllowingStaleDataERKNS_6StringE 145 145 __ZN7WebCore11FrameLoader23timeOfLastCompletedLoadEv 146 146 __ZN7WebCore11FrameLoader24removePlugInStreamLoaderEPNS_17WebResourceLoaderE … … 148 148 __ZN7WebCore11FrameLoader4loadEP12NSURLRequest 149 149 __ZN7WebCore11FrameLoader4loadEP12NSURLRequestP12NSDictionaryNS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE 150 __ZN7WebCore11FrameLoader4loadEP12NSURLRequest P8NSString151 __ZN7WebCore11FrameLoader4loadEP5NSURL P8NSStringNS_13FrameLoadTypeES4_P7NSEventPNS_7ElementEP12NSDictionary150 __ZN7WebCore11FrameLoader4loadEP12NSURLRequestRKNS_6StringE 151 __ZN7WebCore11FrameLoader4loadEP5NSURLRKNS_6StringENS_13FrameLoadTypeES5_P7NSEventPNS_7ElementEP12NSDictionary 152 152 __ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE 153 153 __ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE 154 154 __ZN7WebCore11FrameLoader6reloadEv 155 __ZN7WebCore11FrameLoader7canLoadEP5NSURLRKNS_6StringERb 155 156 __ZN7WebCore11FrameLoader8safeLoadEP5NSURL 156 157 __ZN7WebCore11FrameLoader9setClientEPNS_17FrameLoaderClientE … … 161 162 __ZN7WebCore14DocumentLoader15detachFromFrameEv 162 163 __ZN7WebCore14DocumentLoader19prepareForLoadStartEv 163 __ZN7WebCore14DocumentLoader19setOverrideEncodingE P8NSString164 __ZN7WebCore14DocumentLoader19setOverrideEncodingERKNS_6StringE 164 165 __ZN7WebCore14DocumentLoader32replaceRequestURLForAnchorScrollEP5NSURL 165 166 __ZN7WebCore14DocumentLoader7requestEv … … 186 187 __ZN7WebCore5RangeD1Ev 187 188 __ZN7WebCore6StringC1EP8NSString 189 __ZN7WebCore6StringC1EP8NSString 190 __ZN7WebCore6StringC1EPKc 188 191 __ZN7WebCore8FrameMac10mouseMovedEP7NSEvent 189 192 __ZN7WebCore8FrameMac10wheelEventEP7NSEvent … … 205 208 __ZN7WebCore9FrameTree11appendChildEN3WTF10PassRefPtrINS_5FrameEEE 206 209 __ZN7WebCore9FrameTree7setNameERKNS_12AtomicStringE 210 __ZNK7WebCore10StringImplcvP8NSStringEv 207 211 __ZNK7WebCore10StringImplcvP8NSStringEv 208 212 __ZNK7WebCore11FrameLoader14documentLoaderEv -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r17349 r17352 10490 10490 isa = PBXProject; 10491 10491 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 10492 compatibilityVersion = "Xcode 2.4";10493 10492 hasScannedForEncodings = 1; 10494 10493 knownRegions = ( … … 10505 10504 projectDirPath = ""; 10506 10505 projectRoot = ""; 10507 shouldCheckCompatibility = 1;10508 10506 targets = ( 10509 10507 93F198A508245E59001E9ABC /* WebCore */, -
trunk/WebCore/bridge/mac/BrowserExtensionMac.mm
r17299 r17352 58 58 const KURL& url = request.m_request.url(); 59 59 60 NSString *frameName = request.m_frameName.isEmpty() ? nil : (NSString*)request.m_frameName; 61 if (frameName) { 62 if (Frame* frame = m_frame->tree()->find(frameName)) { 60 if (!request.m_frameName.isEmpty()) { 61 if (Frame* frame = m_frame->tree()->find(request.m_frameName)) { 63 62 if (!url.isEmpty()) 64 63 Mac(frame)->loadRequest(request, true, nil, nil, nil); -
trunk/WebCore/bridge/mac/FrameMac.mm
r17299 r17352 35 35 #import "ClipboardEvent.h" 36 36 #import "Cursor.h" 37 #import "WebDocumentLoader.h" 37 38 #import "DOMInternal.h" 38 39 #import "DOMWindow.h" … … 188 189 BEGIN_BLOCK_OBJC_EXCEPTIONS; 189 190 190 NSString *referrer;191 String referrer; 191 192 String argsReferrer = request.m_request.httpReferrer(); 192 193 if (!argsReferrer.isEmpty()) … … 195 196 referrer = FrameMac::referrer(); 196 197 197 BOOLhideReferrer;198 if (! [_bridge canLoadURL:request.m_request.url().getNSURL() fromReferrer:referrer hideReferrer:&hideReferrer])198 bool hideReferrer; 199 if (!loader()->canLoad(request.m_request.url().getNSURL(), referrer, hideReferrer)) 199 200 return; 200 201 if (hideReferrer) 201 referrer = nil;202 referrer = String(); 202 203 203 204 WebCoreFrameBridge *targetFrame = Mac(tree()->find(request.m_frameName))->bridge(); … … 627 628 } 628 629 630 // FIXME: Remove this method; it's superfluous. 629 631 void FrameMac::setTitle(const String &title) 630 632 { 631 String text = title; 632 text.replace('\\', backslashAsCurrencySymbol()); 633 634 BEGIN_BLOCK_OBJC_EXCEPTIONS; 635 [_bridge setTitle:text]; 636 END_BLOCK_OBJC_EXCEPTIONS; 633 loader()->documentLoader()->setTitle(title); 637 634 } 638 635 -
trunk/WebCore/bridge/mac/WebCoreFrameBridge.h
r17349 r17352 35 35 class Element; 36 36 class FrameMac; 37 class String; 37 38 } 38 39 … … 211 212 - (void)invalidatePageCache:(NSDictionary *)pageCache; 212 213 213 - (BOOL)canLoadURL:(NSURL *)URL fromReferrer:(NSString *)referrer hideReferrer:(BOOL *)hideReferrer;214 214 - (BOOL)canTargetLoadInFrame:(WebCoreFrameBridge *)targetFrame; 215 215 … … 406 406 - (BOOL)canSaveAsWebArchive; 407 407 408 - (void)setTitle:(NSString *)title;409 408 - (NSURL*)originalRequestURL; 410 409 - (void)frameDetached; … … 437 436 - (void)setStatusText:(NSString *)status; 438 437 439 - (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL 440 referrer:(NSString *)referrer 441 ownerElement:(WebCoreElement *)ownerElement 442 allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height; 438 - (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL referrer:(const WebCore::String&)referrer ownerElement:(WebCoreElement *)ownerElement allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height; 443 439 444 440 - (BOOL)areToolbarsVisible; -
trunk/WebCore/bridge/mac/WebCoreFrameBridge.mm
r17349 r17352 154 154 if (doc) 155 155 doc->updateRendering(); 156 }157 158 static BOOL hasCaseInsensitivePrefix(NSString *string, NSString *prefix)159 {160 return [string rangeOfString:prefix options:(NSCaseInsensitiveSearch | NSAnchoredSearch)].location !=161 NSNotFound;162 156 } 163 157 … … 522 516 } 523 517 524 - (BOOL)canLoadURL:(NSURL *)URL fromReferrer:(NSString *)referrer hideReferrer:(BOOL *)hideReferrer525 {526 BOOL referrerIsWebURL = hasCaseInsensitivePrefix(referrer, @"http:") || hasCaseInsensitivePrefix(referrer, @"https:");527 BOOL referrerIsLocalURL = hasCaseInsensitivePrefix(referrer, @"file:") || hasCaseInsensitivePrefix(referrer, @"applewebdata:");528 BOOL URLIsFileURL = [URL scheme] != NULL && [[URL scheme] compare:@"file" options:(NSCaseInsensitiveSearch|NSLiteralSearch)] == NSOrderedSame;529 BOOL referrerIsSecureURL = hasCaseInsensitivePrefix(referrer, @"https:");530 BOOL URLIsSecureURL = [URL scheme] != NULL && [[URL scheme] compare:@"https" options:(NSCaseInsensitiveSearch|NSLiteralSearch)] == NSOrderedSame;531 532 533 *hideReferrer = !referrerIsWebURL || (referrerIsSecureURL && !URLIsSecureURL);534 return !URLIsFileURL || referrerIsLocalURL;535 }536 537 518 - (void)saveDocumentState 538 519 { … … 2166 2147 } 2167 2148 2168 static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)2169 {2170 NSMutableString *result = [NSMutableString string];2171 static NSCharacterSet *charactersToTurnIntoSpaces = nil;2172 static NSCharacterSet *charactersToNotTurnIntoSpaces = nil;2173 2174 if (charactersToTurnIntoSpaces == nil) {2175 NSMutableCharacterSet *set = [[NSMutableCharacterSet alloc] init];2176 [set addCharactersInRange:NSMakeRange(0x00, 0x21)];2177 [set addCharactersInRange:NSMakeRange(0x7F, 0x01)];2178 charactersToTurnIntoSpaces = [set copy];2179 [set release];2180 charactersToNotTurnIntoSpaces = [[charactersToTurnIntoSpaces invertedSet] retain];2181 }2182 2183 unsigned length = [string length];2184 unsigned position = 0;2185 while (position != length) {2186 NSRange nonSpace = [string rangeOfCharacterFromSet:charactersToNotTurnIntoSpaces2187 options:0 range:NSMakeRange(position, length - position)];2188 if (nonSpace.location == NSNotFound)2189 break;2190 2191 NSRange space = [string rangeOfCharacterFromSet:charactersToTurnIntoSpaces2192 options:0 range:NSMakeRange(nonSpace.location, length - nonSpace.location)];2193 if (space.location == NSNotFound)2194 space.location = length;2195 2196 if (space.location > nonSpace.location) {2197 if (position != 0)2198 [result appendString:@" "];2199 [result appendString:[string substringWithRange:2200 NSMakeRange(nonSpace.location, space.location - nonSpace.location)]];2201 }2202 2203 position = space.location;2204 }2205 2206 return result;2207 }2208 2209 - (void)setTitle:(NSString *)title2210 {2211 if (!m_frame)2212 return;2213 m_frame->loader()->documentLoader()->setTitle(stringByCollapsingNonPrintingCharacters(title));2214 }2215 2216 2149 - (NSURL*)originalRequestURL 2217 2150 { … … 2233 2166 { 2234 2167 // Set the encoding. This only needs to be done once, but it's harmless to do it again later. 2235 NSString *encoding = m_frame ? m_frame->loader()->documentLoader()->overrideEncoding() : nil; 2236 bool userChosen = encoding != nil; 2237 if (!encoding) 2168 String encoding; 2169 if (m_frame) 2170 encoding = m_frame->loader()->documentLoader()->overrideEncoding(); 2171 bool userChosen = !encoding.isNull(); 2172 if (encoding.isNull()) 2238 2173 encoding = textEncodingName; 2239 2174 m_frame->setEncoding(encoding, userChosen); … … 2250 2185 // Since this is a subresource, we can load any URL (we ignore the return value). 2251 2186 // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method. 2252 NSString *referrer = m_frame->referrer();2253 BOOLhideReferrer;2254 [self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer];2187 String referrer = m_frame->referrer(); 2188 bool hideReferrer; 2189 m_frame->loader()->canLoad(URL, referrer, hideReferrer); 2255 2190 if (hideReferrer) 2256 referrer = nil;2191 referrer = String(); 2257 2192 2258 2193 return SubresourceLoader::create(m_frame, resourceLoader, method, URL, customHeaders, referrer); … … 2283 2218 // Since this is a subresource, we can load any URL (we ignore the return value). 2284 2219 // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method. 2285 NSString *referrer = m_frame->referrer();2286 BOOLhideReferrer;2287 [self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer];2220 String referrer = m_frame->referrer(); 2221 bool hideReferrer; 2222 m_frame->loader()->canLoad(URL, referrer, hideReferrer); 2288 2223 if (hideReferrer) 2289 referrer = nil;2224 referrer = String(); 2290 2225 2291 2226 return SubresourceLoader::create(m_frame, resourceLoader, method, URL, customHeaders, postData, referrer); … … 2296 2231 // Since this is a subresource, we can load any URL (we ignore the return value). 2297 2232 // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method. 2298 NSString *referrer = m_frame->referrer();2299 BOOLhideReferrer;2300 [self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer];2233 String referrer = m_frame->referrer(); 2234 bool hideReferrer; 2235 m_frame->loader()->canLoad(URL, referrer, hideReferrer); 2301 2236 if (hideReferrer) 2302 referrer = nil;2237 referrer = String(); 2303 2238 2304 2239 NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL]; … … 2323 2258 [request setCachePolicy:[m_frame->loader()->documentLoader()->request() cachePolicy]]; 2324 2259 2325 if ( referrer)2260 if (!referrer.isNull()) 2326 2261 setHTTPReferrer(request, referrer); 2327 2262 -
trunk/WebCore/loader/mac/FrameLoader.h
r17299 r17352 28 28 29 29 #import "FrameLoaderTypes.h" 30 #import <WebCore/PlatformString.h> 30 31 #import <wtf/Forward.h> 31 32 #import <wtf/HashSet.h> … … 51 52 class FrameLoaderClient; 52 53 class MainResourceLoader; 54 class String; 53 55 class WebResourceLoader; 54 56 … … 66 68 void prepareForLoadStart(); 67 69 void setupForReplace(); 68 void setupForReplaceByMIMEType( NSString *newMIMEType);70 void setupForReplaceByMIMEType(const String& newMIMEType); 69 71 void finalSetupForReplace(DocumentLoader*); 70 72 void safeLoad(NSURL *); 71 73 void load(NSURLRequest *); 72 void load(NSURLRequest *, NSString *frameName);74 void load(NSURLRequest *, const String& frameName); 73 75 void load(NSURLRequest *, NSDictionary *triggeringAaction, FrameLoadType, PassRefPtr<FormState>); 74 76 void load(DocumentLoader*); 75 77 void load(DocumentLoader*, FrameLoadType, PassRefPtr<FormState>); 76 void load(NSURL *, NSString *referrer, FrameLoadType, NSString *target, NSEvent *event, Element* form, NSDictionary *formValues); 78 void load(NSURL *, const String& referrer, FrameLoadType, const String& target, 79 NSEvent *event, Element* form, NSDictionary *formValues); 80 81 bool canLoad(NSURL *, const String& referrer, bool& hideReferrer); 77 82 78 83 // Also not cool. … … 83 88 void cancelMainResourceLoad(); 84 89 void cancelPendingArchiveLoad(WebResourceLoader*); 85 90 86 91 void addPlugInStreamLoader(WebResourceLoader*); 87 92 void removePlugInStreamLoader(WebResourceLoader*); … … 132 137 bool isHostedByObjectElement() const; 133 138 bool isLoadingMainFrame() const; 134 bool canShowMIMEType( NSString *MIMEType) const;135 bool representationExistsForURLScheme( NSString *URLScheme);136 NSString *generatedMIMETypeForURLScheme(NSString *URLScheme);139 bool canShowMIMEType(const String& MIMEType) const; 140 bool representationExistsForURLScheme(const String& URLScheme); 141 String generatedMIMETypeForURLScheme(const String& URLScheme); 137 142 void notifyIconChanged(NSURL *iconURL); 138 143 void checkNavigationPolicy(NSURLRequest *newRequest, id continuationObject, SEL continuationSelector); 139 void checkContentPolicy( NSString *MIMEType, id continuationObject, SEL continuationSelector);144 void checkContentPolicy(const String& MIMEType, id continuationObject, SEL continuationSelector); 140 145 void cancelContentPolicyCheck(); 141 146 void reload(); 142 void reloadAllowingStaleData( NSString *overrideEncoding);147 void reloadAllowingStaleData(const String& overrideEncoding); 143 148 144 149 void didReceiveServerRedirectForProvisionalLoadForFrame(); … … 167 172 void sendRemainingDelegateMessages(id identifier, NSURLResponse *, unsigned length, NSError *); 168 173 NSURLRequest *requestFromDelegate(NSURLRequest *, id& identifier, NSError *& error); 169 void post(NSURL *, NSString *referrer, NSString *target, NSArray *postData, NSString *contentType, NSEvent *, Element* form, NSDictionary *formValues);174 void post(NSURL *, const String& referrer, const String& target, NSArray *postData, const String& contentType, NSEvent *, Element* form, NSDictionary *formValues); 170 175 171 176 void checkLoadComplete(); … … 184 189 void continueLoadRequestAfterNavigationPolicy(NSURLRequest *, FormState*); 185 190 void continueFragmentScrollAfterNavigationPolicy(NSURLRequest *); 186 void continueLoadRequestAfterNewWindowPolicy(NSURLRequest *, NSString *frameName, FormState*);191 void continueLoadRequestAfterNewWindowPolicy(NSURLRequest *, const String& frameName, FormState*); 187 192 #endif 188 193 … … 206 211 207 212 void invalidatePendingPolicyDecision(bool callDefaultAction); 208 void checkNewWindowPolicy(NSURLRequest *, NSDictionary *, NSString *frameName, PassRefPtr<FormState>);213 void checkNewWindowPolicy(NSURLRequest *, NSDictionary *, const String& frameName, PassRefPtr<FormState>); 209 214 void checkNavigationPolicy(NSURLRequest *, DocumentLoader*, PassRefPtr<FormState>, id continuationObject, SEL continuationSelector); 210 215 … … 252 257 253 258 RetainPtr<NSURLRequest> m_policyRequest; 254 RetainPtr<NSString>m_policyFrameName;259 String m_policyFrameName; 255 260 RetainPtr<id> m_policyTarget; 256 261 SEL m_policySelector; -
trunk/WebCore/loader/mac/FrameLoader.mm
r17299 r17352 138 138 } 139 139 140 void FrameLoader::setupForReplaceByMIMEType( NSString *newMIMEType)140 void FrameLoader::setupForReplaceByMIMEType(const String& newMIMEType) 141 141 { 142 142 activeDocumentLoader()->setupForReplaceByMIMEType(newMIMEType); … … 165 165 } 166 166 167 void FrameLoader::load(NSURLRequest *request, NSString *frameName)168 { 169 if ( !frameName) {167 void FrameLoader::load(NSURLRequest *request, const String& frameName) 168 { 169 if (frameName.isNull()) { 170 170 load(request); 171 171 return; … … 194 194 } 195 195 196 void FrameLoader::load(NSURL *URL, NSString *referrer, FrameLoadType newLoadType, NSString *target, NSEvent *event, Element* form, NSDictionary *values)196 void FrameLoader::load(NSURL *URL, const String& referrer, FrameLoadType newLoadType, const String& target, NSEvent *event, Element* form, NSDictionary *values) 197 197 { 198 198 bool isFormSubmission = values != nil; … … 211 211 formState = FormState::create(form, values, bridge()); 212 212 213 if ( target) {213 if (!target.isNull()) { 214 214 Frame* targetFrame = m_frame->tree()->find(target); 215 215 if (targetFrame) 216 targetFrame->loader()->load(URL, referrer, newLoadType, nil, event, form, values);216 targetFrame->loader()->load(URL, referrer, newLoadType, String(), event, form, values); 217 217 else 218 218 checkNewWindowPolicy(request, action, target, formState.release()); … … 315 315 } 316 316 317 bool FrameLoader::canLoad(NSURL *URL, const String& referrer, bool& hideReferrer) 318 { 319 bool referrerIsWebURL = referrer.startsWith("http:", false) || referrer.startsWith("https:", false); 320 bool referrerIsLocalURL = referrer.startsWith("file:", false) || referrer.startsWith("applewebdata:"); 321 bool URLIsFileURL = [URL scheme] && [[URL scheme] compare:@"file" options:(NSCaseInsensitiveSearch|NSLiteralSearch)] == NSOrderedSame; 322 bool referrerIsSecureURL = referrer.startsWith("https:", false); 323 bool URLIsSecureURL = [URL scheme] && [[URL scheme] compare:@"https" options:(NSCaseInsensitiveSearch|NSLiteralSearch)] == NSOrderedSame; 324 325 hideReferrer = !referrerIsWebURL || (referrerIsSecureURL && !URLIsSecureURL); 326 return !URLIsFileURL || referrerIsLocalURL; 327 } 328 317 329 bool FrameLoader::startLoadingMainResource(NSMutableURLRequest *request, id identifier) 318 330 { … … 972 984 } 973 985 974 bool FrameLoader::canShowMIMEType( NSString *MIMEType) const986 bool FrameLoader::canShowMIMEType(const String& MIMEType) const 975 987 { 976 988 return m_client->canShowMIMEType(MIMEType); 977 989 } 978 990 979 bool FrameLoader::representationExistsForURLScheme( NSString *URLScheme)991 bool FrameLoader::representationExistsForURLScheme(const String& URLScheme) 980 992 { 981 993 return m_client->representationExistsForURLScheme(URLScheme); 982 994 } 983 995 984 NSString *FrameLoader::generatedMIMETypeForURLScheme(NSString *URLScheme)996 String FrameLoader::generatedMIMETypeForURLScheme(const String& URLScheme) 985 997 { 986 998 return m_client->generatedMIMETypeForURLScheme(URLScheme); … … 992 1004 } 993 1005 994 void FrameLoader::checkContentPolicy( NSString *MIMEType, id obj, SEL sel)1006 void FrameLoader::checkContentPolicy(const String& MIMEType, id obj, SEL sel) 995 1007 { 996 1008 WebPolicyDecider *d = m_client->createPolicyDecider(obj, sel); … … 1029 1041 } 1030 1042 1031 void FrameLoader::reloadAllowingStaleData( NSString *encoding)1043 void FrameLoader::reloadAllowingStaleData(const String& encoding) 1032 1044 { 1033 1045 if (!m_documentLoader) … … 1171 1183 m_policyDecider = nil; 1172 1184 1173 bool hadFrameName = m_policyFrameName;1185 bool hadFrameName = !m_policyFrameName.isNull(); 1174 1186 RetainPtr<id> target = m_policyTarget; 1175 1187 SEL selector = m_policySelector; 1176 1188 1177 1189 m_policyRequest = nil; 1178 m_policyFrameName = nil;1190 m_policyFrameName = String(); 1179 1191 m_policyTarget = nil; 1180 1192 m_policyFormState = 0; … … 1188 1200 } 1189 1201 1190 void FrameLoader::checkNewWindowPolicy(NSURLRequest *request, NSDictionary *action, 1191 NSString *frameName, PassRefPtr<FormState> formState) 1202 void FrameLoader::checkNewWindowPolicy(NSURLRequest *request, NSDictionary *action, const String& frameName, PassRefPtr<FormState> formState) 1192 1203 { 1193 1204 WebPolicyDecider *decider = m_client->createPolicyDecider(asDelegate(), … … 1209 1220 { 1210 1221 RetainPtr<NSURLRequest> request = m_policyRequest; 1211 RetainPtr<NSString>frameName = m_policyFrameName;1222 String frameName = m_policyFrameName; 1212 1223 RetainPtr<id> target = m_policyTarget; 1213 1224 SEL selector = m_policySelector; … … 1228 1239 } 1229 1240 1230 objc_msgSend(target.get(), selector, request.get(), frameName.get(), formState.get()); 1241 NSString *frameNameAsNSString = frameName; 1242 objc_msgSend(target.get(), selector, request.get(), frameNameAsNSString, formState.get()); 1231 1243 } 1232 1244 … … 1418 1430 // Handle adding the URL to the back/forward list. 1419 1431 DocumentLoader* dl = m_documentLoader.get(); 1420 NSString *ptitle = dl->title();1432 String ptitle = dl->title(); 1421 1433 1422 1434 switch (m_loadType) { … … 1468 1480 1469 1481 // If we have a title let the WebView know about it. 1470 if ( ptitle)1482 if (!ptitle.isNull()) 1471 1483 m_client->dispatchDidReceiveTitle(ptitle); 1472 1484 } … … 1557 1569 } 1558 1570 1559 void FrameLoader::continueLoadRequestAfterNewWindowPolicy(NSURLRequest *request, NSString *frameName, FormState* formState)1571 void FrameLoader::continueLoadRequestAfterNewWindowPolicy(NSURLRequest *request, const String& frameName, FormState* formState) 1560 1572 { 1561 1573 if (!request) … … 1602 1614 } 1603 1615 1604 void FrameLoader::post(NSURL *URL, NSString *referrer, NSString *target, NSArray *postData,1605 NSString *contentType, NSEvent *event, Element* form, NSDictionary *formValues)1616 void FrameLoader::post(NSURL *URL, const String& referrer, const String& target, NSArray *postData, 1617 const String& contentType, NSEvent *event, Element* form, NSDictionary *formValues) 1606 1618 { 1607 1619 // When posting, use the NSURLRequestReloadIgnoringCacheData load flag. -
trunk/WebCore/loader/mac/LoaderNSURLRequestExtras.m
r17025 r17352 45 45 #define WebReferrer (@"Referer") 46 46 47 void setHTTPReferrer(NSMutableURLRequest *request, NSString * theReferrer)47 void setHTTPReferrer(NSMutableURLRequest *request, NSString *referrer) 48 48 { 49 49 // Do not set the referrer to a string that refers to a file URL. 50 50 // That is a potential security hole. 51 if (stringIsFileURL( theReferrer))51 if (stringIsFileURL(referrer)) 52 52 return; 53 53 54 54 // Don't allow empty Referer: headers; some servers refuse them 55 if([ theReferrer length] == 0)56 theReferrer = nil;55 if([referrer length] == 0) 56 referrer = nil; 57 57 58 [request setValue: theReferrer forHTTPHeaderField:WebReferrer];58 [request setValue:referrer forHTTPHeaderField:WebReferrer]; 59 59 } 60 60 -
trunk/WebCore/loader/mac/WebDocumentLoader.h
r17245 r17352 29 29 #include "RetainPtr.h" 30 30 #include "Shared.h" 31 #include "PlatformString.h" 31 32 #include <wtf/Vector.h> 32 33 … … 68 69 void updateLoading(); 69 70 void receivedData(NSData *); 70 void setupForReplaceByMIMEType( NSString *newMIMEType);71 void setupForReplaceByMIMEType(const String& newMIMEType); 71 72 void finishedLoading(); 72 73 NSURLResponse *response() const; … … 79 80 bool isLoadingInAPISense() const; 80 81 void setPrimaryLoadComplete(bool); 81 void setTitle( NSString *);82 NSString *overrideEncoding() const;82 void setTitle(const String&); 83 String overrideEncoding() const; 83 84 void addResponse(NSURLResponse *); 84 85 const ResponseVector& responses() const; 85 86 NSDictionary *triggeringAction() const; 86 87 void setTriggeringAction(NSDictionary *); 87 void setOverrideEncoding( NSString *);88 void setOverrideEncoding(const String&); 88 89 void setLastCheckedRequest(NSURLRequest *request); 89 90 NSURLRequest *lastCheckedRequest() const; 90 91 void stopRecordingResponses(); 91 NSString *title() const;92 String title() const; 92 93 NSURL *URLForHistory() const; 93 94 … … 101 102 void setMainDocumentError(NSError *); 102 103 void commitLoad(NSData *); 103 bool doesProgressiveLoad( NSString *MIMEType) const;104 bool doesProgressiveLoad(const String& MIMEType) const; 104 105 105 106 Frame* m_frame; … … 136 137 bool m_isClientRedirect; 137 138 138 RetainPtr<NSString>m_pageTitle;139 String m_pageTitle; 139 140 140 RetainPtr<NSString> m_encoding; 141 RetainPtr<NSString> m_overrideEncoding; 141 String m_overrideEncoding; 142 142 143 143 // The action that triggered loading - we keep this around for the -
trunk/WebCore/loader/mac/WebDocumentLoader.mm
r17299 r17352 32 32 #import "FrameLoader.h" 33 33 #import "FrameMac.h" 34 #import "PlatformString.h" 34 35 #import "WebCoreFrameBridge.h" 35 36 #import "WebCoreSystemInterface.h" … … 38 39 39 40 namespace WebCore { 41 42 /* 43 * Performs three operations: 44 * 1. Convert backslashes to currency symbols 45 * 2. Convert control characters to spaces 46 * 3. Trim leading and trailing spaces 47 */ 48 static inline String canonicalizedTitle(const String& title, Frame* frame) 49 { 50 ASSERT(!title.isEmpty()); 51 52 const UChar* characters = title.characters(); 53 unsigned length = title.length(); 54 unsigned i; 55 56 // Find the first non-canonical character 57 for (i = 0; i < length; ++i) { 58 UChar c = characters[i]; 59 if (c < 0x20 || c == 0x7F || c == '\\') 60 break; 61 } 62 63 // Optimization for titles that have no non-canonical characters and no leading or trailing spaces 64 if (i == length && characters[0] != ' ' && characters[length - 1] != ' ') 65 return title; 66 67 Vector<UChar> stringBuilder(length); 68 unsigned builderIndex = 0; 69 70 // Skip leading spaces and leading characters that would convert to spaces 71 for (i = 0; i < length; ++i) { 72 UChar c = characters[i]; 73 if (!(c <= 0x20 || c == 0x7F)) 74 break; 75 } 76 77 // Replace control characters with spaces, and backslashes with currency symbols 78 for (; i < length; ++i) { 79 UChar c = characters[i]; 80 if (c < 0x20 || c == 0x7F) 81 c = ' '; 82 else if (c == '\\') 83 c = frame->backslashAsCurrencySymbol(); 84 stringBuilder[builderIndex++] = c; 85 } 86 87 // Strip trailing spaces 88 while (--builderIndex > 0) 89 if (stringBuilder[builderIndex] != ' ') 90 break; 91 92 if (builderIndex == 0 && stringBuilder[builderIndex] == ' ') 93 return ""; 94 95 stringBuilder.resize(builderIndex + 1); 96 return String::adopt(stringBuilder); 97 } 40 98 41 99 DocumentLoader::DocumentLoader(NSURLRequest *req) … … 299 357 } 300 358 301 bool DocumentLoader::doesProgressiveLoad( NSString *MIMEType) const302 { 303 return !frameLoader()->isReplacing() || [MIMEType isEqualToString:@"text/html"];359 bool DocumentLoader::doesProgressiveLoad(const String& MIMEType) const 360 { 361 return !frameLoader()->isReplacing() || MIMEType == "text/html"; 304 362 } 305 363 … … 311 369 } 312 370 313 void DocumentLoader::setupForReplaceByMIMEType( NSString *newMIMEType)371 void DocumentLoader::setupForReplaceByMIMEType(const String& newMIMEType) 314 372 { 315 373 if (!m_gotFirstByte) 316 374 return; 317 375 318 NSString *oldMIMEType = [m_response.get() MIMEType];376 String oldMIMEType = [m_response.get() MIMEType]; 319 377 320 378 if (!doesProgressiveLoad(oldMIMEType)) { … … 440 498 } 441 499 442 NSString *DocumentLoader::title() const443 { 444 return [[m_pageTitle.get() retain] autorelease];500 String DocumentLoader::title() const 501 { 502 return m_pageTitle; 445 503 } 446 504 … … 474 532 } 475 533 476 void DocumentLoader::setOverrideEncoding(NSString *enc) 477 { 478 NSString *copy = [enc copy]; 479 m_overrideEncoding = copy; 480 [copy release]; 481 } 482 483 NSString *DocumentLoader::overrideEncoding() const 484 { 485 return [[m_overrideEncoding.get() copy] autorelease]; 486 } 487 488 void DocumentLoader::setTitle(NSString *title) 489 { 490 if (!title) 534 void DocumentLoader::setOverrideEncoding(const String& enc) 535 { 536 m_overrideEncoding = enc; 537 } 538 539 String DocumentLoader::overrideEncoding() const 540 { 541 return m_overrideEncoding; 542 } 543 544 void DocumentLoader::setTitle(const String& title) 545 { 546 if (title.isEmpty()) 491 547 return; 492 548 493 NSString *trimmed = [title mutableCopy]; 494 CFStringTrimWhitespace((CFMutableStringRef)trimmed); 495 496 if ([trimmed length] != 0 && ![m_pageTitle.get() isEqualToString:trimmed]) { 497 NSString *copy = [trimmed copy]; 549 String trimmed = canonicalizedTitle(title, m_frame); 550 if (!trimmed.isEmpty() && m_pageTitle != trimmed) { 498 551 frameLoader()->willChangeTitle(this); 499 m_pageTitle = copy;552 m_pageTitle = trimmed; 500 553 frameLoader()->didChangeTitle(this); 501 [copy release]; 502 } 503 504 [trimmed release]; 554 } 505 555 } 506 556 -
trunk/WebCore/loader/mac/WebFrameLoaderClient.h
r17280 r17352 37 37 class Element; 38 38 class Frame; 39 class String; 39 40 class WebResourceLoader; 40 41 … … 104 105 virtual void dispatchDidReceiveIcon(NSImage *) = 0; 105 106 virtual void dispatchDidStartProvisionalLoad() = 0; 106 virtual void dispatchDidReceiveTitle( NSString *title) = 0;107 virtual void dispatchDidReceiveTitle(const String& title) = 0; 107 108 virtual void dispatchDidCommitLoad() = 0; 108 109 virtual void dispatchDidFailProvisionalLoad(NSError *) = 0; … … 114 115 virtual void dispatchShow() = 0; 115 116 116 virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, NSString *MIMEType, NSURLRequest *) = 0;117 virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, NSString *frameName) = 0;117 virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, const String& MIMEType, NSURLRequest *) = 0; 118 virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, const String& frameName) = 0; 118 119 virtual void dispatchDecidePolicyForNavigationAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *) = 0; 119 120 virtual void dispatchUnableToImplementPolicy(NSError *) = 0; … … 165 166 166 167 virtual bool canHandleRequest(NSURLRequest *) const = 0; 167 virtual bool canShowMIMEType( NSString *MIMEType) const = 0;168 virtual bool representationExistsForURLScheme( NSString *URLScheme) const = 0;169 virtual NSString *generatedMIMETypeForURLScheme(NSString *URLScheme) const = 0;168 virtual bool canShowMIMEType(const String& MIMEType) const = 0; 169 virtual bool representationExistsForURLScheme(const String& URLScheme) const = 0; 170 virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const = 0; 170 171 171 172 virtual NSDictionary *elementForEvent(NSEvent *) const = 0; -
trunk/WebCore/loader/mac/WebMainResourceLoader.mm
r17299 r17352 31 31 32 32 #import "FrameLoader.h" 33 #import "PlatformString.h" 33 34 #import "WebCoreSystemInterface.h" 34 35 #import "WebDataProtocol.h" … … 196 197 } 197 198 198 static bool isCaseInsensitiveEqual(NSString *a, NSString *b)199 {200 return [a caseInsensitiveCompare:b] == NSOrderedSame;201 }202 203 199 static bool shouldLoadAsEmptyDocument(NSURL *url) 204 200 { … … 218 214 { 219 215 NSURL *URL = [request() URL]; 220 NSString *MIMEType = [r MIMEType];216 String MIMEType = [r MIMEType]; 221 217 222 218 switch (contentPolicy) { … … 224 220 // Prevent remote web archives from loading because they can claim to be from any domain and thus avoid cross-domain security checks (4120255). 225 221 bool isRemote = ![URL isFileURL] && ![WebDataProtocol _webIsDataProtocolURL:URL]; 226 bool isRemoteWebArchive = isRemote && isCaseInsensitiveEqual(@"application/x-webarchive", MIMEType);222 bool isRemoteWebArchive = isRemote && equalIgnoringCase("application/x-webarchive", MIMEType); 227 223 if (!frameLoader()->canShowMIMEType(MIMEType) || isRemoteWebArchive) { 228 224 frameLoader()->cannotShowMIMEType(r); -
trunk/WebCore/loader/mac/WebSubresourceLoader.h
r17294 r17352 32 32 namespace WebCore { 33 33 34 class String; 35 34 36 class SubresourceLoader : public WebResourceLoader { 35 37 public: 36 38 static id <WebCoreResourceHandle> create(Frame*, id <WebCoreResourceLoader>, 37 NSString *method, NSURL *URL, NSDictionary *customHeaders, NSString *referrer);39 const String& method, NSURL *URL, NSDictionary *customHeaders, const String& referrer); 38 40 static id <WebCoreResourceHandle> create(Frame*, id <WebCoreResourceLoader>, 39 NSString *method, NSURL *URL, NSDictionary *customHeaders, NSArray *postData, NSString *referrer);41 const String& method, NSURL *URL, NSDictionary *customHeaders, NSArray *postData, const String& referrer); 40 42 41 43 virtual ~SubresourceLoader(); … … 49 51 private: 50 52 static id <WebCoreResourceHandle> create(Frame*, id <WebCoreResourceLoader>, 51 NSMutableURLRequest *, NSDictionary *customHeaders, NSString *referrer);53 NSMutableURLRequest *, NSDictionary *customHeaders, const String& referrer); 52 54 53 55 SubresourceLoader(Frame*, id <WebCoreResourceLoader>); -
trunk/WebCore/loader/mac/WebSubresourceLoader.mm
r17299 r17352 65 65 66 66 id <WebCoreResourceHandle> SubresourceLoader::create(Frame* frame, id <WebCoreResourceLoader> rLoader, 67 NSMutableURLRequest *newRequest, NSDictionary *customHeaders, NSString *referrer)67 NSMutableURLRequest *newRequest, NSDictionary *customHeaders, const String& referrer) 68 68 { 69 69 FrameLoader* fl = frame->loader(); … … 99 99 100 100 id <WebCoreResourceHandle> SubresourceLoader::create(Frame* frame, id <WebCoreResourceLoader> rLoader, 101 NSString *method, NSURL *URL, NSDictionary *customHeaders, NSString *referrer)101 const String& method, NSURL *URL, NSDictionary *customHeaders, const String& referrer) 102 102 { 103 103 NSMutableURLRequest *newRequest = [[NSMutableURLRequest alloc] initWithURL:URL]; … … 109 109 110 110 id <WebCoreResourceHandle> SubresourceLoader::create(Frame* frame, id <WebCoreResourceLoader> rLoader, 111 NSString *method, NSURL *URL, NSDictionary *customHeaders, NSArray *postData, NSString *referrer)111 const String& method, NSURL *URL, NSDictionary *customHeaders, NSArray *postData, const String& referrer) 112 112 { 113 113 NSMutableURLRequest *newRequest = [[NSMutableURLRequest alloc] initWithURL:URL]; -
trunk/WebKit/ChangeLog
r17349 r17352 1 2006-10-26 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Darin, Maciej. 4 5 Removed many uses of NSString * from WebCore. 6 7 Changed a few files to ObjC++ for compatiblity with new WebCore methods 8 taking WebCore::Strings as arguments. 9 10 Added a static_cast to make the c++ compiler happy. 11 1 12 2006-10-26 John Sullivan <sullivan@apple.com> 2 13 … … 1846 1857 2006-10-09 Maciej Stachowiak <mjs@apple.com> 1847 1858 1848 >>>>>>> .r169351849 1859 Reviewed by Alice. 1850 1860 -
trunk/WebKit/Misc/WebElementDictionary.m
r16873 r17352 55 55 static void addLookupKey(NSString *key, SEL selector, WebElementTargetObject target) 56 56 { 57 WebElementMethod *elementMethod = malloc(sizeof(WebElementMethod));57 WebElementMethod *elementMethod = static_cast<WebElementMethod*>(malloc(sizeof(WebElementMethod))); 58 58 elementMethod->target = target; 59 59 elementMethod->selector = selector; -
trunk/WebKit/Plugins/WebNetscapePluginStream.mm
r17299 r17352 55 55 WebBaseNetscapePluginView *view = (WebBaseNetscapePluginView *)thePluginPointer->ndata; 56 56 57 WebFrameBridge *bridge = [[view webFrame] _bridge]; 58 BOOL hideReferrer; 59 if (![bridge canLoadURL:[theRequest URL] fromReferrer:core([view webFrame])->referrer() hideReferrer:&hideReferrer]) 57 bool hideReferrer; 58 if (!core([view webFrame])->loader()->canLoad([theRequest URL], core([view webFrame])->referrer(), hideReferrer)) 60 59 return nil; 61 60 -
trunk/WebKit/Plugins/WebPluginContainerCheck.m
r17299 r17352 42 42 #import <Foundation/NSURLRequest.h> 43 43 #import <JavaScriptCore/Assertions.h> 44 #import <WebCore/FrameLoader.h> 44 45 #import <WebCore/FrameLoaderTypes.h> 46 #import <WebCore/FrameMac.h> 45 47 #import <objc/objc-runtime.h> 46 48 … … 94 96 - (BOOL)_isForbiddenFileLoad 95 97 { 96 BOOLignore;98 bool ignore; 97 99 WebFrameBridge *bridge = [_controller bridge]; 98 100 ASSERT(bridge); 99 if (![bridge canLoadURL:[_request URL] fromReferrer:[_controller URLPolicyCheckReferrer] hideReferrer:&ignore]) {101 if (![bridge _frame]->loader()->canLoad([_request URL], [_controller URLPolicyCheckReferrer], ignore)) { 100 102 [self _continueWithPolicy:PolicyIgnore]; 101 103 return YES; -
trunk/WebKit/Plugins/WebPluginController.mm
r17290 r17352 32 32 #import <Foundation/NSURLRequest.h> 33 33 #import <WebCore/FrameLoader.h> 34 #import <WebCore/PlatformString.h> 34 35 #import <WebCore/WebCoreFrameBridge.h> 35 36 #import <WebCore/WebDocumentLoader.h> -
trunk/WebKit/WebCoreSupport/WebFrameBridge.mm
r17299 r17352 543 543 - (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName 544 544 withURL:(NSURL *)URL 545 referrer:( NSString *)referrer545 referrer:(const String&)referrer 546 546 ownerElement:(WebCoreElement *)ownerElement 547 547 allowsScrolling:(BOOL)allowsScrolling … … 549 549 marginHeight:(int)height 550 550 { 551 BOOLhideReferrer;552 if (! [self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer])551 bool hideReferrer; 552 if (!m_frame->loader()->canLoad(URL, referrer, hideReferrer)) 553 553 return nil; 554 554 … … 569 569 return nil; 570 570 571 [_frame _loadURL:URL referrer:(hideReferrer ? nil: referrer) intoChild:[newBridge webFrame]];571 [_frame _loadURL:URL referrer:(hideReferrer ? String() : referrer) intoChild:[newBridge webFrame]]; 572 572 573 573 return newBridge; … … 733 733 loadManually:(BOOL)loadManually 734 734 { 735 BOOLhideReferrer;736 if (! [self canLoadURL:URL fromReferrer:m_frame->referrer() hideReferrer:&hideReferrer])735 bool hideReferrer; 736 if (!m_frame->loader()->canLoad(URL, m_frame->referrer(), hideReferrer)) 737 737 return nil; 738 738 -
trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.h
r17280 r17352 31 31 32 32 @class WebFrame; 33 34 namespace WebCore { 35 class String; 36 } 33 37 34 38 class WebFrameLoaderClient : public WebCore::FrameLoaderClient { … … 98 102 virtual void dispatchDidReceiveIcon(NSImage *); 99 103 virtual void dispatchDidStartProvisionalLoad(); 100 virtual void dispatchDidReceiveTitle( NSString *title);104 virtual void dispatchDidReceiveTitle(const WebCore::String& title); 101 105 virtual void dispatchDidCommitLoad(); 102 106 virtual void dispatchDidFailProvisionalLoad(NSError *); … … 108 112 virtual void dispatchShow(); 109 113 110 virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, NSString *MIMEType, NSURLRequest *);111 virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, NSString *frameName);114 virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, const WebCore::String& MIMEType, NSURLRequest *); 115 virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, const WebCore::String& frameName); 112 116 virtual void dispatchDecidePolicyForNavigationAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *); 113 117 virtual void dispatchUnableToImplementPolicy(NSError *); … … 159 163 160 164 virtual bool canHandleRequest(NSURLRequest *) const; 161 virtual bool canShowMIMEType( NSString *MIMEType) const;162 virtual bool representationExistsForURLScheme( NSString *URLScheme) const;163 virtual NSString *generatedMIMETypeForURLScheme(NSString *URLScheme) const;165 virtual bool canShowMIMEType(const WebCore::String& MIMEType) const; 166 virtual bool representationExistsForURLScheme(const WebCore::String& URLScheme) const; 167 virtual WebCore::String generatedMIMETypeForURLScheme(const WebCore::String& URLScheme) const; 164 168 165 169 virtual NSDictionary *elementForEvent(NSEvent *) const; -
trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.mm
r17299 r17352 31 31 #import "WebFrameInternal.h" 32 32 #import <WebCore/FrameMac.h> 33 #import <WebCore/PlatformString.h> 33 34 #import <WebCore/WebCoreFrameBridge.h> 34 35 #import <WebCore/WebDocumentLoader.h> … … 281 282 } 282 283 283 void WebFrameLoaderClient::dispatchDidReceiveTitle( NSString *title)284 void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title) 284 285 { 285 286 [m_webFrame.get() _dispatchDidReceiveTitle:title]; … … 321 322 } 322 323 323 void WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(WebPolicyDecider *decider, NSString *MIMEType, 324 NSURLRequest *request) 324 void WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(WebPolicyDecider *decider, const String& MIMEType, NSURLRequest *request) 325 325 { 326 326 [m_webFrame.get() _dispatchDecidePolicyForMIMEType:MIMEType request:request decider:decider]; 327 327 } 328 328 329 void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *decider, NSDictionary *action, 330 NSURLRequest *request, NSString *frameName) 329 void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *decider, NSDictionary *action, NSURLRequest *request, const String& frameName) 331 330 { 332 331 [m_webFrame.get() _dispatchDecidePolicyForNewWindowAction:action request:request newFrameName:frameName … … 507 506 } 508 507 509 bool WebFrameLoaderClient::canShowMIMEType( NSString *MIMEType) const508 bool WebFrameLoaderClient::canShowMIMEType(const String& MIMEType) const 510 509 { 511 510 return [m_webFrame.get() _canShowMIMEType:MIMEType]; 512 511 } 513 512 514 bool WebFrameLoaderClient::representationExistsForURLScheme( NSString *URLScheme) const513 bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLScheme) const 515 514 { 516 515 return [m_webFrame.get() _representationExistsForURLScheme:URLScheme]; 517 516 } 518 517 519 NSString *WebFrameLoaderClient::generatedMIMETypeForURLScheme(NSString *URLScheme) const518 String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& URLScheme) const 520 519 { 521 520 return [m_webFrame.get() _generatedMIMETypeForURLScheme:URLScheme]; -
trunk/WebKit/WebKit.xcodeproj/project.pbxproj
r17299 r17352 334 334 3944607E020F50ED0ECA1767 /* WebBackForwardList.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebBackForwardList.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 335 335 3944607F020F50ED0ECA1767 /* WebHistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItem.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 336 39446080020F50ED0ECA1767 /* WebHistoryItem.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebHistoryItem.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };336 39446080020F50ED0ECA1767 /* WebHistoryItem.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; indentWidth = 4; path = WebHistoryItem.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 337 337 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; }; 338 338 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClient.mm; sourceTree = "<group>"; }; … … 420 420 83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginViewFactoryPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 421 421 84311A1205EAAAF00088EDA4 /* WebResource.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResource.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 422 84311A1305EAAAF00088EDA4 /* WebResource.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebResource.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };422 84311A1305EAAAF00088EDA4 /* WebResource.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebResource.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 423 423 84311AF105EAB12B0088EDA4 /* WebResourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResourcePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 424 424 846171F90624AE5B0071A4A3 /* WebDOMOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDOMOperations.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 425 846171FA0624AE5B0071A4A3 /* WebDOMOperations.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDOMOperations.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };425 846171FA0624AE5B0071A4A3 /* WebDOMOperations.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebDOMOperations.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 426 426 8467275C0367158500CA2ACA /* WebPluginController.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginController.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 427 427 8467275D0367158500CA2ACA /* WebPluginController.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPluginController.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; … … 485 485 DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTypesInternal.h; sourceTree = "<group>"; }; 486 486 DD89681E09AA87240097E7F0 /* WebElementDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebElementDictionary.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 487 DD89681F09AA87240097E7F0 /* WebElementDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebElementDictionary.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };487 DD89681F09AA87240097E7F0 /* WebElementDictionary.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebElementDictionary.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 488 488 ED21B9810528F7AA003299AC /* WebDocumentInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocumentInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 489 489 ED2B2474033A2DA800C1A526 /* WebNSPasteboardExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSPasteboardExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 490 ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSPasteboardExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };490 ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebNSPasteboardExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 491 491 ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSAttributedStringExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 492 492 ED6BE2E6088C32B50044DEDC /* WebNSAttributedStringExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSAttributedStringExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; … … 515 515 F59668C902AD2923018635CA /* WebStringTruncator.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebStringTruncator.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 516 516 F59EAE3E0253C7EE018635CA /* WebCoreStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreStatistics.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 517 F59EAE410253C8DE018635CA /* WebCoreStatistics.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebCoreStatistics.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };517 F59EAE410253C8DE018635CA /* WebCoreStatistics.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebCoreStatistics.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 518 518 F5A55DC702BAA2E8018635CC /* WebHTMLRepresentationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLRepresentationPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 519 519 F5A672B90263866E01000102 /* WebBaseNetscapePluginStream.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBaseNetscapePluginStream.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; … … 538 538 F5F717230288493C018635CA /* npapi.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = npapi.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 539 539 F5F7174C02885C5B018635CA /* WebViewFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebViewFactory.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 540 F5F7174D02885C5B018635CA /* WebViewFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewFactory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };540 F5F7174D02885C5B018635CA /* WebViewFactory.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebViewFactory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 541 541 F5F732D202FF4D4F01A80180 /* WebKit.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; path = WebKit.exp; sourceTree = SOURCE_ROOT; }; 542 542 F5F81C3902B67C26018635CA /* WebRenderNode.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = WebRenderNode.h; path = ../WebView/WebRenderNode.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 543 F5F81C3A02B67C26018635CA /* WebRenderNode.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; name = WebRenderNode.m; path = ../WebView/WebRenderNode.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };543 F5F81C3A02B67C26018635CA /* WebRenderNode.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; name = WebRenderNode.m; path = ../WebView/WebRenderNode.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 544 544 F738C9E903FAD3DF0321FBE0 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 545 545 F738C9EA03FAD3DF0321FBE0 /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; -
trunk/WebKit/WebView/WebFrame.mm
r17349 r17352 735 735 [childFrame loadArchive:archive]; 736 736 else 737 [childFrame _frameLoader]->load(URL, referrer, childLoadType, nil, nil, nil, nil);737 [childFrame _frameLoader]->load(URL, referrer, childLoadType, String(), nil, nil, nil); 738 738 } 739 739
Note:
See TracChangeset
for help on using the changeset viewer.