WebCore:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Aug 2006 00:09:28 +0000 (00:09 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Aug 2006 00:09:28 +0000 (00:09 +0000)
        Reviewed by Anders.

        - added some SPI indirections to support the following in WebKit/Loader:
            - pull more WebDataSource code into WebFrameLoader
            - make WebMainResourceLoader not depend on WebKit or on SPI

        * WebCore.exp:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:

WebKit:

        Reviewed by Anders.

        - pull more WebDataSource code into WebFrameLoader
        - make WebMainResourceLoader not depend on WebKit or on SPI

        * Loader/WebFrameLoader.h:
        * Loader/WebFrameLoader.m:
        (-[WebFrameLoader _downloadWithLoadingConnection:request:response:proxy:]):
        (-[WebFrameLoader _updateIconDatabaseWithURL:]):
        (-[WebFrameLoader _notifyIconChanged:]):
        (-[WebFrameLoader _iconLoaderReceivedPageIcon:]):
        (-[WebFrameLoader _checkNavigationPolicyForRequest:andCall:withSelector:]):
        (-[WebFrameLoader _checkContentPolicyForMIMEType:andCall:withSelector:]):
        (-[WebFrameLoader cancelContentPolicy]):
        * Loader/WebIconLoader.m:
        (-[WebIconLoader didFinishLoading]):
        * Loader/WebLoader.m:
        (-[NSURLProtocol loadWithRequest:]):
        (-[NSURLProtocol setDefersCallbacks:]):
        * Loader/WebMainResourceLoader.h:
        * Loader/WebMainResourceLoader.m:
        (-[WebMainResourceLoader initWithFrameLoader:]):
        (-[WebMainResourceLoader dealloc]):
        (-[WebMainResourceLoader cancelWithError:]):
        (-[WebMainResourceLoader continueAfterNavigationPolicy:formState:]):
        (-[WebMainResourceLoader willSendRequest:redirectResponse:]):
        (-[WebMainResourceLoader continueAfterContentPolicy:]):
        (-[WebMainResourceLoader checkContentPolicy]):
        (-[WebMainResourceLoader didReceiveResponse:]):
        * Plugins/WebPluginContainerCheck.m:
        * WebCoreSupport/WebSystemInterface.m:
        (InitWebCoreSystemInterface):
        * WebView/WebDataSource.m:
        (-[WebDataSource _loadIcon]):
        (-[WebDataSource _cancelledError]):
        (+[WebDataSource _repTypesAllowImageTypeOmission:]):
        (+[WebDataSource _representationClassForMIMEType:]):
        (-[WebDataSource _commitLoadWithData:]):
        (-[WebDataSource _isDocumentHTML]):
        * WebView/WebDataSourceInternal.h:
        * WebView/WebFramePrivate.h:
        * WebView/WebPolicyDelegate.m:
        * WebView/WebPolicyDelegatePrivate.h:

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

19 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/platform/mac/WebCoreSystemInterface.mm
WebKit/ChangeLog
WebKit/Loader/WebFrameLoader.h
WebKit/Loader/WebFrameLoader.m
WebKit/Loader/WebIconLoader.m
WebKit/Loader/WebLoader.m
WebKit/Loader/WebMainResourceLoader.h
WebKit/Loader/WebMainResourceLoader.m
WebKit/Plugins/WebPluginContainerCheck.m
WebKit/WebCoreSupport/WebSystemInterface.m
WebKit/WebView/WebDataSource.m
WebKit/WebView/WebDataSourceInternal.h
WebKit/WebView/WebFramePrivate.h
WebKit/WebView/WebPolicyDelegate.m
WebKit/WebView/WebPolicyDelegatePrivate.h

index 17f03b58f85cfbf6f3457626a162836e12a660fc..0ec596ade6d5997fcaed340a1b8797e5c8f3fa2a 100644 (file)
@@ -1,3 +1,16 @@
+2006-08-22  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Anders.
+
+        - added some SPI indirections to support the following in WebKit/Loader:
+            - pull more WebDataSource code into WebFrameLoader
+            - make WebMainResourceLoader not depend on WebKit or on SPI
+
+        * WebCore.exp:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+
 2006-08-22  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
index 11edf42ecaefec54bec220c19d4832d18b0beb6d..86e6c8e5bceef6ee2647ae596cca3bb4d790ee47 100644 (file)
@@ -133,6 +133,7 @@ _wkCGContextGetShouldSmoothFonts
 _wkClearGlyphVector
 _wkConvertCharToGlyphs
 _wkCreateCustomCFReadStream
+_wkCreateNSURLConnectionDelegateProxy
 _wkDrawBezeledTextArea
 _wkDrawBezeledTextFieldCell
 _wkDrawFocusRing
@@ -155,6 +156,7 @@ _wkPopupMenu
 _wkReleaseStyleGroup
 _wkSetCGFontRenderingMode
 _wkSetDragImage
+_wkSetNSURLConnectionDefersCallbacks
 _wkSetPatternPhaseInUserSpace
 _wkSetUpFontCache
 _wkSignalCFReadStreamEnd
index 996756fdfee5b96e5db311bf3d53310eea4a79cd..30bb0d2a2b7030255a3f613fb4b402b8fc3fdf78 100644 (file)
                FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
 /* End PBXBuildFile section */
 
-/* Begin PBXBuildStyle section */
-               BCD318860A92909400BF1D5F /* Development */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = NO;
-                       };
-                       name = Development;
-               };
-               BCD318870A92909400BF1D5F /* Deployment */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                       };
-                       name = Deployment;
-               };
-/* End PBXBuildStyle section */
-
 /* Begin PBXContainerItemProxy section */
                DD041FF009D9E3250010AF2A /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       buildSettings = {
-                       };
-                       buildStyles = (
-                               BCD318860A92909400BF1D5F /* Development */,
-                               BCD318870A92909400BF1D5F /* Deployment */,
-                       );
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
index beebb83fdf55c5f59b945a3f8203a7c756063983..c952620001fd942b08be93c0d6d199ff35fa3dab 100644 (file)
@@ -55,6 +55,7 @@ class NSImage;
 class NSMenu;
 class NSString;
 class NSView;
+class NSURLConnection;
 #endif
 
 #ifdef __cplusplus
@@ -104,6 +105,8 @@ extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadS
     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
     void *context);
+extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
+extern id (*wkCreateNSURLConnectionDelegateProxy)(void);
 
 #ifdef __cplusplus
 }
index 85f1eb9fac624ab2506b7b726e92b03e2491264c..65bf98201b0d1a6926c84c7ea953d53ff9dadbba 100644 (file)
@@ -65,3 +65,5 @@ CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRe
     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
     void *context);
+void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
+id (*wkCreateNSURLConnectionDelegateProxy)(void);
index e283e13a86ef936a152116ad8b54d91bf41a2c08..359a3f88d86f26166a0031a17e117fe170a7aff2 100644 (file)
@@ -1,3 +1,49 @@
+2006-08-22  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Anders.
+        
+        - pull more WebDataSource code into WebFrameLoader
+        - make WebMainResourceLoader not depend on WebKit or on SPI
+
+        * Loader/WebFrameLoader.h:
+        * Loader/WebFrameLoader.m:
+        (-[WebFrameLoader _downloadWithLoadingConnection:request:response:proxy:]):
+        (-[WebFrameLoader _updateIconDatabaseWithURL:]):
+        (-[WebFrameLoader _notifyIconChanged:]):
+        (-[WebFrameLoader _iconLoaderReceivedPageIcon:]):
+        (-[WebFrameLoader _checkNavigationPolicyForRequest:andCall:withSelector:]):
+        (-[WebFrameLoader _checkContentPolicyForMIMEType:andCall:withSelector:]):
+        (-[WebFrameLoader cancelContentPolicy]):
+        * Loader/WebIconLoader.m:
+        (-[WebIconLoader didFinishLoading]):
+        * Loader/WebLoader.m:
+        (-[NSURLProtocol loadWithRequest:]):
+        (-[NSURLProtocol setDefersCallbacks:]):
+        * Loader/WebMainResourceLoader.h:
+        * Loader/WebMainResourceLoader.m:
+        (-[WebMainResourceLoader initWithFrameLoader:]):
+        (-[WebMainResourceLoader dealloc]):
+        (-[WebMainResourceLoader cancelWithError:]):
+        (-[WebMainResourceLoader continueAfterNavigationPolicy:formState:]):
+        (-[WebMainResourceLoader willSendRequest:redirectResponse:]):
+        (-[WebMainResourceLoader continueAfterContentPolicy:]):
+        (-[WebMainResourceLoader checkContentPolicy]):
+        (-[WebMainResourceLoader didReceiveResponse:]):
+        * Plugins/WebPluginContainerCheck.m:
+        * WebCoreSupport/WebSystemInterface.m:
+        (InitWebCoreSystemInterface):
+        * WebView/WebDataSource.m:
+        (-[WebDataSource _loadIcon]):
+        (-[WebDataSource _cancelledError]):
+        (+[WebDataSource _repTypesAllowImageTypeOmission:]):
+        (+[WebDataSource _representationClassForMIMEType:]):
+        (-[WebDataSource _commitLoadWithData:]):
+        (-[WebDataSource _isDocumentHTML]):
+        * WebView/WebDataSourceInternal.h:
+        * WebView/WebFramePrivate.h:
+        * WebView/WebPolicyDelegate.m:
+        * WebView/WebPolicyDelegatePrivate.h:
+
 2006-08-21  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Brady.
index a11dc374d9a1cb588f3db36ad04c45f7b8f2cecb..607d07505db39adea2fab049a956fb8aea991b9d 100644 (file)
  */
 
 #import <Cocoa/Cocoa.h>
-#import <WebKit/WebFramePrivate.h>
-#import <WebKitSystemInterface.h>
 
 @class WebDataSource;
 @class WebMainResourceLoader;
 @class WebIconLoader;
 @class WebLoader;
 @class WebResource;
+@class WebFrame;
+@class WebPolicyDecisionListener;
+
+typedef enum {
+    WebFrameStateProvisional,
+    
+    // This state indicates we are ready to commit to a page,
+    // which means the view will transition to use the new data source.
+    WebFrameStateCommittedPage,
+    
+    WebFrameStateComplete
+} WebFrameState;
+
+typedef enum {
+    WebPolicyUse,
+    WebPolicyDownload,
+    WebPolicyIgnore,
+} WebPolicyAction;
 
 @interface WebFrameLoader : NSObject
 {
@@ -50,6 +66,8 @@
     WebDataSource *provisionalDataSource;
     WebFrameState state;
     
+    WebPolicyDecisionListener *listener;
+    
     NSMutableDictionary *pendingArchivedResources;
 }
 
 - (NSURLRequest *)initialRequest;
 - (void)_receivedData:(NSData *)data;
 - (void)_setRequest:(NSURLRequest *)request;
-- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)r proxy:(WKNSURLConnectionDelegateProxyPtr)proxy;
+- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)r proxy:(id)proxy;
 - (void)_handleFallbackContent;
 - (BOOL)_isStopping;
-- (void)_decidePolicyForMIMEType:(NSString *)MIMEType decisionListener:(WebPolicyDecisionListener *)listener;
 - (void)_setupForReplaceByMIMEType:(NSString *)newMIMEType;
 - (void)_setResponse:(NSURLResponse *)response;
 - (void)_mainReceivedError:(NSError *)error complete:(BOOL)isComplete;
 - (void)_finishedLoading;
-- (void)_iconLoaderReceivedPageIcon:(WebIconLoader *)iconLoader;
+- (void)_iconLoaderReceivedPageIcon:(NSURL *)iconURL;
 - (NSURL *)_URL;
 
 - (NSError *)cancelledErrorWithRequest:(NSURLRequest *)request;
 + (BOOL)_canShowMIMEType:(NSString *)MIMEType;
 + (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme;
 + (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme;
-                                                                                                      
+- (void)_updateIconDatabaseWithURL:(NSURL *)iconURL;
+- (void)_notifyIconChanged:(NSURL *)iconURL;
+- (void)_checkNavigationPolicyForRequest:(NSURLRequest *)newRequest andCall:(id)obj withSelector:(SEL)sel;
+- (void)_checkContentPolicyForMIMEType:(NSString *)MIMEType andCall:(id)obj withSelector:(SEL)sel;
+- (void)cancelContentPolicy;
+
 @end
index 2746861979de48b87ee9802c523482eaf98c7a75..891926f6aee95dad273154da4c01da2fee08a139 100644 (file)
 #import <WebKit/DOMHTML.h>
 #import <WebKit/WebFrameBridge.h>
 #import <WebKit/WebPreferences.h>
+#import <WebKit/WebIconDatabasePrivate.h>
+#import <WebKit/WebNSURLExtras.h>
+#import <WebKit/WebFrameLoadDelegate.h>
+
 
 @implementation WebFrameLoader
 
@@ -458,7 +462,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [[self activeDataSource] _setRequest:request];
 }
 
-- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)r proxy:(WKNSURLConnectionDelegateProxyPtr)proxy
+- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)r proxy:(id)proxy
 {
     [[self activeDataSource] _downloadWithLoadingConnection:connection request:request response:r proxy:proxy];
 }
@@ -473,11 +477,6 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     return [[self activeDataSource] _isStopping];
 }
 
-- (void)_decidePolicyForMIMEType:(NSString *)MIMEType decisionListener:(WebPolicyDecisionListener *)listener
-{
-    [[self activeDataSource] _decidePolicyForMIMEType:MIMEType decisionListener:listener];
-}
-
 - (void)_setupForReplaceByMIMEType:(NSString *)newMIMEType
 {
     [[self activeDataSource] _setupForReplaceByMIMEType:newMIMEType];
@@ -511,10 +510,37 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [self release];
 }
 
-- (void)_iconLoaderReceivedPageIcon:(WebIconLoader *)iLoader
+- (void)_updateIconDatabaseWithURL:(NSURL *)iconURL
+{
+    ASSERT([[WebIconDatabase sharedIconDatabase] _isEnabled]);
+    
+    WebIconDatabase *iconDB = [WebIconDatabase sharedIconDatabase];
+    
+    // Bind the URL of the original request and the final URL to the icon URL.
+    [iconDB _setIconURL:[iconURL _web_originalDataAsString] forURL:[[[self activeDataSource] _URL] _web_originalDataAsString]];
+    [iconDB _setIconURL:[iconURL _web_originalDataAsString] forURL:[[[[self activeDataSource] _originalRequest] URL] _web_originalDataAsString]];    
+}
+
+- (void)_notifyIconChanged:(NSURL *)iconURL
+{
+    ASSERT([[WebIconDatabase sharedIconDatabase] _isEnabled]);
+    ASSERT(webFrame == [[webFrame webView] mainFrame]);
+
+    [[webFrame webView] _willChangeValueForKey:_WebMainFrameIconKey];
+    
+    NSImage *icon = [[WebIconDatabase sharedIconDatabase] iconForURL:[[[self activeDataSource] _URL] _web_originalDataAsString] withSize:WebIconSmallSize];
+    
+    [[[webFrame webView] _frameLoadDelegateForwarder] webView:[webFrame webView]
+                                               didReceiveIcon:icon
+                                                     forFrame:webFrame];
+    
+    [[webFrame webView] _didChangeValueForKey:_WebMainFrameIconKey];
+}
+
+- (void)_iconLoaderReceivedPageIcon:(NSURL *)iconURL
 {
-    ASSERT(iLoader == iconLoader);
-    [[self activeDataSource] _iconLoaderReceivedPageIcon:iLoader];
+    [self _updateIconDatabaseWithURL:iconURL];
+    [self _notifyIconChanged:iconURL];
 }
 
 - (NSURL *)_URL
@@ -688,4 +714,30 @@ static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
     return [WebView _generatedMIMETypeForURLScheme:URLScheme];
 }
 
+- (void)_checkNavigationPolicyForRequest:(NSURLRequest *)newRequest andCall:(id)obj withSelector:(SEL)sel
+{
+    [webFrame _checkNavigationPolicyForRequest:newRequest
+                                    dataSource:[self activeDataSource]
+                                     formState:nil
+                                       andCall:obj
+                                  withSelector:sel];
+}
+
+- (void)_checkContentPolicyForMIMEType:(NSString *)MIMEType andCall:(id)obj withSelector:(SEL)sel
+{
+    WebPolicyDecisionListener *l = [[WebPolicyDecisionListener alloc] _initWithTarget:obj action:sel];
+    listener = l;
+    
+    [l retain];
+    [[self activeDataSource] _decidePolicyForMIMEType:MIMEType decisionListener:l];
+    [l release];
+}
+
+- (void)cancelContentPolicy
+{
+    [listener _invalidate];
+    [listener release];
+    listener = nil;
+}
+
 @end
index a41b997a64c6fd0b9515200827283702c8ea79bd..9f2cb1114c1e3a82e321e6ebef8803cca1a6f90d 100644 (file)
         [[WebIconDatabaseBridge sharedBridgeInstance] _setHaveNoIconForIconURL:[[self URL] _web_originalDataAsString]];
         LOG(IconDatabase, "NewDB - No icon for URL %@", [[self URL] _web_originalDataAsString]);
     }
-    [frameLoader _iconLoaderReceivedPageIcon:self];
+    [frameLoader _iconLoaderReceivedPageIcon:[self URL]];
     [super didFinishLoading];
 #else
     NSImage *icon;
         [[WebIconDatabase sharedIconDatabase] _setHaveNoIconForIconURL:[[self URL] _web_originalDataAsString]];
     }
 
-    [frameLoader _iconLoaderReceivedPageIcon:self];    
+    [frameLoader _iconLoaderReceivedPageIcon:[self URL]];
     [icon release];
     [super didFinishLoading];
 #endif
index 7883969709f258ba0689c35d719505df34127598..a2535e2afee1dd130de01b76243093cc2e43b6f0 100644 (file)
@@ -36,6 +36,7 @@
 #import <JavaScriptCore/Assertions.h>
 #import <WebKit/WebDataProtocol.h>
 #import <WebKit/WebFrameLoader.h>
+#import <WebCore/WebCoreSystemInterface.h>
 
 static unsigned inNSURLConnectionCallback;
 static BOOL NSURLConnectionSupportsBufferedData;
@@ -170,9 +171,8 @@ static BOOL NSURLConnectionSupportsBufferedData;
 #ifndef NDEBUG
     isInitializingConnection = NO;
 #endif
-    if (defersCallbacks) {
-        WKSetNSURLConnectionDefersCallbacks(connection, YES);
-    }
+    if (defersCallbacks)
+        wkSetNSURLConnectionDefersCallbacks(connection, YES);
 
     return YES;
 }
@@ -180,7 +180,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
 - (void)setDefersCallbacks:(BOOL)defers
 {
     defersCallbacks = defers;
-    WKSetNSURLConnectionDefersCallbacks(connection, defers);
+    wkSetNSURLConnectionDefersCallbacks(connection, defers);
     // Deliver the resource after a delay because callers don't expect to receive callbacks while calling this method.
 }
 
index b46dbdd852750e4b127fcdc5214e397e878e844b..3e66da0c32a4155cfceea892b67d1dd6f8a552b1 100644 (file)
 #import <Foundation/Foundation.h>
 
 #import <WebKit/WebLoader.h>
-#import <WebKitSystemInterface.h>
-
-@class WebPolicyDecisionListener;
 
 @interface WebMainResourceLoader : WebLoader
 {
     int _contentLength; // for logging only
     int _bytesReceived; // for logging only
-    WebPolicyDecisionListener *listener;
-    NSURLResponse *policyResponse;
-    WKNSURLConnectionDelegateProxyPtr proxy;
+    NSURLResponse *_response;
+    id proxy;
     NSURLRequest *_initialRequest;
 }
 
index 2116b80b19d5a20f07fad0b4e079f255c510c5d4..e9edadd53d2e4a4f4ff29782ef9ae35e9a743333 100644 (file)
@@ -34,6 +34,7 @@
 #import <Foundation/NSURLResponse.h>
 #import <JavaScriptCore/Assertions.h>
 
+#import <WebCore/WebCoreSystemInterface.h>
 #import <WebKit/WebDataProtocol.h>
 #import <WebKit/WebNSURLExtras.h>
 #import <WebKit/WebFrameLoader.h>
@@ -48,7 +49,7 @@
     
     if (self) {
         [self setFrameLoader:fl];
-        proxy = WKCreateNSURLConnectionDelegateProxy();
+        proxy = wkCreateNSURLConnectionDelegateProxy();
         [proxy setDelegate:self];
     }
 
@@ -59,6 +60,7 @@
 {
     [_initialRequest release];
 
+    [_response release];
     [proxy setDelegate:nil];
     [proxy release];
     
     [self release];
 }
 
-- (void)cancelContentPolicy
-{
-    [listener _invalidate];
-    [listener release];
-    listener = nil;
-    [policyResponse release];
-    policyResponse = nil;
-}
-
 -(void)cancelWithError:(NSError *)error
 {
     // Calling _receivedMainResourceError will likely result in a call to release, so we must retain.
     [self retain];
 
-    [self cancelContentPolicy];
+    [frameLoader cancelContentPolicy];
     [frameLoader retain];
     [frameLoader _receivedMainResourceError:error complete:YES];
     [frameLoader release];
     [self release];
 }
 
--(void)continueAfterNavigationPolicy:(NSURLRequest *)_request formState:(WebFormState *)state
+-(void)continueAfterNavigationPolicy:(NSURLRequest *)_request formState:(id)state
 {
-    if (!_request) {
+    if (!_request)
         [self stopLoadingForPolicyChange];
-    }
 }
 
 - (BOOL)_isPostOrRedirectAfterPost:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
     // when the main load was started.
     [frameLoader _setRequest:newRequest];
     
-    [[frameLoader webFrame] _checkNavigationPolicyForRequest:newRequest
-                                                  dataSource:[frameLoader activeDataSource]
-                                                   formState:nil
-                                                     andCall:self
-                                                withSelector:@selector(continueAfterNavigationPolicy:formState:)];
+    [frameLoader _checkNavigationPolicyForRequest:newRequest andCall:self withSelector:@selector(continueAfterNavigationPolicy:formState:)];
 
     [self release];
     return newRequest;
@@ -312,29 +300,18 @@ static BOOL shouldLoadAsEmptyDocument(NSURL *url)
 
 -(void)continueAfterContentPolicy:(WebPolicyAction)policy
 {
-    NSURLResponse *r = [policyResponse retain];
     BOOL isStopping = [frameLoader _isStopping];
 
-    [self cancelContentPolicy];
+    [frameLoader cancelContentPolicy];
     if (!isStopping)
-        [self continueAfterContentPolicy:policy response:r];
-
-    [r release];
+        [self continueAfterContentPolicy:policy response:_response];
 }
 
--(void)checkContentPolicyForResponse:(NSURLResponse *)r
+-(void)checkContentPolicy
 {
-    WebPolicyDecisionListener *l = [[WebPolicyDecisionListener alloc]
-                                       _initWithTarget:self action:@selector(continueAfterContentPolicy:)];
-    listener = l;
-    policyResponse = [r retain];
-
-    [l retain];
-    [frameLoader _decidePolicyForMIMEType:[r MIMEType] decisionListener:listener];
-    [l release];
+    [frameLoader _checkContentPolicyForMIMEType:[_response MIMEType] andCall:self withSelector:@selector(continueAfterContentPolicy:)];
 }
 
-
 - (void)didReceiveResponse:(NSURLResponse *)r
 {
     ASSERT(shouldLoadAsEmptyDocument([r URL]) || ![self defersCallbacks]);
@@ -354,7 +331,8 @@ static BOOL shouldLoadAsEmptyDocument(NSURL *url)
     [frameLoader _setResponse:r];
     _contentLength = [r expectedContentLength];
 
-    [self checkContentPolicyForResponse:r];
+    _response = [r retain];
+    [self checkContentPolicy];
     [self release];
 }
 
index 377e1e261b72e6032c92e0f230ee11772d1f5a6e..09a5fa1a5b89c36f3c3ef3959f0bf37f16fc9a81 100644 (file)
@@ -41,6 +41,7 @@
 #import <WebKit/WebPolicyDelegatePrivate.h>
 #import <WebKit/WebView.h>
 #import <WebKit/WebViewInternal.h>
+#import <WebKit/WebFrameLoader.h>
 #import <objc/objc-runtime.h>
 
 @implementation WebPluginContainerCheck
index 19e6ba63fec9e2f690c19f398db1c8b0ebfc40be..f73629de99b9771bc46449637ee6b5ef011df92b 100644 (file)
@@ -70,6 +70,8 @@ void InitWebCoreSystemInterface(void)
     INIT(SignalCFReadStreamHasBytes);
     INIT(SignalCFReadStreamError);
     INIT(CreateCustomCFReadStream);
-
+    INIT(SetNSURLConnectionDefersCallbacks);
+    INIT(CreateNSURLConnectionDelegateProxy);
+    
     didInit = true;
 }
index 9afdb40e6a82e5071b0aaf1ceea532867532b443..191ddd83a6d5ab3c111694e1e77ddea35e4d431b 100644 (file)
     _private->resourceData = data;
 }
 
-- (void)_updateIconDatabaseWithURL:(NSURL *)iconURL
-{
-    // MOVABLE
-    ASSERT([[WebIconDatabase sharedIconDatabase] _isEnabled]);
-    
-    WebIconDatabase *iconDB = [WebIconDatabase sharedIconDatabase];
-    
-    // Bind the URL of the original request and the final URL to the icon URL.
-    [iconDB _setIconURL:[iconURL _web_originalDataAsString] forURL:[[self _URL] _web_originalDataAsString]];
-    [iconDB _setIconURL:[iconURL _web_originalDataAsString] forURL:[[[self _originalRequest] URL] _web_originalDataAsString]];    
-}
-
-- (void)_notifyIconChanged:(NSURL *)iconURL
-{
-    ASSERT([[WebIconDatabase sharedIconDatabase] _isEnabled]);
-    
-    if ([self webFrame] == [[self _webView] mainFrame])
-        [[self _webView] _willChangeValueForKey:_WebMainFrameIconKey];
-    
-    NSImage *icon = [[WebIconDatabase sharedIconDatabase] iconForURL:[[self _URL] _web_originalDataAsString] withSize:WebIconSmallSize];
-    
-    [[[self _webView] _frameLoadDelegateForwarder] webView:[self _webView]
-                                            didReceiveIcon:icon
-                                                  forFrame:[self webFrame]];
-    
-    if ([self webFrame] == [[self _webView] mainFrame])
-        [[self _webView] _didChangeValueForKey:_WebMainFrameIconKey];
-}
-
 - (void)_loadIcon
 {
     // Don't load an icon if 1) this is not the main frame 2) we ended in error
         // If so, kick off a reload of the icon
         // If we don't have the icon already, kick off the initial load
         if ([[WebIconDatabase sharedIconDatabase] _hasEntryForIconURL:[_private->iconURL _web_originalDataAsString]]) {
-            [self _updateIconDatabaseWithURL:_private->iconURL];
+            [[_private->webFrame _frameLoader] _updateIconDatabaseWithURL:_private->iconURL];
             if ([[self webFrame] _loadType] == WebFrameLoadTypeReload || [[WebIconDatabase sharedIconDatabase] isIconExpiredForIconURL:[_private->iconURL _web_originalDataAsString]])
                 [[WebIconDatabase sharedIconDatabase] loadIconFromURL:[_private->iconURL _web_originalDataAsString]];
             else
-                [self _notifyIconChanged:_private->iconURL];
+                [[_private->webFrame _frameLoader] _notifyIconChanged:_private->iconURL];
         } else {
             NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:_private->iconURL];
             [[self webFrame] _addExtraFieldsToRequest:request mainResource:YES alwaysFromRequest:NO];
 
 - (NSError *)_cancelledError
 {
-    // MOVABLE
     return [NSError _webKitErrorWithDomain:NSURLErrorDomain
                                       code:NSURLErrorCancelled
                                        URL:[self _URL]];
@@ -668,7 +638,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
 
 + (NSMutableDictionary *)_repTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission
 {
-    // MOVABLE
     static NSMutableDictionary *repTypes = nil;
     static BOOL addedImageTypes = NO;
     
@@ -692,7 +661,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
 
 + (Class)_representationClassForMIMEType:(NSString *)MIMEType
 {
-    // MOVABLE
     Class repClass;
     return [WebView _viewClass:nil andRepresentationClass:&repClass forMIMEType:MIMEType] ? repClass : nil;
 }
@@ -727,7 +695,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
 
 - (void)_commitLoadWithData:(NSData *)data
 {
-    // MOVABLE
     // Both unloading the old page and parsing the new page may execute JavaScript which destroys the datasource
     // by starting a new load, so retain temporarily.
     [self retain];
@@ -784,13 +751,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     [self _mainReceivedError:error complete:isComplete];
 }
 
-- (void)_iconLoaderReceivedPageIcon:(WebIconLoader *)iconLoader
-{
-    // MOVABLE
-    [self _updateIconDatabaseWithURL:_private->iconURL];
-    [self _notifyIconChanged:_private->iconURL];
-}
-
 - (void)_setIconURL:(NSURL *)URL
 {
     // Lower priority than typed icon, so ignore this if we already have an iconURL.
@@ -1011,7 +971,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
 
 - (BOOL)_isDocumentHTML
 {
-    // MOVABLE
     NSString *MIMEType = [[self response] MIMEType];
     return [WebView canShowMIMETypeAsHTML:MIMEType];
 }
index fce77c4fdaed80ecf4347686b733d6181d0d1de0..7c0a06b67bd000146d850f0e5c157ac7eda1e22c 100644 (file)
@@ -41,7 +41,6 @@
 @class WebLoader;
 @class WebFrameBridge;
 @class WebHistoryItem;
-@class WebIconLoader;
 @class WebMainResourceLoader;
 @class WebPolicyDecisionListener;
 @class WebResource;
index b501dc417847fe8a5491a77d8876bfa0f784091c..1d7db8467a23cda1a4062f991051c3d5ae538dc9 100644 (file)
 @class WebScriptDebugger;
 @class WebView;
 
-typedef enum {
-    WebFrameStateProvisional,
-    
-    // This state indicates we are ready to commit to a page,
-    // which means the view will transition to use the new data source.
-    WebFrameStateCommittedPage,
-
-    WebFrameStateComplete
-} WebFrameState;
-
 typedef enum {
     WebFrameLoadTypeStandard,
     WebFrameLoadTypeBack,
index 5328acceeff7beeabe1b65f1f37047391ed8c1a7..a1f91e9f14b334c7a2bc574b3ce6c48b42fa7a01 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #import "WebPolicyDelegatePrivate.h"
+#import "WebFrameLoader.h"
 
 #import <objc/objc-runtime.h>
 
index 22496ebbbf30564a8660af6aa12e15c70874f0dc..9204201897920bb1e60a25bbe8130686cb615e45 100644 (file)
@@ -35,12 +35,6 @@ typedef enum {
     WebNavigationTypePlugInRequest =  WebNavigationTypeOther + 1
 } WebExtraNavigationType;
 
-typedef enum {
-    WebPolicyUse,
-    WebPolicyDownload,
-    WebPolicyIgnore,
-} WebPolicyAction;
-
 @class WebPolicyDecisionListenerPrivate;
 
 @interface WebPolicyDecisionListener : NSObject <WebPolicyDecisionListener, WebFormSubmissionListener>