WebCore:
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Oct 2006 02:55:45 +0000 (02:55 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Oct 2006 02:55:45 +0000 (02:55 +0000)
        Reviewed by Darin, Maciej.

        Removed many uses of NSString *.
        Moved a few methods from WebCoreFrameBridge to FrameLoader, replacing
        stringByCollapsingNonPrintingCharacters with a c++ equivalent.

        PLT says no performance regression.

        * WebCore.exp:
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge receivedData:textEncodingName:]):
        * loader/mac/FrameLoader.h:
        * loader/mac/FrameLoader.mm:
        (WebCore::FrameLoader::setupForReplaceByMIMEType):
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::canShowMIMEType):
        (WebCore::FrameLoader::representationExistsForURLScheme):
        (WebCore::FrameLoader::generatedMIMETypeForURLScheme):
        (WebCore::FrameLoader::checkContentPolicy):
        (WebCore::FrameLoader::reloadAllowingStaleData):
        (WebCore::FrameLoader::invalidatePendingPolicyDecision):
        (WebCore::FrameLoader::checkNewWindowPolicy):
        (WebCore::FrameLoader::continueAfterNewWindowPolicy):
        (WebCore::FrameLoader::transitionToCommitted):
        (WebCore::FrameLoader::continueLoadRequestAfterNewWindowPolicy):
        (WebCore::FrameLoader::post):
        * loader/mac/WebDocumentLoader.h:
        * loader/mac/WebDocumentLoader.mm:
        (WebCore::DocumentLoader::doesProgressiveLoad):
        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
        (WebCore::DocumentLoader::title):
        (WebCore::DocumentLoader::setOverrideEncoding):
        (WebCore::DocumentLoader::overrideEncoding):
        (WebCore::DocumentLoader::setTitle):
        * loader/mac/WebFrameLoaderClient.h:
        * loader/mac/WebMainResourceLoader.mm:
        (WebCore::MainResourceLoader::continueAfterContentPolicy):

WebKit:

        Reviewed by Darin, Maciej.

        Removed many uses of NSString * from WebCore.

        Changed a few files to ObjC++ for compatiblity with new WebCore methods
        taking WebCore::Strings as arguments.

        Added a static_cast to make the c++ compiler happy.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17352 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/mac/BrowserExtensionMac.mm
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/loader/mac/FrameLoader.h
WebCore/loader/mac/FrameLoader.mm
WebCore/loader/mac/LoaderNSURLRequestExtras.m
WebCore/loader/mac/WebDocumentLoader.h
WebCore/loader/mac/WebDocumentLoader.mm
WebCore/loader/mac/WebFrameLoaderClient.h
WebCore/loader/mac/WebMainResourceLoader.mm
WebCore/loader/mac/WebSubresourceLoader.h
WebCore/loader/mac/WebSubresourceLoader.mm
WebKit/ChangeLog
WebKit/Misc/WebElementDictionary.m
WebKit/Plugins/WebNetscapePluginStream.mm
WebKit/Plugins/WebPluginContainerCheck.m
WebKit/Plugins/WebPluginController.mm
WebKit/WebCoreSupport/WebFrameBridge.mm
WebKit/WebCoreSupport/WebFrameLoaderClient.h
WebKit/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrame.mm

index d53328386b85b2b16ed99518747c74ffe00da705..4e05c2f53248214df9acf71b520962c7f4e174cf 100644 (file)
@@ -1,3 +1,43 @@
+2006-10-26  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Darin, Maciej.
+
+        Removed many uses of NSString *.
+        Moved a few methods from WebCoreFrameBridge to FrameLoader, replacing 
+        stringByCollapsingNonPrintingCharacters with a c++ equivalent.
+        
+        PLT says no performance regression.
+        
+        * WebCore.exp:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge receivedData:textEncodingName:]):
+        * loader/mac/FrameLoader.h:
+        * loader/mac/FrameLoader.mm:
+        (WebCore::FrameLoader::setupForReplaceByMIMEType):
+        (WebCore::FrameLoader::load):
+        (WebCore::FrameLoader::canShowMIMEType):
+        (WebCore::FrameLoader::representationExistsForURLScheme):
+        (WebCore::FrameLoader::generatedMIMETypeForURLScheme):
+        (WebCore::FrameLoader::checkContentPolicy):
+        (WebCore::FrameLoader::reloadAllowingStaleData):
+        (WebCore::FrameLoader::invalidatePendingPolicyDecision):
+        (WebCore::FrameLoader::checkNewWindowPolicy):
+        (WebCore::FrameLoader::continueAfterNewWindowPolicy):
+        (WebCore::FrameLoader::transitionToCommitted):
+        (WebCore::FrameLoader::continueLoadRequestAfterNewWindowPolicy):
+        (WebCore::FrameLoader::post):
+        * loader/mac/WebDocumentLoader.h:
+        * loader/mac/WebDocumentLoader.mm:
+        (WebCore::DocumentLoader::doesProgressiveLoad):
+        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
+        (WebCore::DocumentLoader::title):
+        (WebCore::DocumentLoader::setOverrideEncoding):
+        (WebCore::DocumentLoader::overrideEncoding):
+        (WebCore::DocumentLoader::setTitle):
+        * loader/mac/WebFrameLoaderClient.h:
+        * loader/mac/WebMainResourceLoader.mm:
+        (WebCore::MainResourceLoader::continueAfterContentPolicy):
+
 2006-10-26  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Adam.
index e28f7199fa856335537be19463903253ea2e22f9..cc1919c23bcb673ca34bdcbcff3fd91d9ebe7155 100644 (file)
@@ -141,17 +141,18 @@ __ZN7WebCore11FrameLoader21addPlugInStreamLoaderEPNS_17WebResourceLoaderE
 __ZN7WebCore11FrameLoader21commitProvisionalLoadEP12NSDictionary
 __ZN7WebCore11FrameLoader22defersCallbacksChangedEv
 __ZN7WebCore11FrameLoader23addExtraFieldsToRequestEP19NSMutableURLRequestbb
-__ZN7WebCore11FrameLoader23reloadAllowingStaleDataEP8NSString
+__ZN7WebCore11FrameLoader23reloadAllowingStaleDataERKNS_6StringE
 __ZN7WebCore11FrameLoader23timeOfLastCompletedLoadEv
 __ZN7WebCore11FrameLoader24removePlugInStreamLoaderEPNS_17WebResourceLoaderE
 __ZN7WebCore11FrameLoader25provisionalDocumentLoaderEv
 __ZN7WebCore11FrameLoader4loadEP12NSURLRequest
 __ZN7WebCore11FrameLoader4loadEP12NSURLRequestP12NSDictionaryNS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE
-__ZN7WebCore11FrameLoader4loadEP12NSURLRequestP8NSString
-__ZN7WebCore11FrameLoader4loadEP5NSURLP8NSStringNS_13FrameLoadTypeES4_P7NSEventPNS_7ElementEP12NSDictionary
+__ZN7WebCore11FrameLoader4loadEP12NSURLRequestRKNS_6StringE
+__ZN7WebCore11FrameLoader4loadEP5NSURLRKNS_6StringENS_13FrameLoadTypeES5_P7NSEventPNS_7ElementEP12NSDictionary
 __ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE
 __ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE
 __ZN7WebCore11FrameLoader6reloadEv
+__ZN7WebCore11FrameLoader7canLoadEP5NSURLRKNS_6StringERb
 __ZN7WebCore11FrameLoader8safeLoadEP5NSURL
 __ZN7WebCore11FrameLoader9setClientEPNS_17FrameLoaderClientE
 __ZN7WebCore11RenderLayer18gAlignCenterAlwaysE
@@ -160,7 +161,7 @@ __ZN7WebCore14DocumentLoader12setCommittedEb
 __ZN7WebCore14DocumentLoader13attachToFrameEv
 __ZN7WebCore14DocumentLoader15detachFromFrameEv
 __ZN7WebCore14DocumentLoader19prepareForLoadStartEv
-__ZN7WebCore14DocumentLoader19setOverrideEncodingEP8NSString
+__ZN7WebCore14DocumentLoader19setOverrideEncodingERKNS_6StringE
 __ZN7WebCore14DocumentLoader32replaceRequestURLForAnchorScrollEP5NSURL
 __ZN7WebCore14DocumentLoader7requestEv
 __ZN7WebCore14DocumentLoaderC2EP12NSURLRequest
@@ -185,6 +186,8 @@ __ZN7WebCore5Frame6indentEv
 __ZN7WebCore5Frame7outdentEv
 __ZN7WebCore5RangeD1Ev
 __ZN7WebCore6StringC1EP8NSString
+__ZN7WebCore6StringC1EP8NSString
+__ZN7WebCore6StringC1EPKc
 __ZN7WebCore8FrameMac10mouseMovedEP7NSEvent
 __ZN7WebCore8FrameMac10wheelEventEP7NSEvent
 __ZN7WebCore8FrameMac11mayDHTMLCutEv
@@ -205,6 +208,7 @@ __ZN7WebCore8FrameMac9mouseDownEP7NSEvent
 __ZN7WebCore9FrameTree11appendChildEN3WTF10PassRefPtrINS_5FrameEEE
 __ZN7WebCore9FrameTree7setNameERKNS_12AtomicStringE
 __ZNK7WebCore10StringImplcvP8NSStringEv
+__ZNK7WebCore10StringImplcvP8NSStringEv
 __ZNK7WebCore11FrameLoader14documentLoaderEv
 __ZNK7WebCore11FrameLoader15defersCallbacksEv
 __ZNK7WebCore11FrameLoader15firstLayoutDoneEv
index d7bcb12083c4f844589e40189bbeb51c05410886..3ec9a383ab5bad8c31f43ebd216195adbfbdbef6 100644 (file)
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
                        projectRoot = "";
-                       shouldCheckCompatibility = 1;
                        targets = (
                                93F198A508245E59001E9ABC /* WebCore */,
                                DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
index 2fa3f854f7608c3a1a5a2c42405af7db929b9826..e4842c9668f6ae52f602322b3dd16e131a04d1c1 100644 (file)
@@ -57,9 +57,8 @@ void BrowserExtensionMac::createNewWindow(const FrameLoadRequest& request,
     
     const KURL& url = request.m_request.url();
 
-    NSString *frameName = request.m_frameName.isEmpty() ? nil : (NSString*)request.m_frameName;
-    if (frameName) {
-        if (Frame* frame = m_frame->tree()->find(frameName)) {
+    if (!request.m_frameName.isEmpty()) {
+        if (Frame* frame = m_frame->tree()->find(request.m_frameName)) {
             if (!url.isEmpty())
                 Mac(frame)->loadRequest(request, true, nil, nil, nil);
             [Mac(frame)->bridge() activateWindow];
index 2bc4d7e10621c6a54c0acb602a464708237be2c1..5aa7fdd24d3864d61bb0d62a3288d104daa0e71d 100644 (file)
@@ -34,6 +34,7 @@
 #import "Cache.h"
 #import "ClipboardEvent.h"
 #import "Cursor.h"
+#import "WebDocumentLoader.h"
 #import "DOMInternal.h"
 #import "DOMWindow.h"
 #import "Decoder.h"
@@ -187,18 +188,18 @@ void FrameMac::loadRequest(const FrameLoadRequest& request, bool userGesture, NS
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
-    NSString *referrer;
+    String referrer;
     String argsReferrer = request.m_request.httpReferrer();
     if (!argsReferrer.isEmpty())
         referrer = argsReferrer;
     else
         referrer = FrameMac::referrer();
  
-    BOOL hideReferrer;
-    if (![_bridge canLoadURL:request.m_request.url().getNSURL() fromReferrer:referrer hideReferrer:&hideReferrer])
+    bool hideReferrer;
+    if (!loader()->canLoad(request.m_request.url().getNSURL(), referrer, hideReferrer))
         return;
     if (hideReferrer)
-        referrer = nil;
+        referrer = String();
            
     WebCoreFrameBridge *targetFrame = Mac(tree()->find(request.m_frameName))->bridge();
     if (![_bridge canTargetLoadInFrame:targetFrame])
@@ -626,14 +627,10 @@ void FrameMac::setView(FrameView *view)
     d->m_submittedFormURL = KURL();
 }
 
+// FIXME: Remove this method; it's superfluous.
 void FrameMac::setTitle(const String &title)
 {
-    String text = title;
-    text.replace('\\', backslashAsCurrencySymbol());
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [_bridge setTitle:text];
-    END_BLOCK_OBJC_EXCEPTIONS;
+    loader()->documentLoader()->setTitle(title);
 }
 
 void FrameMac::setStatusBarText(const String& status)
index 878cfe19f0e44600a3af51f90d295d2979ddb995..b3fa3946d1cd1ae1b4c2cf1909fb661bf03402a9 100644 (file)
@@ -34,6 +34,7 @@ namespace WebCore {
     class EditorClient;
     class Element;
     class FrameMac;
+    class String;
 }
 
 typedef WebCore::EditorClient WebCoreEditorClient;
@@ -210,7 +211,6 @@ typedef enum {
 
 - (void)invalidatePageCache:(NSDictionary *)pageCache;
 
-- (BOOL)canLoadURL:(NSURL *)URL fromReferrer:(NSString *)referrer hideReferrer:(BOOL *)hideReferrer;
 - (BOOL)canTargetLoadInFrame:(WebCoreFrameBridge *)targetFrame;
 
 - (void)saveDocumentState;
@@ -405,7 +405,6 @@ typedef enum {
 - (BOOL)canProvideDocumentSource;
 - (BOOL)canSaveAsWebArchive;
 
-- (void)setTitle:(NSString *)title;
 - (NSURL*)originalRequestURL;
 - (void)frameDetached;
 - (void)tokenizerProcessedData;
@@ -436,10 +435,7 @@ typedef enum {
 
 - (void)setStatusText:(NSString *)status;
 
-- (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL
-    referrer:(NSString *)referrer
-    ownerElement:(WebCoreElement *)ownerElement
-    allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
+- (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL referrer:(const WebCore::String&)referrer ownerElement:(WebCoreElement *)ownerElement allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
 
 - (BOOL)areToolbarsVisible;
 - (void)setToolbarsVisible:(BOOL)visible;
index 1a9457c258138c71f4eccb7815cac459aab76854..6d8c832735091034d9662afffa593c463440a383 100644 (file)
@@ -155,12 +155,6 @@ static void updateRenderingForBindings(ExecState* exec, JSObject* rootObject)
         doc->updateRendering();
 }
 
-static BOOL hasCaseInsensitivePrefix(NSString *string, NSString *prefix)
-{
-    return [string rangeOfString:prefix options:(NSCaseInsensitiveSearch | NSAnchoredSearch)].location !=
-        NSNotFound;
-}
-
 static BOOL isCaseSensitiveEqual(NSString *a, NSString *b)
 {
     return [a caseInsensitiveCompare:b] == NSOrderedSame;
@@ -521,19 +515,6 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
         [state invalidate];
 }
 
-- (BOOL)canLoadURL:(NSURL *)URL fromReferrer:(NSString *)referrer hideReferrer:(BOOL *)hideReferrer
-{
-    BOOL referrerIsWebURL = hasCaseInsensitivePrefix(referrer, @"http:") || hasCaseInsensitivePrefix(referrer, @"https:");
-    BOOL referrerIsLocalURL = hasCaseInsensitivePrefix(referrer, @"file:") || hasCaseInsensitivePrefix(referrer, @"applewebdata:");
-    BOOL URLIsFileURL = [URL scheme] != NULL && [[URL scheme] compare:@"file" options:(NSCaseInsensitiveSearch|NSLiteralSearch)] == NSOrderedSame;
-    BOOL referrerIsSecureURL = hasCaseInsensitivePrefix(referrer, @"https:");
-    BOOL URLIsSecureURL = [URL scheme] != NULL && [[URL scheme] compare:@"https" options:(NSCaseInsensitiveSearch|NSLiteralSearch)] == NSOrderedSame;
-
-    
-    *hideReferrer = !referrerIsWebURL || (referrerIsSecureURL && !URLIsSecureURL);
-    return !URLIsFileURL || referrerIsLocalURL;
-}
-
 - (void)saveDocumentState
 {
     Vector<String> stateVector;
@@ -2165,54 +2146,6 @@ static NSCharacterSet *_getPostSmartSet(void)
     return [self canProvideDocumentSource];
 }
 
-static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
-{
-    NSMutableString *result = [NSMutableString string];
-    static NSCharacterSet *charactersToTurnIntoSpaces = nil;
-    static NSCharacterSet *charactersToNotTurnIntoSpaces = nil;
-    
-    if (charactersToTurnIntoSpaces == nil) {
-        NSMutableCharacterSet *set = [[NSMutableCharacterSet alloc] init];
-        [set addCharactersInRange:NSMakeRange(0x00, 0x21)];
-        [set addCharactersInRange:NSMakeRange(0x7F, 0x01)];
-        charactersToTurnIntoSpaces = [set copy];
-        [set release];
-        charactersToNotTurnIntoSpaces = [[charactersToTurnIntoSpaces invertedSet] retain];
-    }
-    
-    unsigned length = [string length];
-    unsigned position = 0;
-    while (position != length) {
-        NSRange nonSpace = [string rangeOfCharacterFromSet:charactersToNotTurnIntoSpaces
-                                                 options:0 range:NSMakeRange(position, length - position)];
-        if (nonSpace.location == NSNotFound)
-            break;
-        
-        NSRange space = [string rangeOfCharacterFromSet:charactersToTurnIntoSpaces
-                                              options:0 range:NSMakeRange(nonSpace.location, length - nonSpace.location)];
-        if (space.location == NSNotFound)
-            space.location = length;
-        
-        if (space.location > nonSpace.location) {
-            if (position != 0)
-                [result appendString:@" "];
-            [result appendString:[string substringWithRange:
-                NSMakeRange(nonSpace.location, space.location - nonSpace.location)]];
-        }
-        
-        position = space.location;
-    }
-    
-    return result;
-}
-
-- (void)setTitle:(NSString *)title
-{
-    if (!m_frame)
-        return;
-    m_frame->loader()->documentLoader()->setTitle(stringByCollapsingNonPrintingCharacters(title));
-}
-
 - (NSURL*)originalRequestURL
 {
     return [m_frame->loader()->activeDocumentLoader()->initialRequest() URL];
@@ -2232,9 +2165,11 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
 - (void)receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName
 {
     // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
-    NSString *encoding = m_frame ? m_frame->loader()->documentLoader()->overrideEncoding() : nil;
-    bool userChosen = encoding != nil;
-    if (!encoding)
+    String encoding;
+    if (m_frame)
+        encoding = m_frame->loader()->documentLoader()->overrideEncoding();
+    bool userChosen = !encoding.isNull();
+    if (encoding.isNull())
         encoding = textEncodingName;
     m_frame->setEncoding(encoding, userChosen);
     [self addData:data];
@@ -2249,11 +2184,11 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
     
     // Since this is a subresource, we can load any URL (we ignore the return value).
     // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
-    NSString *referrer = m_frame->referrer();
-    BOOL hideReferrer;
-    [self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer];
+    String referrer = m_frame->referrer();
+    bool hideReferrer;
+    m_frame->loader()->canLoad(URL, referrer, hideReferrer);
     if (hideReferrer)
-        referrer = nil;
+        referrer = String();
     
     return SubresourceLoader::create(m_frame, resourceLoader, method, URL, customHeaders, referrer);
 }
@@ -2282,11 +2217,11 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
     
     // Since this is a subresource, we can load any URL (we ignore the return value).
     // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
-    NSString *referrer = m_frame->referrer();
-    BOOL hideReferrer;
-    [self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer];
+    String referrer = m_frame->referrer();
+    bool hideReferrer;
+    m_frame->loader()->canLoad(URL, referrer, hideReferrer);
     if (hideReferrer)
-        referrer = nil;
+        referrer = String();
     
     return SubresourceLoader::create(m_frame, resourceLoader, method, URL, customHeaders, postData, referrer);
 }
@@ -2295,11 +2230,11 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
 {
     // Since this is a subresource, we can load any URL (we ignore the return value).
     // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
-    NSString *referrer = m_frame->referrer();
-    BOOL hideReferrer;
-    [self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer];
+    String referrer = m_frame->referrer();
+    bool hideReferrer;
+    m_frame->loader()->canLoad(URL, referrer, hideReferrer);
     if (hideReferrer)
-        referrer = nil;
+        referrer = String();
     
     NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
     [request setTimeoutInterval:10];
@@ -2322,7 +2257,7 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
     else
         [request setCachePolicy:[m_frame->loader()->documentLoader()->request() cachePolicy]];
     
-    if (referrer)
+    if (!referrer.isNull())
         setHTTPReferrer(request, referrer);
     
     [request setMainDocumentURL:[m_frame->page()->mainFrame()->loader()->documentLoader()->request() URL]];
index 68e0fca4be0814909b577c6c230d9b89052ed756..13814001a6bceb5b62064943c7703d2ca683cf71 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #import "FrameLoaderTypes.h"
+#import <WebCore/PlatformString.h>
 #import <wtf/Forward.h>
 #import <wtf/HashSet.h>
 #import <wtf/Noncopyable.h>
@@ -50,6 +51,7 @@ namespace WebCore {
     class Frame;
     class FrameLoaderClient;
     class MainResourceLoader;
+    class String;
     class WebResourceLoader;
 
     bool isBackForwardLoadType(FrameLoadType);
@@ -65,15 +67,18 @@ namespace WebCore {
         // FIXME: This is not cool, people.
         void prepareForLoadStart();
         void setupForReplace();
-        void setupForReplaceByMIMEType(NSString *newMIMEType);
+        void setupForReplaceByMIMEType(const String& newMIMEType);
         void finalSetupForReplace(DocumentLoader*);
         void safeLoad(NSURL *);
         void load(NSURLRequest *);
-        void load(NSURLRequest *, NSString *frameName);
+        void load(NSURLRequest *, const String& frameName);
         void load(NSURLRequest *, NSDictionary *triggeringAaction, FrameLoadType, PassRefPtr<FormState>);
         void load(DocumentLoader*);
         void load(DocumentLoader*, FrameLoadType, PassRefPtr<FormState>);
-        void load(NSURL *, NSString *referrer, FrameLoadType, NSString *target, NSEvent *event, Element* form, NSDictionary *formValues);
+        void load(NSURL *, const String& referrer, FrameLoadType, const String& target, 
+                  NSEvent *event, Element* form, NSDictionary *formValues);
+
+        bool canLoad(NSURL *, const String& referrer, bool& hideReferrer);
 
         // Also not cool.
         void stopLoadingPlugIns();
@@ -82,7 +87,7 @@ namespace WebCore {
         void stopLoading();
         void cancelMainResourceLoad();
         void cancelPendingArchiveLoad(WebResourceLoader*);
-            
+
         void addPlugInStreamLoader(WebResourceLoader*);
         void removePlugInStreamLoader(WebResourceLoader*);
         bool isLoadingMainResource() const;
@@ -131,15 +136,15 @@ namespace WebCore {
         NSError *interruptionForPolicyChangeError(NSURLRequest *);
         bool isHostedByObjectElement() const;
         bool isLoadingMainFrame() const;
-        bool canShowMIMEType(NSString *MIMEType) const;
-        bool representationExistsForURLScheme(NSString *URLScheme);
-        NSString *generatedMIMETypeForURLScheme(NSString *URLScheme);
+        bool canShowMIMEType(const String& MIMEType) const;
+        bool representationExistsForURLScheme(const String& URLScheme);
+        String generatedMIMETypeForURLScheme(const String& URLScheme);
         void notifyIconChanged(NSURL *iconURL);
         void checkNavigationPolicy(NSURLRequest *newRequest, id continuationObject, SEL continuationSelector);
-        void checkContentPolicy(NSString *MIMEType, id continuationObject, SEL continuationSelector);
+        void checkContentPolicy(const String& MIMEType, id continuationObject, SEL continuationSelector);
         void cancelContentPolicyCheck();
         void reload();
-        void reloadAllowingStaleData(NSString *overrideEncoding);
+        void reloadAllowingStaleData(const String& overrideEncoding);
 
         void didReceiveServerRedirectForProvisionalLoadForFrame();
         void finishedLoadingDocument(DocumentLoader*);
@@ -166,7 +171,7 @@ namespace WebCore {
 
         void sendRemainingDelegateMessages(id identifier, NSURLResponse *, unsigned length, NSError *);
         NSURLRequest *requestFromDelegate(NSURLRequest *, id& identifier, NSError *& error);
-        void post(NSURL *, NSString *referrer, NSString *target, NSArray *postData, NSString *contentType, NSEvent *, Element* form, NSDictionary *formValues);
+        void post(NSURL *, const String& referrer, const String& target, NSArray *postData, const String& contentType, NSEvent *, Element* form, NSDictionary *formValues);
 
         void checkLoadComplete();
         void detachFromParent();
@@ -183,7 +188,7 @@ namespace WebCore {
         void continueAfterNavigationPolicy(PolicyAction);
         void continueLoadRequestAfterNavigationPolicy(NSURLRequest *, FormState*);
         void continueFragmentScrollAfterNavigationPolicy(NSURLRequest *);
-        void continueLoadRequestAfterNewWindowPolicy(NSURLRequest *, NSString *frameName, FormState*);
+        void continueLoadRequestAfterNewWindowPolicy(NSURLRequest *, const String& frameName, FormState*);
 #endif
 
     private:
@@ -205,7 +210,7 @@ namespace WebCore {
         void setLoadType(FrameLoadType);
 
         void invalidatePendingPolicyDecision(bool callDefaultAction);
-        void checkNewWindowPolicy(NSURLRequest *, NSDictionary *, NSString *frameName, PassRefPtr<FormState>);
+        void checkNewWindowPolicy(NSURLRequest *, NSDictionary *, const String& frameName, PassRefPtr<FormState>);
         void checkNavigationPolicy(NSURLRequest *, DocumentLoader*, PassRefPtr<FormState>, id continuationObject, SEL continuationSelector);
 
         void transitionToCommitted(NSDictionary *pageCache);
@@ -251,7 +256,7 @@ namespace WebCore {
         RetainPtr<WebPolicyDecider> m_policyDecider;    
 
         RetainPtr<NSURLRequest> m_policyRequest;
-        RetainPtr<NSString> m_policyFrameName;
+        String m_policyFrameName;
         RetainPtr<id> m_policyTarget;
         SEL m_policySelector;
         RefPtr<FormState> m_policyFormState;
index 31eda913155e082a30913b44ee86568f180057eb..46ff1001e65a24a5ccca747dc38d6a6b16b0e141 100644 (file)
@@ -137,7 +137,7 @@ void FrameLoader::setupForReplace()
     detachChildren();
 }
 
-void FrameLoader::setupForReplaceByMIMEType(NSString *newMIMEType)
+void FrameLoader::setupForReplaceByMIMEType(const String& newMIMEType)
 {
     activeDocumentLoader()->setupForReplaceByMIMEType(newMIMEType);
 }
@@ -164,9 +164,9 @@ void FrameLoader::load(NSURLRequest *request)
     load(m_client->createDocumentLoader(request).get());
 }
 
-void FrameLoader::load(NSURLRequest *request, NSString *frameName)
+void FrameLoader::load(NSURLRequest *request, const String& frameName)
 {
-    if (!frameName) {
+    if (frameName.isNull()) {
         load(request);
         return;
     }
@@ -193,7 +193,7 @@ void FrameLoader::load(NSURLRequest *request, NSDictionary *action, FrameLoadTyp
     load(loader.get(), type, formState);
 }
 
-void FrameLoader::load(NSURL *URL, NSString *referrer, FrameLoadType newLoadType, NSString *target, NSEvent *event, Element* form, NSDictionary *values)
+void FrameLoader::load(NSURL *URL, const String& referrer, FrameLoadType newLoadType, const String& target, NSEvent *event, Element* form, NSDictionary *values)
 {
     bool isFormSubmission = values != nil;
     
@@ -210,10 +210,10 @@ void FrameLoader::load(NSURL *URL, NSString *referrer, FrameLoadType newLoadType
     if (form && values)
         formState = FormState::create(form, values, bridge());
     
-    if (target) {
+    if (!target.isNull()) {
         Frame* targetFrame = m_frame->tree()->find(target);
         if (targetFrame)
-            targetFrame->loader()->load(URL, referrer, newLoadType, nil, event, form, values);
+            targetFrame->loader()->load(URL, referrer, newLoadType, String(), event, form, values);
         else
             checkNewWindowPolicy(request, action, target, formState.release());
         [request release];
@@ -314,6 +314,18 @@ void FrameLoader::load(DocumentLoader* loader, FrameLoadType type, PassRefPtr<Fo
         asDelegate(), @selector(continueLoadRequestAfterNavigationPolicy:formState:));
 }
 
+bool FrameLoader::canLoad(NSURL *URL, const String& referrer, bool& hideReferrer)
+{
+    bool referrerIsWebURL = referrer.startsWith("http:", false) || referrer.startsWith("https:", false);
+    bool referrerIsLocalURL = referrer.startsWith("file:", false) || referrer.startsWith("applewebdata:");
+    bool URLIsFileURL = [URL scheme] && [[URL scheme] compare:@"file" options:(NSCaseInsensitiveSearch|NSLiteralSearch)] == NSOrderedSame;
+    bool referrerIsSecureURL = referrer.startsWith("https:", false);
+    bool URLIsSecureURL = [URL scheme] && [[URL scheme] compare:@"https" options:(NSCaseInsensitiveSearch|NSLiteralSearch)] == NSOrderedSame;
+    
+    hideReferrer = !referrerIsWebURL || (referrerIsSecureURL && !URLIsSecureURL);
+    return !URLIsFileURL || referrerIsLocalURL;
+}
+
 bool FrameLoader::startLoadingMainResource(NSMutableURLRequest *request, id identifier)
 {
     ASSERT(!m_mainResourceLoader);
@@ -971,17 +983,17 @@ bool FrameLoader::isLoadingMainFrame() const
     return page && m_frame == page->mainFrame();
 }
 
-bool FrameLoader::canShowMIMEType(NSString *MIMEType) const
+bool FrameLoader::canShowMIMEType(const String& MIMEType) const
 {
     return m_client->canShowMIMEType(MIMEType);
 }
 
-bool FrameLoader::representationExistsForURLScheme(NSString *URLScheme)
+bool FrameLoader::representationExistsForURLScheme(const String& URLScheme)
 {
     return m_client->representationExistsForURLScheme(URLScheme);
 }
 
-NSString *FrameLoader::generatedMIMETypeForURLScheme(NSString *URLScheme)
+String FrameLoader::generatedMIMETypeForURLScheme(const String& URLScheme)
 {
     return m_client->generatedMIMETypeForURLScheme(URLScheme);
 }
@@ -991,7 +1003,7 @@ void FrameLoader::checkNavigationPolicy(NSURLRequest *newRequest, id obj, SEL se
     checkNavigationPolicy(newRequest, activeDocumentLoader(), 0, obj, sel);
 }
 
-void FrameLoader::checkContentPolicy(NSString *MIMEType, id obj, SEL sel)
+void FrameLoader::checkContentPolicy(const String& MIMEType, id obj, SEL sel)
 {
     WebPolicyDecider *d = m_client->createPolicyDecider(obj, sel);
     m_policyDecider = d;
@@ -1028,7 +1040,7 @@ bool FrameLoader::shouldReloadToHandleUnreachableURL(NSURLRequest *request)
     return compareDocumentLoader && [unreachableURL isEqual:[compareDocumentLoader->request() URL]];
 }
 
-void FrameLoader::reloadAllowingStaleData(NSString *encoding)
+void FrameLoader::reloadAllowingStaleData(const String& encoding)
 {
     if (!m_documentLoader)
         return;
@@ -1170,12 +1182,12 @@ void FrameLoader::invalidatePendingPolicyDecision(bool callDefaultAction)
     [m_policyDecider.get() invalidate];
     m_policyDecider = nil;
 
-    bool hadFrameName = m_policyFrameName;
+    bool hadFrameName = !m_policyFrameName.isNull();
     RetainPtr<id> target = m_policyTarget;
     SEL selector = m_policySelector;
 
     m_policyRequest = nil;
-    m_policyFrameName = nil;
+    m_policyFrameName = String();
     m_policyTarget = nil;
     m_policyFormState = 0;
 
@@ -1187,8 +1199,7 @@ void FrameLoader::invalidatePendingPolicyDecision(bool callDefaultAction)
     }
 }
 
-void FrameLoader::checkNewWindowPolicy(NSURLRequest *request, NSDictionary *action,
-    NSString *frameName, PassRefPtr<FormState> formState)
+void FrameLoader::checkNewWindowPolicy(NSURLRequest *request, NSDictionary *action, const String& frameName, PassRefPtr<FormState> formState)
 {
     WebPolicyDecider *decider = m_client->createPolicyDecider(asDelegate(),
         @selector(continueAfterNewWindowPolicy:));
@@ -1208,7 +1219,7 @@ void FrameLoader::checkNewWindowPolicy(NSURLRequest *request, NSDictionary *acti
 void FrameLoader::continueAfterNewWindowPolicy(PolicyAction policy)
 {
     RetainPtr<NSURLRequest> request = m_policyRequest;
-    RetainPtr<NSString> frameName = m_policyFrameName;
+    String frameName = m_policyFrameName;
     RetainPtr<id> target = m_policyTarget;
     SEL selector = m_policySelector;
     RefPtr<FormState> formState = m_policyFormState;
@@ -1227,7 +1238,8 @@ void FrameLoader::continueAfterNewWindowPolicy(PolicyAction policy)
             break;
     }
 
-    objc_msgSend(target.get(), selector, request.get(), frameName.get(), formState.get());
+    NSString *frameNameAsNSString = frameName;
+    objc_msgSend(target.get(), selector, request.get(), frameNameAsNSString, formState.get());
 }
 
 void FrameLoader::checkNavigationPolicy(NSURLRequest *request, DocumentLoader* loader,
@@ -1417,7 +1429,7 @@ void FrameLoader::transitionToCommitted(NSDictionary *pageCache)
 
     // Handle adding the URL to the back/forward list.
     DocumentLoader* dl = m_documentLoader.get();
-    NSString *ptitle = dl->title();
+    String ptitle = dl->title();
 
     switch (m_loadType) {
     case FrameLoadTypeForward:
@@ -1467,7 +1479,7 @@ void FrameLoader::transitionToCommitted(NSDictionary *pageCache)
     m_client->dispatchDidCommitLoad();
     
     // If we have a title let the WebView know about it.
-    if (ptitle)
+    if (!ptitle.isNull())
         m_client->dispatchDidReceiveTitle(ptitle);
 }
 
@@ -1556,7 +1568,7 @@ void FrameLoader::checkLoadCompleteForThisFrame()
     ASSERT_NOT_REACHED();
 }
 
-void FrameLoader::continueLoadRequestAfterNewWindowPolicy(NSURLRequest *request, NSString *frameName, FormState* formState)
+void FrameLoader::continueLoadRequestAfterNewWindowPolicy(NSURLRequest *request, const String& frameName, FormState* formState)
 {
     if (!request)
         return;
@@ -1601,8 +1613,8 @@ NSURLRequest *FrameLoader::requestFromDelegate(NSURLRequest *request, id& identi
     return newRequest;
 }
 
-void FrameLoader::post(NSURL *URL, NSString *referrer, NSString *target, NSArray *postData,
-    NSString *contentType, NSEvent *event, Element* form, NSDictionary *formValues)
+void FrameLoader::post(NSURL *URL, const String& referrer, const String& target, NSArray *postData, 
+                       const String& contentType, NSEvent *event, Element* form, NSDictionary *formValues)
 {
     // When posting, use the NSURLRequestReloadIgnoringCacheData load flag.
     // This prevents a potential bug which may cause a page with a form that uses itself
index 8795f2f4f4f33494ebeb0048dad03ffd3397ca52..753ef2feb9c297df5a02cbc7ddd45e7542a80e30 100644 (file)
@@ -44,17 +44,17 @@ BOOL isConditionalRequest(NSURLRequest *request)
 
 #define WebReferrer     (@"Referer")
 
-void setHTTPReferrer(NSMutableURLRequest *request, NSString *theReferrer)
+void setHTTPReferrer(NSMutableURLRequest *request, NSString *referrer)
 {
     // Do not set the referrer to a string that refers to a file URL.
     // That is a potential security hole.
-    if (stringIsFileURL(theReferrer))
+    if (stringIsFileURL(referrer))
         return;
     
     // Don't allow empty Referer: headers; some servers refuse them
-    if([theReferrer length] == 0)
-        theReferrer = nil;
+    if([referrer length] == 0)
+        referrer = nil;
     
-    [request setValue:theReferrer forHTTPHeaderField:WebReferrer];
+    [request setValue:referrer forHTTPHeaderField:WebReferrer];
 }
 
index 3172b54a9e972a7df6eb461f4e60ef35865126ed..04a893540ee0eb2f5a0cf335cfb6fbed1e7f6b66 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "RetainPtr.h"
 #include "Shared.h"
+#include "PlatformString.h"
 #include <wtf/Vector.h>
 
 @class WebCoreFrameBridge;
@@ -67,7 +68,7 @@ namespace WebCore {
         void setLoading(bool);
         void updateLoading();
         void receivedData(NSData *);
-        void setupForReplaceByMIMEType(NSString *newMIMEType);
+        void setupForReplaceByMIMEType(const String& newMIMEType);
         void finishedLoading();
         NSURLResponse *response() const;
         NSError *mainDocumentError() const;
@@ -78,17 +79,17 @@ namespace WebCore {
         void setIsClientRedirect(bool);
         bool isLoadingInAPISense() const;
         void setPrimaryLoadComplete(bool);
-        void setTitle(NSString *);
-        NSString *overrideEncoding() const;
+        void setTitle(const String&);
+        String overrideEncoding() const;
         void addResponse(NSURLResponse *);
         const ResponseVector& responses() const;
         NSDictionary *triggeringAction() const;
         void setTriggeringAction(NSDictionary *);
-        void setOverrideEncoding(NSString *);
+        void setOverrideEncoding(const String&);
         void setLastCheckedRequest(NSURLRequest *request);
         NSURLRequest *lastCheckedRequest() const;
         void stopRecordingResponses();
-        NSString *title() const;
+        String title() const;
         NSURL *URLForHistory() const;
 
     private:
@@ -100,7 +101,7 @@ namespace WebCore {
         WebCoreFrameBridge *bridge() const;
         void setMainDocumentError(NSError *);
         void commitLoad(NSData *);
-        bool doesProgressiveLoad(NSString *MIMEType) const;
+        bool doesProgressiveLoad(const String& MIMEType) const;
 
         Frame* m_frame;
 
@@ -135,10 +136,9 @@ namespace WebCore {
         bool m_primaryLoadComplete;
         bool m_isClientRedirect;
 
-        RetainPtr<NSString> m_pageTitle;
+        String m_pageTitle;
 
-        RetainPtr<NSString> m_encoding;
-        RetainPtr<NSString> m_overrideEncoding;
+        String m_overrideEncoding;
 
         // The action that triggered loading - we keep this around for the
         // benefit of the various policy handlers.
index c8a05832c3c90e8c0d3ddf51172aed9c4822177a..f6260dfe0792aaa6e60bf8d277d9e23fda2c720d 100644 (file)
@@ -31,6 +31,7 @@
 
 #import "FrameLoader.h"
 #import "FrameMac.h"
+#import "PlatformString.h"
 #import "WebCoreFrameBridge.h"
 #import "WebCoreSystemInterface.h"
 #import "WebDataProtocol.h"
 
 namespace WebCore {
 
+/*
+ * Performs three operations:
+ *  1. Convert backslashes to currency symbols
+ *  2. Convert control characters to spaces
+ *  3. Trim leading and trailing spaces
+ */
+static inline String canonicalizedTitle(const String& title, Frame* frame)
+{
+    ASSERT(!title.isEmpty());
+    
+    const UChar* characters = title.characters();
+    unsigned length = title.length();
+    unsigned i;
+    
+    // Find the first non-canonical character
+    for (i = 0; i < length; ++i) {
+        UChar c = characters[i];
+        if (c < 0x20 || c == 0x7F || c == '\\')
+            break;
+    }
+
+    // Optimization for titles that have no non-canonical characters and no leading or trailing spaces
+    if (i == length && characters[0] != ' ' && characters[length - 1] != ' ')
+        return title;
+
+    Vector<UChar> stringBuilder(length);
+    unsigned builderIndex = 0;
+    
+    // Skip leading spaces and leading characters that would convert to spaces
+    for (i = 0; i < length; ++i) {
+        UChar c = characters[i];
+        if (!(c <= 0x20 || c == 0x7F))
+            break;
+    }
+    
+    // Replace control characters with spaces, and backslashes with currency symbols
+    for (; i < length; ++i) {
+        UChar c = characters[i];
+        if (c < 0x20 || c == 0x7F)
+            c = ' ';
+        else if (c == '\\')
+            c = frame->backslashAsCurrencySymbol();
+        stringBuilder[builderIndex++] = c;
+    }
+
+    // Strip trailing spaces
+    while (--builderIndex > 0)
+        if (stringBuilder[builderIndex] != ' ')
+            break;
+    
+    if (builderIndex == 0 && stringBuilder[builderIndex] == ' ')
+        return "";
+    
+    stringBuilder.resize(builderIndex + 1);
+    return String::adopt(stringBuilder);
+}
+
 DocumentLoader::DocumentLoader(NSURLRequest *req)
     : m_frame(0)
     , m_originalRequest(req)
@@ -298,9 +356,9 @@ void DocumentLoader::commitLoad(NSData *data)
         frameLoader->committedLoad(this, data);
 }
 
-bool DocumentLoader::doesProgressiveLoad(NSString *MIMEType) const
+bool DocumentLoader::doesProgressiveLoad(const String& MIMEType) const
 {
-    return !frameLoader()->isReplacing() || [MIMEType isEqualToString:@"text/html"];
+    return !frameLoader()->isReplacing() || MIMEType == "text/html";
 }
 
 void DocumentLoader::receivedData(NSData *data)
@@ -310,12 +368,12 @@ void DocumentLoader::receivedData(NSData *data)
         commitLoad(data);
 }
 
-void DocumentLoader::setupForReplaceByMIMEType(NSString *newMIMEType)
+void DocumentLoader::setupForReplaceByMIMEType(const String& newMIMEType)
 {
     if (!m_gotFirstByte)
         return;
     
-    NSString *oldMIMEType = [m_response.get() MIMEType];
+    String oldMIMEType = [m_response.get() MIMEType];
     
     if (!doesProgressiveLoad(oldMIMEType)) {
         frameLoader()->revertToProvisional(this);
@@ -439,9 +497,9 @@ void DocumentLoader::stopRecordingResponses()
     m_stopRecordingResponses = true;
 }
 
-NSString *DocumentLoader::title() const
+String DocumentLoader::title() const
 {
-    return [[m_pageTitle.get() retain] autorelease];
+    return m_pageTitle;
 }
 
 void DocumentLoader::setLastCheckedRequest(NSURLRequest *req)
@@ -473,35 +531,27 @@ const ResponseVector& DocumentLoader::responses() const
     return m_responses;
 }
 
-void DocumentLoader::setOverrideEncoding(NSString *enc)
+void DocumentLoader::setOverrideEncoding(const String& enc)
 {
-    NSString *copy = [enc copy];
-    m_overrideEncoding = copy;
-    [copy release];
+    m_overrideEncoding = enc;
 }
 
-NSString *DocumentLoader::overrideEncoding() const
+String DocumentLoader::overrideEncoding() const
 {
-    return [[m_overrideEncoding.get() copy] autorelease];
+    return m_overrideEncoding;
 }
 
-void DocumentLoader::setTitle(NSString *title)
+void DocumentLoader::setTitle(const String& title)
 {
-    if (!title)
+    if (title.isEmpty())
         return;
 
-    NSString *trimmed = [title mutableCopy];
-    CFStringTrimWhitespace((CFMutableStringRef)trimmed);
-
-    if ([trimmed length] != 0 && ![m_pageTitle.get() isEqualToString:trimmed]) {
-        NSString *copy = [trimmed copy];
+    String trimmed = canonicalizedTitle(title, m_frame);
+    if (!trimmed.isEmpty() && m_pageTitle != trimmed) {
         frameLoader()->willChangeTitle(this);
-        m_pageTitle = copy;
+        m_pageTitle = trimmed;
         frameLoader()->didChangeTitle(this);
-        [copy release];
     }
-
-    [trimmed release];
 }
 
 NSURL *DocumentLoader::URLForHistory() const
index d0d15abee9f51d26fb3f4b507cbb9a3f344d3312..9816a9ec27139c37a012732a544522c934c20afb 100644 (file)
@@ -36,6 +36,7 @@ namespace WebCore {
     class DocumentLoader;
     class Element;
     class Frame;
+    class String;
     class WebResourceLoader;
 
     struct LoadErrorResetToken;
@@ -103,7 +104,7 @@ namespace WebCore {
         virtual void dispatchWillClose() = 0;
         virtual void dispatchDidReceiveIcon(NSImage *) = 0;
         virtual void dispatchDidStartProvisionalLoad() = 0;
-        virtual void dispatchDidReceiveTitle(NSString *title) = 0;
+        virtual void dispatchDidReceiveTitle(const String& title) = 0;
         virtual void dispatchDidCommitLoad() = 0;
         virtual void dispatchDidFailProvisionalLoad(NSError *) = 0;
         virtual void dispatchDidFailLoad(NSError *) = 0;
@@ -113,8 +114,8 @@ namespace WebCore {
         virtual Frame* dispatchCreatePage(NSURLRequest *) = 0;
         virtual void dispatchShow() = 0;
 
-        virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, NSString *MIMEType, NSURLRequest *) = 0;
-        virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, NSString *frameName) = 0;
+        virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, const String& MIMEType, NSURLRequest *) = 0;
+        virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, const String& frameName) = 0;
         virtual void dispatchDecidePolicyForNavigationAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *) = 0;
         virtual void dispatchUnableToImplementPolicy(NSError *) = 0;
 
@@ -164,9 +165,9 @@ namespace WebCore {
         virtual void clearArchivedResources() = 0;
 
         virtual bool canHandleRequest(NSURLRequest *) const = 0;
-        virtual bool canShowMIMEType(NSString *MIMEType) const = 0;
-        virtual bool representationExistsForURLScheme(NSString *URLScheme) const = 0;
-        virtual NSString *generatedMIMETypeForURLScheme(NSString *URLScheme) const = 0;
+        virtual bool canShowMIMEType(const String& MIMEType) const = 0;
+        virtual bool representationExistsForURLScheme(const String& URLScheme) const = 0;
+        virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const = 0;
 
         virtual NSDictionary *elementForEvent(NSEvent *) const = 0;
 
index 5a24be84678d88ab304c60a2e1f295157b2374a6..c13256b53b71498908f5a88368d37c4690c51667 100644 (file)
@@ -30,6 +30,7 @@
 #import "WebMainResourceLoader.h"
 
 #import "FrameLoader.h"
+#import "PlatformString.h"
 #import "WebCoreSystemInterface.h"
 #import "WebDataProtocol.h"
 #import <Foundation/NSHTTPCookie.h>
@@ -195,11 +196,6 @@ NSURLRequest *MainResourceLoader::willSendRequest(NSURLRequest *newRequest, NSUR
     return newRequest;
 }
 
-static bool isCaseInsensitiveEqual(NSString *a, NSString *b)
-{
-    return [a caseInsensitiveCompare:b] == NSOrderedSame;
-}
-
 static bool shouldLoadAsEmptyDocument(NSURL *url)
 {
     Vector<UInt8, URLBufferLength> buffer(URLBufferLength);
@@ -217,13 +213,13 @@ static bool shouldLoadAsEmptyDocument(NSURL *url)
 void MainResourceLoader::continueAfterContentPolicy(PolicyAction contentPolicy, NSURLResponse *r)
 {
     NSURL *URL = [request() URL];
-    NSString *MIMEType = [r MIMEType]; 
+    String MIMEType = [r MIMEType]; 
     
     switch (contentPolicy) {
     case PolicyUse: {
         // Prevent remote web archives from loading because they can claim to be from any domain and thus avoid cross-domain security checks (4120255).
         bool isRemote = ![URL isFileURL] && ![WebDataProtocol _webIsDataProtocolURL:URL];
-        bool isRemoteWebArchive = isRemote && isCaseInsensitiveEqual(@"application/x-webarchive", MIMEType);
+        bool isRemoteWebArchive = isRemote && equalIgnoringCase("application/x-webarchive", MIMEType);
         if (!frameLoader()->canShowMIMEType(MIMEType) || isRemoteWebArchive) {
             frameLoader()->cannotShowMIMEType(r);
             // Check reachedTerminalState since the load may have already been cancelled inside of _handleUnimplementablePolicyWithErrorCode::.
index 9b4b6cd998ee57398d40047410bb7cdeeb7a55f7..d5abb29f839fd9f8ec6d5d7c72f1b7edc0c13e5d 100644 (file)
 
 namespace WebCore {
 
+    class String;
+    
     class SubresourceLoader : public WebResourceLoader {
     public:
         static id <WebCoreResourceHandle> create(Frame*, id <WebCoreResourceLoader>,
-            NSString *method, NSURL *URL, NSDictionary *customHeaders, NSString *referrer);
+            const String& method, NSURL *URL, NSDictionary *customHeaders, const String& referrer);
         static id <WebCoreResourceHandle> create(Frame*, id <WebCoreResourceLoader>,
-            NSString *method, NSURL *URL, NSDictionary *customHeaders, NSArray *postData, NSString *referrer);
+            const String& method, NSURL *URL, NSDictionary *customHeaders, NSArray *postData, const String& referrer);
 
         virtual ~SubresourceLoader();
 
@@ -48,7 +50,7 @@ namespace WebCore {
 
     private:
         static id <WebCoreResourceHandle> create(Frame*, id <WebCoreResourceLoader>,
-            NSMutableURLRequest *, NSDictionary *customHeaders, NSString *referrer);
+            NSMutableURLRequest *, NSDictionary *customHeaders, const String& referrer);
 
         SubresourceLoader(Frame*, id <WebCoreResourceLoader>);
         id <WebCoreResourceHandle> handle();
index a901a2dda60fd3e76d80dee6ac2d1b301336bcf2..2e7098fffb06e308824825c57c9666d7e6fba9ea 100644 (file)
@@ -64,7 +64,7 @@ SubresourceLoader::~SubresourceLoader()
 }
 
 id <WebCoreResourceHandle> SubresourceLoader::create(Frame* frame, id <WebCoreResourceLoader> rLoader,
-    NSMutableURLRequest *newRequest, NSDictionary *customHeaders, NSString *referrer)
+    NSMutableURLRequest *newRequest, NSDictionary *customHeaders, const String& referrer)
 {
     FrameLoader* fl = frame->loader();
     if (fl->state() == FrameStateProvisional)
@@ -98,7 +98,7 @@ id <WebCoreResourceHandle> SubresourceLoader::create(Frame* frame, id <WebCoreRe
 }
 
 id <WebCoreResourceHandle> SubresourceLoader::create(Frame* frame, id <WebCoreResourceLoader> rLoader,
-    NSString *method, NSURL *URL, NSDictionary *customHeaders, NSString *referrer)
+    const String& method, NSURL *URL, NSDictionary *customHeaders, const String& referrer)
 {
     NSMutableURLRequest *newRequest = [[NSMutableURLRequest alloc] initWithURL:URL];    
     [newRequest setHTTPMethod:method];
@@ -108,7 +108,7 @@ id <WebCoreResourceHandle> SubresourceLoader::create(Frame* frame, id <WebCoreRe
 }
 
 id <WebCoreResourceHandle> SubresourceLoader::create(Frame* frame, id <WebCoreResourceLoader> rLoader,
-    NSString *method, NSURL *URL, NSDictionary *customHeaders, NSArray *postData, NSString *referrer)
+    const String& method, NSURL *URL, NSDictionary *customHeaders, NSArray *postData, const String& referrer)
 {
     NSMutableURLRequest *newRequest = [[NSMutableURLRequest alloc] initWithURL:URL];
     // FIXME: Because of <rdar://problem/4803505>, the method has to be set before the body.
index b199bae4c8971acb1b2bec6fa865ed73797d0b8b..ee4bfeaa05d4e8fc129ac61940036e1622832759 100644 (file)
@@ -1,3 +1,14 @@
+2006-10-26  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Darin, Maciej.
+
+        Removed many uses of NSString * from WebCore.
+        
+        Changed a few files to ObjC++ for compatiblity with new WebCore methods
+        taking WebCore::Strings as arguments.
+        
+        Added a static_cast to make the c++ compiler happy.
+
 2006-10-26  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Anders
 
 2006-10-09  Maciej Stachowiak  <mjs@apple.com>
 
->>>>>>> .r16935
         Reviewed by Alice.
 
         - moved WebFormState into Loader directory and tweaked to avoid WebKit dependencies
index bb5004192e6f3ce05bcd197b6c0d457a2460353c..d41854f864d9fe90561f82ff2fc235346a4d90f7 100644 (file)
@@ -54,7 +54,7 @@ static CFMutableDictionaryRef lookupTable = NULL;
 
 static void addLookupKey(NSString *key, SEL selector, WebElementTargetObject target)
 {
-    WebElementMethod *elementMethod = malloc(sizeof(WebElementMethod));
+    WebElementMethod *elementMethod = static_cast<WebElementMethod*>(malloc(sizeof(WebElementMethod)));
     elementMethod->target = target;
     elementMethod->selector = selector;
     CFDictionaryAddValue(lookupTable, key, elementMethod);
index 979cb1c23f106fd04f718af9c4ec1b0311dc4a1a..99b5fc6bf0fc922833e5fdc44918123280d57f3f 100644 (file)
@@ -54,9 +54,8 @@ using namespace WebCore;
 {   
     WebBaseNetscapePluginView *view = (WebBaseNetscapePluginView *)thePluginPointer->ndata;
 
-    WebFrameBridge *bridge = [[view webFrame] _bridge];
-    BOOL hideReferrer;
-    if (![bridge canLoadURL:[theRequest URL] fromReferrer:core([view webFrame])->referrer() hideReferrer:&hideReferrer])
+    bool hideReferrer;
+    if (!core([view webFrame])->loader()->canLoad([theRequest URL], core([view webFrame])->referrer(), hideReferrer))
         return nil;
 
     if ([self initWithRequestURL:[theRequest URL]
index a8941fde7a5f80b6ba143c2b1ca72bb9e3f8cab8..be7ad48e87024686bb92180eb89e57226512a6c3 100644 (file)
@@ -41,7 +41,9 @@
 #import <Foundation/NSURL.h>
 #import <Foundation/NSURLRequest.h>
 #import <JavaScriptCore/Assertions.h>
+#import <WebCore/FrameLoader.h>
 #import <WebCore/FrameLoaderTypes.h>
+#import <WebCore/FrameMac.h>
 #import <objc/objc-runtime.h>
 
 using namespace WebCore;
@@ -93,10 +95,10 @@ using namespace WebCore;
 
 - (BOOL)_isForbiddenFileLoad
 {
-   BOOL ignore;
+   bool ignore;
    WebFrameBridge *bridge = [_controller bridge];
    ASSERT(bridge);
-   if (![bridge canLoadURL:[_request URL] fromReferrer:[_controller URLPolicyCheckReferrer] hideReferrer:&ignore]) {
+   if (![bridge _frame]->loader()->canLoad([_request URL], [_controller URLPolicyCheckReferrer], ignore)) {
        [self _continueWithPolicy:PolicyIgnore];
        return YES;
    }
index 71a0f8321d0cf100555f2cb9420c82bb74b2f264..fafc8c951aead94d4d6251f98183ab07e7b0867a 100644 (file)
@@ -31,6 +31,7 @@
 
 #import <Foundation/NSURLRequest.h>
 #import <WebCore/FrameLoader.h>
+#import <WebCore/PlatformString.h>
 #import <WebCore/WebCoreFrameBridge.h>
 #import <WebCore/WebDocumentLoader.h>
 #import <WebKit/WebDataSourceInternal.h>
index 1595b722db3697b7419d42102971e5e39452a4b9..830e85f37b612ec75b35a66452d8035a33d89fca 100644 (file)
@@ -542,14 +542,14 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
 
 - (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName 
                                       withURL:(NSURL *)URL
-                                     referrer:(NSString *)referrer
+                                     referrer:(const String&)referrer
                                    ownerElement:(WebCoreElement *)ownerElement
                               allowsScrolling:(BOOL)allowsScrolling 
                                   marginWidth:(int)width
                                  marginHeight:(int)height
 {
-    BOOL hideReferrer;
-    if (![self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer])
+    bool hideReferrer;
+    if (!m_frame->loader()->canLoad(URL, referrer, hideReferrer))
         return nil;
 
     ASSERT(_frame);
@@ -568,7 +568,7 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     if (!newBridge)
         return nil;
 
-    [_frame _loadURL:URL referrer:(hideReferrer ? nil : referrer) intoChild:[newBridge webFrame]];
+    [_frame _loadURL:URL referrer:(hideReferrer ? String() : referrer) intoChild:[newBridge webFrame]];
 
     return newBridge;
 }
@@ -732,8 +732,8 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                       DOMElement:(DOMElement *)element
                     loadManually:(BOOL)loadManually
 {
-    BOOL hideReferrer;
-    if (![self canLoadURL:URL fromReferrer:m_frame->referrer() hideReferrer:&hideReferrer])
+    bool hideReferrer;
+    if (!m_frame->loader()->canLoad(URL, m_frame->referrer(), hideReferrer))
         return nil;
 
     ASSERT([attributeNames count] == [attributeValues count]);
index 73d3b2f141115a810f9441d39ad894f352098c9c..191c8dc627126de68f8a60fa4dc537bb84ee0df9 100644 (file)
 
 @class WebFrame;
 
+namespace WebCore {
+    class String;
+}
+
 class WebFrameLoaderClient : public WebCore::FrameLoaderClient {
 public:
     WebFrameLoaderClient(WebFrame*);
@@ -97,7 +101,7 @@ public:
     virtual void dispatchWillClose();
     virtual void dispatchDidReceiveIcon(NSImage *);
     virtual void dispatchDidStartProvisionalLoad();
-    virtual void dispatchDidReceiveTitle(NSString *title);
+    virtual void dispatchDidReceiveTitle(const WebCore::String& title);
     virtual void dispatchDidCommitLoad();
     virtual void dispatchDidFailProvisionalLoad(NSError *);
     virtual void dispatchDidFailLoad(NSError *);
@@ -107,8 +111,8 @@ public:
     virtual WebCore::Frame* dispatchCreatePage(NSURLRequest *);
     virtual void dispatchShow();
 
-    virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, NSString *MIMEType, NSURLRequest *);
-    virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, NSString *frameName);
+    virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, const WebCore::String& MIMEType, NSURLRequest *);
+    virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, const WebCore::String& frameName);
     virtual void dispatchDecidePolicyForNavigationAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *);
     virtual void dispatchUnableToImplementPolicy(NSError *);
 
@@ -158,9 +162,9 @@ public:
     virtual void clearArchivedResources();
 
     virtual bool canHandleRequest(NSURLRequest *) const;
-    virtual bool canShowMIMEType(NSString *MIMEType) const;
-    virtual bool representationExistsForURLScheme(NSString *URLScheme) const;
-    virtual NSString *generatedMIMETypeForURLScheme(NSString *URLScheme) const;
+    virtual bool canShowMIMEType(const WebCore::String& MIMEType) const;
+    virtual bool representationExistsForURLScheme(const WebCore::String& URLScheme) const;
+    virtual WebCore::String generatedMIMETypeForURLScheme(const WebCore::String& URLScheme) const;
 
     virtual NSDictionary *elementForEvent(NSEvent *) const;
 
index 54ceb19c4e45cb29a11f57527d6adc2067c436e3..627e60ebebc28c9b0afade30bac276d0a74d50be 100644 (file)
@@ -30,6 +30,7 @@
 
 #import "WebFrameInternal.h"
 #import <WebCore/FrameMac.h>
+#import <WebCore/PlatformString.h>
 #import <WebCore/WebCoreFrameBridge.h>
 #import <WebCore/WebDocumentLoader.h>
 #import <WebKit/DOMElement.h>
@@ -280,7 +281,7 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad()
     [m_webFrame.get() _dispatchDidStartProvisionalLoadForFrame];
 }
 
-void WebFrameLoaderClient::dispatchDidReceiveTitle(NSString *title)
+void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title)
 {
     [m_webFrame.get() _dispatchDidReceiveTitle:title];
 }
@@ -320,14 +321,12 @@ void WebFrameLoaderClient::dispatchShow()
     [m_webFrame.get() _dispatchShow];
 }
 
-void WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(WebPolicyDecider *decider, NSString *MIMEType,
-    NSURLRequest *request)
+void WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(WebPolicyDecider *decider, const String& MIMEType, NSURLRequest *request)
 {
     [m_webFrame.get() _dispatchDecidePolicyForMIMEType:MIMEType request:request decider:decider];
 }
 
-void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *decider, NSDictionary *action,
-    NSURLRequest *request, NSString *frameName)
+void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *decider, NSDictionary *action, NSURLRequest *request, const String& frameName)
 {
     [m_webFrame.get() _dispatchDecidePolicyForNewWindowAction:action request:request newFrameName:frameName
         decider:decider];
@@ -506,17 +505,17 @@ bool WebFrameLoaderClient::canHandleRequest(NSURLRequest *request) const
     return [m_webFrame.get() _canHandleRequest:request];
 }
 
-bool WebFrameLoaderClient::canShowMIMEType(NSString *MIMEType) const
+bool WebFrameLoaderClient::canShowMIMEType(const String& MIMEType) const
 {
     return [m_webFrame.get() _canShowMIMEType:MIMEType];
 }
 
-bool WebFrameLoaderClient::representationExistsForURLScheme(NSString *URLScheme) const
+bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLScheme) const
 {
     return [m_webFrame.get() _representationExistsForURLScheme:URLScheme];
 }
 
-NSString *WebFrameLoaderClient::generatedMIMETypeForURLScheme(NSString *URLScheme) const
+String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& URLScheme) const
 {
     return [m_webFrame.get() _generatedMIMETypeForURLScheme:URLScheme];
 }
index e1fe2d448d898bc1cd7159c6662e03394e2bcce6..47da7ce016064de35f49a27619fc274ac433d0a7 100644 (file)
                3944607D020F50ED0ECA1767 /* WebBackForwardList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                3944607E020F50ED0ECA1767 /* WebBackForwardList.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebBackForwardList.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                3944607F020F50ED0ECA1767 /* WebHistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItem.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               39446080020F50ED0ECA1767 /* WebHistoryItem.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebHistoryItem.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               39446080020F50ED0ECA1767 /* WebHistoryItem.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; indentWidth = 4; path = WebHistoryItem.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; };
                4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClient.mm; sourceTree = "<group>"; };
                513D422E034CF55A00CA2ACD /* WebResourceLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceLoadDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                83E4AF4C036659440000E506 /* WebPluginPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginPackage.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginViewFactoryPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                84311A1205EAAAF00088EDA4 /* WebResource.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResource.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               84311A1305EAAAF00088EDA4 /* WebResource.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebResource.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               84311A1305EAAAF00088EDA4 /* WebResource.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebResource.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                84311AF105EAB12B0088EDA4 /* WebResourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResourcePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                846171F90624AE5B0071A4A3 /* WebDOMOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDOMOperations.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               846171FA0624AE5B0071A4A3 /* WebDOMOperations.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDOMOperations.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               846171FA0624AE5B0071A4A3 /* WebDOMOperations.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebDOMOperations.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                8467275C0367158500CA2ACA /* WebPluginController.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginController.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                8467275D0367158500CA2ACA /* WebPluginController.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPluginController.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                84723BE3056D719E0044BFEA /* WebKeyGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKeyGenerator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BEE52D4B0473032500CA289C /* WebKitSystemBits.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitSystemBits.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTypesInternal.h; sourceTree = "<group>"; };
                DD89681E09AA87240097E7F0 /* WebElementDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebElementDictionary.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               DD89681F09AA87240097E7F0 /* WebElementDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebElementDictionary.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               DD89681F09AA87240097E7F0 /* WebElementDictionary.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebElementDictionary.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                ED21B9810528F7AA003299AC /* WebDocumentInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocumentInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                ED2B2474033A2DA800C1A526 /* WebNSPasteboardExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSPasteboardExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSPasteboardExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebNSPasteboardExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSAttributedStringExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                ED6BE2E6088C32B50044DEDC /* WebNSAttributedStringExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSAttributedStringExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNSDataExtrasPrivate.h; sourceTree = "<group>"; };
                F59668C802AD2923018635CA /* WebStringTruncator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebStringTruncator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F59668C902AD2923018635CA /* WebStringTruncator.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebStringTruncator.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F59EAE3E0253C7EE018635CA /* WebCoreStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreStatistics.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F59EAE410253C8DE018635CA /* WebCoreStatistics.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebCoreStatistics.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               F59EAE410253C8DE018635CA /* WebCoreStatistics.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebCoreStatistics.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F5A55DC702BAA2E8018635CC /* WebHTMLRepresentationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLRepresentationPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F5A672B90263866E01000102 /* WebBaseNetscapePluginStream.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBaseNetscapePluginStream.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F5A672BA0263866E01000102 /* WebBaseNetscapePluginStream.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebBaseNetscapePluginStream.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F5F717210288493C018635CA /* WebPluginDatabase.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginDatabase.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F5F717230288493C018635CA /* npapi.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = npapi.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F5F7174C02885C5B018635CA /* WebViewFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebViewFactory.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F5F7174D02885C5B018635CA /* WebViewFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewFactory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               F5F7174D02885C5B018635CA /* WebViewFactory.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebViewFactory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F5F732D202FF4D4F01A80180 /* WebKit.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; path = WebKit.exp; sourceTree = SOURCE_ROOT; };
                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; };
-               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; };
+               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; };
                F738C9E903FAD3DF0321FBE0 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                F738C9EA03FAD3DF0321FBE0 /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                F79B974804019934036909D2 /* CarbonUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CarbonUtils.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
index b183506236e5452c20f395942672e0f9a44e28d0..5d098e847c0d2ee9fab9e6f500e66ef069305f35 100644 (file)
@@ -734,7 +734,7 @@ DOMRange *kit(Range* range)
     if (archive)
         [childFrame loadArchive:archive];
     else
-        [childFrame _frameLoader]->load(URL, referrer, childLoadType, nil, nil, nil, nil);
+        [childFrame _frameLoader]->load(URL, referrer, childLoadType, String(), nil, nil, nil);
 }
 
 - (void)_saveScrollPositionAndViewStateToItem:(WebHistoryItem *)item