WebCore:
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Oct 2006 01:22:13 +0000 (01:22 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Oct 2006 01:22:13 +0000 (01:22 +0000)
        Reviewed by Maciej.

        Moved some WebCoreFrameBridge functions into FrameLoader.

        I had to make FrameLoader.h capable of compiling in C++-only source files
        by adding some forward declarations and __OBJC__ #ifdefs.

        * WebCore.exp:
        * bridge/mac/FrameMac.h:
        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::createEmptyDocument):
        (WebCore::FrameMac::tokenizerProcessedData):
        * bridge/mac/WebCoreFrameBridge.h:
        * bridge/mac/WebCoreFrameBridge.mm:
        * dom/Document.cpp:
        (WebCore::Document::processHttpEquiv):
        (WebCore::Document::referrer):
        * loader/LoaderFunctions.h:
        * loader/mac/FrameLoader.h:
        * loader/mac/FrameLoader.mm:
        (WebCore::numRequests):
        (WebCore::FrameLoader::numPendingOrLoadingRequests):
        (WebCore::FrameLoader::isReloading):
        (WebCore::FrameLoader::referrer):
        (WebCore::FrameLoader::loadEmptyDocumentSynchronously):
        (WebCore::FrameLoader::startLoadingResource):
        * loader/mac/LoaderFunctionsMac.mm:
        (WebCore::CheckIfReloading):
        * page/Frame.h:
        * page/FrameTree.cpp:
        (WebCore::FrameTree::isDescendantOf):
        (WebCore::FrameTree::traverseNext):
        * page/FrameTree.h:
        * platform/network/mac/ResourceLoaderMac.mm:
        (WebCore::ResourceLoader::start):

WebKit:

        Reviewed by Maciej.

        Moved some WebCoreFrameBridge functions into FrameLoader.

        * WebView/WebFrame.mm:
        (-[WebFrame _numPendingOrLoadingRequests:]):

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

17 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/bridge/mac/FrameMac.h
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/dom/Document.cpp
WebCore/loader/LoaderFunctions.h
WebCore/loader/mac/FrameLoader.h
WebCore/loader/mac/FrameLoader.mm
WebCore/loader/mac/LoaderFunctionsMac.mm
WebCore/page/Frame.h
WebCore/page/FrameTree.cpp
WebCore/page/FrameTree.h
WebCore/platform/network/mac/ResourceLoaderMac.mm
WebKit/ChangeLog
WebKit/WebView/WebFrame.mm

index bb4a3ebd953d3a3b62ca9ef647ac574c7141cf61..325a3d50128cd2c7766cb10c7edbea6eafbda303 100644 (file)
@@ -1,3 +1,41 @@
+2006-10-27  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej.
+
+        Moved some WebCoreFrameBridge functions into FrameLoader.
+        
+        I had to make FrameLoader.h capable of compiling in C++-only source files
+        by adding some forward declarations and __OBJC__ #ifdefs.
+
+        * WebCore.exp:
+        * bridge/mac/FrameMac.h:
+        * bridge/mac/FrameMac.mm:
+        (WebCore::FrameMac::createEmptyDocument):
+        (WebCore::FrameMac::tokenizerProcessedData):
+        * bridge/mac/WebCoreFrameBridge.h:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        * dom/Document.cpp:
+        (WebCore::Document::processHttpEquiv):
+        (WebCore::Document::referrer):
+        * loader/LoaderFunctions.h:
+        * loader/mac/FrameLoader.h:
+        * loader/mac/FrameLoader.mm:
+        (WebCore::numRequests):
+        (WebCore::FrameLoader::numPendingOrLoadingRequests):
+        (WebCore::FrameLoader::isReloading):
+        (WebCore::FrameLoader::referrer):
+        (WebCore::FrameLoader::loadEmptyDocumentSynchronously):
+        (WebCore::FrameLoader::startLoadingResource):
+        * loader/mac/LoaderFunctionsMac.mm:
+        (WebCore::CheckIfReloading):
+        * page/Frame.h:
+        * page/FrameTree.cpp:
+        (WebCore::FrameTree::isDescendantOf):
+        (WebCore::FrameTree::traverseNext):
+        * page/FrameTree.h:
+        * platform/network/mac/ResourceLoaderMac.mm:
+        (WebCore::ResourceLoader::start):
+
 2006-10-27  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Darin.
index a5d1376a1a9150a75b0445735ddabc044e00e21e..998b3eb80e845287841f544a82bc8af7fcca63a5 100644 (file)
@@ -263,8 +263,6 @@ __ZNK7WebCore8FrameMac19bodyBackgroundColorEv
 __ZNK7WebCore8FrameMac31fontAttributesForSelectionStartEv
 __ZNK7WebCore9FloatRectcv6CGRectEv
 __ZNK7WebCore9FloatRectcv7_NSRectEv
-__ZNK7WebCore9FrameTree12traverseNextEPNS_5FrameE
-__ZNK7WebCore9FrameTree14isDescendantOfEPNS_5FrameE
 __ZNK7WebCore9FrameTree20traverseNextWithWrapEb
 __ZNK7WebCore9FrameTree24traversePreviousWithWrapEb
 __ZNK7WebCore9FrameTree4findERKNS_12AtomicStringE
@@ -324,3 +322,7 @@ _wkSignalCFReadStreamEnd
 _wkSignalCFReadStreamError
 _wkSignalCFReadStreamHasBytes
 _wkSupportsMultipartXMixedReplace
+__ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
+__ZNK7WebCore9FrameTree12traverseNextEPKNS_5FrameE
+__ZNK7WebCore9FrameTree14isDescendantOfEPKNS_5FrameE
+
index b40eb87d236e3a9cfe8a4e472afa97c7060baa63..d8ccaa1acb411a098e7e22f5bd313986707e3121 100644 (file)
@@ -172,7 +172,6 @@ public:
 
     static WebCoreFrameBridge* bridgeForWidget(const Widget*);
     
-    virtual String incomingReferrer() const;
     virtual String userAgent() const;
 
     virtual String mimeTypeForFileName(const String&) const;
index 5844b5cea2448acb0ec69f4f846342c8e1ab36b5..3113971bb072684f8db9787bc70a0cc1c2eb3b4c 100644 (file)
@@ -1200,15 +1200,6 @@ void FrameMac::restoreDocumentState()
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
-String FrameMac::incomingReferrer() const
-{
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    return [_bridge incomingReferrer];
-    END_BLOCK_OBJC_EXCEPTIONS;
-
-    return String();
-}
-
 void FrameMac::runJavaScriptAlert(const String& message)
 {
     String text = message;
@@ -1306,10 +1297,7 @@ void FrameMac::createEmptyDocument()
     // it does nothing if we already have a document, and just creates an
     // empty one if we have no document at all.
     if (!d->m_doc) {
-        BEGIN_BLOCK_OBJC_EXCEPTIONS;
-        [_bridge loadEmptyDocumentSynchronously];
-        END_BLOCK_OBJC_EXCEPTIONS;
-
+        loader()->loadEmptyDocumentSynchronously();
         updateBaseURLForEmptyDocument();
     }
 }
@@ -2839,7 +2827,7 @@ void FrameMac::tokenizerProcessedData()
 {
     if (d->m_doc)
         checkCompleted();
-    [_bridge tokenizerProcessedData];
+    loader()->checkLoadComplete();
 }
 
 void FrameMac::setBridge(WebCoreFrameBridge *bridge)
index 3d372dba5e23d7382ad32570529f81306d75c9a7..0bfe3ad4495d3f3f1887a969d0f6d88b7ed70a82 100644 (file)
@@ -320,7 +320,6 @@ typedef enum {
 - (void)setShouldCreateRenderers:(BOOL)f;
 - (BOOL)shouldCreateRenderers;
 
-- (int)numPendingOrLoadingRequests;
 - (BOOL)doneProcessingData;
 
 - (void)setBaseBackgroundColor:(NSColor *)backgroundColor;
@@ -404,15 +403,9 @@ typedef enum {
 
 - (NSURL*)originalRequestURL;
 - (void)frameDetached;
-- (void)tokenizerProcessedData;
 - (void)receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
-- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders;
-- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)data;
 - (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data;
 - (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalNSURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode;
-- (BOOL)isReloading;
-- (NSString *)incomingReferrer;
-- (void)loadEmptyDocumentSynchronously;
 
 @end
 
index e673c6729a3fd545c17f87be0d91294ea732a586..38c5436e7c4cfaa1a537cd1391a85896dfebac23 100644 (file)
@@ -1236,14 +1236,6 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     return _shouldCreateRenderers;
 }
 
-- (int)numPendingOrLoadingRequests
-{
-    Document *doc = m_frame->document();
-    if (doc)
-        return NumberOfPendingOrLoadingRequests(doc->docLoader());
-    return 0;
-}
-
 - (BOOL)doneProcessingData
 {
     Document *doc = m_frame->document();
@@ -2148,11 +2140,6 @@ static NSCharacterSet *_getPostSmartSet(void)
     m_frame->loader()->detachFromParent();
 }
 
-- (void)tokenizerProcessedData
-{
-    m_frame->loader()->checkLoadComplete();
-}
-
 - (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.
@@ -2166,24 +2153,6 @@ static NSCharacterSet *_getPostSmartSet(void)
     [self addData:data];
 }
 
-- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders
-{
-    // If we are no longer attached to a page, this must be an attempted load from an
-    // onunload handler, so let's just block it.
-    if (!m_frame->page())
-        return nil;
-    
-    // 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.
-    String referrer = m_frame->referrer();
-    bool hideReferrer;
-    m_frame->loader()->canLoad(URL, referrer, hideReferrer);
-    if (hideReferrer)
-        referrer = String();
-    
-    return SubresourceLoader::create(m_frame, resourceLoader, method, URL, customHeaders, referrer);
-}
-
 - (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data
 {
     if (!m_frame)
@@ -2198,25 +2167,6 @@ static NSCharacterSet *_getPostSmartSet(void)
     [request release];
 }
 
-- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withMethod:(NSString *)method URL:(NSURL *)URL
-    customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)postData
-{
-    // If we are no longer attached to a Page, this must be an attempted load from an
-    // onunload handler, so let's just block it.
-    if (!m_frame->page())
-        return nil;
-    
-    // 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.
-    String referrer = m_frame->referrer();
-    bool hideReferrer;
-    m_frame->loader()->canLoad(URL, referrer, hideReferrer);
-    if (hideReferrer)
-        referrer = String();
-    
-    return SubresourceLoader::create(m_frame, resourceLoader, method, URL, customHeaders, postData, referrer);
-}
-
 - (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode
 {
     // Since this is a subresource, we can load any URL (we ignore the return value).
@@ -2292,28 +2242,6 @@ static NSCharacterSet *_getPostSmartSet(void)
 
 // -------------------
 
-- (NSString *)incomingReferrer
-{
-    return [m_frame->loader()->documentLoader()->request() valueForHTTPHeaderField:@"Referer"];
-}
-
-- (BOOL)isReloading
-{
-    return [m_frame->loader()->documentLoader()->request() cachePolicy] == NSURLRequestReloadIgnoringCacheData;
-}
-
-- (void)loadEmptyDocumentSynchronously
-{
-    if (!m_frame)
-        return;
-        
-    NSURL *url = [[NSURL alloc] initWithString:@""];
-    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
-    m_frame->loader()->load(request);
-    [request release];
-    [url release];
-}
-
 - (FrameMac*)_frame
 {
     return m_frame;
index cb7a5d5f0d0d2a47417d90be889099b2ae437078..b9e22a660a372f412eb0dec8032d412fbb26a42e 100644 (file)
@@ -42,6 +42,7 @@
 #include "EventNames.h"
 #include "ExceptionCode.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "FrameTree.h"
 #include "HTMLBodyElement.h"
 #include "HTMLDocument.h"
@@ -1652,8 +1653,7 @@ void Document::processHttpEquiv(const String &equiv, const String &content)
     } else if (equalIgnoringCase(equiv, "expires")) {
         String str = content.stripWhiteSpace();
         time_t expire_date = str.toInt();
-        if (m_docLoader)
-            m_docLoader->setExpireDate(expire_date);
+        m_docLoader->setExpireDate(expire_date);
     } else if ((equalIgnoringCase(equiv, "pragma") || equalIgnoringCase(equiv, "cache-control")) && frame) {
         DeprecatedString str = content.deprecatedString().lower().stripWhiteSpace();
         KURL url = frame->url();
@@ -2374,7 +2374,7 @@ Element *Document::ownerElement() const
 String Document::referrer() const
 {
     if (frame())
-        return frame()->incomingReferrer();
+        return frame()->loader()->referrer();
     
     return String();
 }
index 6f190160b9c8f65e3873a9942223de81015c38e6..a9bfd4d42b4fcf86a7329860fdaded0461f91749 100644 (file)
@@ -59,7 +59,6 @@ bool IsResponseURLEqualToURL(PlatformResponse , const String& URL);
 DeprecatedString ResponseURL(PlatformResponse);
 DeprecatedString ResponseMIMEType(PlatformResponse);
 bool ResponseIsMultipart(PlatformResponse);
-int NumberOfPendingOrLoadingRequests(DocLoader*);
 time_t CacheObjectExpiresTime(DocLoader*, PlatformResponse);
 NSString* HeaderStringFromDictionary(NSDictionary* headers, int statusCode);
 
index 13814001a6bceb5b62064943c7703d2ca683cf71..9afab6cd14e84ef6a389aae1bb8241a1f9722594 100644 (file)
 #if PLATFORM(MAC)
 
 #import "RetainPtr.h"
+#import <objc/objc.h>
 
+#ifdef __OBJC__
 @class WebCoreFrameBridge;
 @class WebCoreFrameLoaderAsDelegate;
 @class WebPolicyDecider;
 
-#endif
+@class NSArray;
+@class NSDate;
+@class NSURL;
+@class NSURLConnection;
+@class NSURLRequest;
+@class NSURLResponse;
+@class NSDictionary;
+@class NSEvent;
+@class NSError;
+@class NSData;
+@class NSMutableURLRequest;
+@class NSURLAuthenticationChallenge;
+
+@protocol WebCoreResourceLoader;
+@protocol WebCoreResourceHandle;
+
+#else
+
+class WebCoreFrameBridge;
+class WebCoreFrameLoaderAsDelegate;
+class WebPolicyDecider;
+
+class NSArray;
+class NSDate;
+class NSURL;
+class NSURLConnection;
+class NSURLRequest;
+class NSURLResponse;
+class NSDictionary;
+class NSEvent;
+class NSError;
+class NSData;
+class NSMutableURLRequest;
+class NSURLAuthenticationChallenge;
+#endif // __OBJC__
+
+#endif // PLATFORM(MAC)
 
 namespace WebCore {
 
@@ -52,6 +90,7 @@ namespace WebCore {
     class FrameLoaderClient;
     class MainResourceLoader;
     class String;
+    class SubresourceLoader;
     class WebResourceLoader;
 
     bool isBackForwardLoadType(FrameLoadType);
@@ -98,6 +137,16 @@ namespace WebCore {
         NSData *mainResourceData() const;
         void releaseMainResourceLoader();
 
+        int numPendingOrLoadingRequests(bool recurse) const;
+        bool isReloading() const;
+        String referrer() const;
+        void loadEmptyDocumentSynchronously();
+
+#ifdef __OBJC__
+        id <WebCoreResourceHandle> startLoadingResource(id <WebCoreResourceLoader> resourceLoader, const String& method, NSURL *URL, NSDictionary *customHeaders);
+        id <WebCoreResourceHandle> startLoadingResource(id <WebCoreResourceLoader> resourceLoader, const String& method, NSURL *URL, NSDictionary *customHeaders, NSArray *postData);
+#endif
+        
         DocumentLoader* activeDocumentLoader() const;
         DocumentLoader* documentLoader() const;
         DocumentLoader* provisionalDocumentLoader();
index 46ff1001e65a24a5ccca747dc38d6a6b16b0e141..5ddc22ab6da25bccbe5a859920f58d812538e61d 100644 (file)
@@ -29,6 +29,8 @@
 #import "config.h"
 #import "FrameLoader.h"
 
+#import "Cache.h"
+#import "Document.h"
 #import "DOMElementInternal.h"
 #import "Element.h"
 #import "FrameLoadRequest.h"
@@ -48,6 +50,7 @@
 #import "WebFrameLoaderClient.h"
 #import "WebMainResourceLoader.h"
 #import "WebPolicyDecider.h"
+#import "WebSubresourceLoader.h"
 #import <objc/objc-runtime.h>
 #import <wtf/Assertions.h>
 
@@ -101,6 +104,13 @@ bool isBackForwardLoadType(FrameLoadType type)
     return false;
 }
 
+static int numRequests(Document* document)
+{
+    if (document)
+        return cache()->loader()->numRequests(document->docLoader());
+    return 0;
+}
+
 FrameLoader::FrameLoader(Frame* frame)
     : m_frame(frame)
     , m_client(nil)
@@ -1741,6 +1751,75 @@ void FrameLoader::checkLoadComplete()
         frame->loader()->checkLoadCompleteForThisFrame();
 }
 
+int FrameLoader::numPendingOrLoadingRequests(bool recurse) const
+{
+    int count = 0;
+    const Frame* frame = m_frame;
+
+    count += numRequests(frame->document());
+
+    if (recurse)
+        while ((frame = frame->tree()->traverseNext(frame)))
+            count += numRequests(frame->document());
+
+    return count;
+}
+
+bool FrameLoader::isReloading() const
+{
+    return [documentLoader()->request() cachePolicy] == NSURLRequestReloadIgnoringCacheData;
+}
+
+String FrameLoader::referrer() const
+{
+    return [documentLoader()->request() valueForHTTPHeaderField:@"Referer"];
+}
+
+void FrameLoader::loadEmptyDocumentSynchronously()
+{
+    NSURL *url = [[NSURL alloc] initWithString:@""];
+    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
+    m_frame->loader()->load(request);
+    [request release];
+    [url release];
+}
+
+id <WebCoreResourceHandle> FrameLoader::startLoadingResource(id <WebCoreResourceLoader> resourceLoader, const String& method, NSURL *URL, NSDictionary *customHeaders)
+{
+    // If we are no longer attached to a page, this must be an attempted load from an
+    // onunload handler, so let's just block it.
+    if (!m_frame->page())
+        return nil;
+    
+    // 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.
+    String referrer = m_frame->referrer();
+    bool hideReferrer;
+    canLoad(URL, referrer, hideReferrer);
+    if (hideReferrer)
+        referrer = String();
+    
+    return SubresourceLoader::create(m_frame, resourceLoader, method, URL, customHeaders, referrer);
+}
+
+id <WebCoreResourceHandle> FrameLoader::startLoadingResource(id <WebCoreResourceLoader> resourceLoader, const String& method, NSURL *URL, NSDictionary *customHeaders, NSArray *postData)
+{
+    // If we are no longer attached to a Page, this must be an attempted load from an
+    // onunload handler, so let's just block it.
+    if (!m_frame->page())
+        return nil;
+    
+    // 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.
+    String referrer = m_frame->referrer();
+    bool hideReferrer;
+    canLoad(URL, referrer, hideReferrer);
+    if (hideReferrer)
+        referrer = String();
+    
+    return SubresourceLoader::create(m_frame, resourceLoader, method, URL, customHeaders, postData, referrer);
+}
+
 void FrameLoader::setClient(FrameLoaderClient* client)
 {
     ASSERT(client);
index dfaef24e0f89e7fd25615c12befdad01a7a66e36..9b63011fd6d20089210f10b474179f582c8a59f9 100644 (file)
@@ -31,6 +31,7 @@
 #import "CachedImage.h"
 #import "DocLoader.h"
 #import "FoundationExtras.h"
+#import "FrameLoader.h"
 #import "FrameMac.h"
 #import "FormData.h"
 #import "FormDataMac.h"
@@ -129,18 +130,10 @@ Vector<char> ServeSynchronousRequest(Loader *loader, DocLoader *docLoader, const
     return Vector<char>();
 }
 
-int NumberOfPendingOrLoadingRequests(DocLoader *dl)
-{
-    return cache()->loader()->numRequests(dl);
-}
-
 bool CheckIfReloading(DocLoader *loader)
 {
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    if (FrameMac *frame = static_cast<FrameMac *>(loader->frame()))
-        return [frame->bridge() isReloading];
-    END_BLOCK_OBJC_EXCEPTIONS;
-
+    if (Frame* frame = loader->frame())
+        return frame->loader()->isReloading();
     return false;
 }
 
index fb30fd6b26585ed7a199a224bcf025aa1df799d2..362fbe6a455846a8873f22a09329037010c4c5ac 100644 (file)
@@ -553,7 +553,6 @@ public:
   virtual void setTitle(const String&) = 0;
   virtual void handledOnloadEvents() = 0;
   virtual String userAgent() const = 0;
-  virtual String incomingReferrer() const = 0;
   virtual String mimeTypeForFileName(const String&) const = 0;
   virtual KJS::Bindings::Instance* getEmbedInstanceForWidget(Widget*) = 0;
   virtual KJS::Bindings::Instance* getObjectInstanceForWidget(Widget*) = 0;
index 1fc79f6138e116fbae6ff0bcd94742987b049bd9..549595a37fa1af651ef66c523d9762e8af9dd2d7 100644 (file)
@@ -204,7 +204,7 @@ Frame* FrameTree::find(const AtomicString& name) const
     return 0;
 }
 
-bool FrameTree::isDescendantOf(Frame* ancestor) const
+bool FrameTree::isDescendantOf(const Frame* ancestor) const
 {
     for (Frame* frame = m_thisFrame; frame; frame = frame->tree()->parent())
         if (frame == ancestor)
@@ -212,7 +212,7 @@ bool FrameTree::isDescendantOf(Frame* ancestor) const
     return false;
 }
 
-Frame* FrameTree::traverseNext(Frame* stayWithin) const
+Frame* FrameTree::traverseNext(const Frame* stayWithin) const
 {
     Frame* child = firstChild();
     if (child) {
index 78b5ca175b71b4afee9c7609b2a42f64d4f595c2..cf6b2f6ea2f2d7c404d0ec5c4552df6c3d6196c8 100644 (file)
@@ -50,8 +50,8 @@ namespace WebCore {
         Frame* lastChild() const { return m_lastChild; }
         unsigned childCount() const { return m_childCount; }
 
-        bool isDescendantOf(Frame* ancestor) const;
-        Frame* traverseNext(Frame* stayWithin = 0) const;
+        bool isDescendantOf(const Frame* ancestor) const;
+        Frame* traverseNext(const Frame* stayWithin = 0) const;
         Frame* traverseNextWithWrap(bool) const;
         Frame* traversePreviousWithWrap(bool) const;
         
index dc5d922c8c5e0dbfe5019da5d1837b753d1f63a7..0d0bc2c540ff5d9819a503cd267c7f53bd62bc92 100644 (file)
@@ -30,6 +30,7 @@
 #import "BlockExceptions.h"
 #import "DocLoader.h"
 #import "FoundationExtras.h"
+#import "FrameLoader.h"
 #import "FrameMac.h"
 #import "KURL.h"
 #import "FormDataMac.h"
@@ -68,8 +69,6 @@ bool ResourceLoader::start(DocLoader* docLoader)
         return false;
     }
 
-    WebCoreFrameBridge* bridge = frame->bridge();
-
     frame->didTellBridgeAboutLoad(url().url());
 
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
@@ -84,9 +83,9 @@ bool ResourceLoader::start(DocLoader* docLoader)
         headerDict = [NSDictionary _webcore_dictionaryWithHeaderMap:d->m_request.httpHeaderFields()];
 
     if (!postData().elements().isEmpty())
-        handle = [bridge startLoadingResource:resourceLoader withMethod:method() URL:url().getNSURL() customHeaders:headerDict postData:arrayFromFormData(postData())];
+        handle = frame->loader()->startLoadingResource(resourceLoader, method(), url().getNSURL(), headerDict, arrayFromFormData(postData()));
     else
-        handle = [bridge startLoadingResource:resourceLoader withMethod:method() URL:url().getNSURL() customHeaders:headerDict];
+        handle = frame->loader()->startLoadingResource(resourceLoader, method(), url().getNSURL(), headerDict);
     [resourceLoader setHandle:handle];
     [resourceLoader release];
 
index 5529ccc9d26bc74794c6fe4c83edb8a4cba6e637..b46863a5bd885a736a8acabc9e66f6e6a102e59e 100644 (file)
@@ -1,3 +1,12 @@
+2006-10-27  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej.
+        
+        Moved some WebCoreFrameBridge functions into FrameLoader.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _numPendingOrLoadingRequests:]):
+
 2006-10-27  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Beth.
index 0baa7f62d233946fd0d07b7a16bd75d25afa2c17..e201c4ef09ba3c21b001098d2e4b0c76606c4408 100644 (file)
@@ -724,15 +724,7 @@ DOMRange *kit(Range* range)
 
 - (int)_numPendingOrLoadingRequests:(BOOL)recurse
 {
-    if (!recurse)
-        return [_private->bridge numPendingOrLoadingRequests];
-
-    int num = 0;
-    Frame* coreFrame = core(self);
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
-        num += [Mac(frame)->bridge() numPendingOrLoadingRequests];
-
-    return num;
+    return core(self)->loader()->numPendingOrLoadingRequests(recurse);
 }
 
 - (void)_reloadForPluginChanges