[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:00:48 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 6a96e2b005f4273e9c154a53864c402c029d2daa
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 15 04:23:21 2002 +0000

    WebKit:
    
    	Change things so the public interface to loading is loadRequest:
    	and everything else is private.
    
            * Plugins.subproj/WebBaseNetscapePluginView.m:
            (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
            * Plugins.subproj/WebPluginController.m:
            (-[WebPluginController showURL:inFrame:]):
            * WebView.subproj/WebController.h:
            * WebView.subproj/WebController.m:
            (-[WebController init]):
            * WebView.subproj/WebControllerPrivate.m:
            (-[WebController _createFrameNamed:inParent:allowsScrolling:]):
            (-[WebController _downloadURL:toPath:]):
            * WebView.subproj/WebFrame.h:
            * WebView.subproj/WebFrame.m:
            (-[WebFrame init]):
            (-[WebFrame initWithName:webView:controller:]):
            (-[WebFrame loadRequest:]):
            (-[WebFrame reload]):
            * WebView.subproj/WebFramePrivate.h:
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _timedLayout:]):
            (-[WebFrame _clearProvisionalDataSource]):
            (-[WebFrame _loadItem:fromItem:withLoadType:]):
            (-[WebFrame _loadRequest:triggeringAction:]):
            (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]):
            (-[WebFrame _itemForRestoringDocState]):
            (-[WebFrame _setProvisionalDataSource:]):
            (-[WebFrame _startLoading]):
            (-[WebFrame _downloadRequest:toPath:]):
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient handle:willSendRequest:]):
            (-[WebMainResourceClient stopLoadingAfterContentPolicy]):
            (-[WebMainResourceClient handle:didReceiveResponse:]):
            * WebView.subproj/WebView.m:
            (-[WebView concludeDragOperation:]):
    
    WebBrowser:
    
    	Change things so the public interface to loading is loadRequest:
    	and everything else is private.
    
            * BrowserDocument.m:
            (-[BrowserDocument goToRequest:]):
            * BrowserWebController.m:
            (-[BrowserWebController initWithBrowserDocument:]):
            * Debug/SnippetController.h:
            * Debug/SnippetController.m:
            (-[SnippetController dealloc]):
            (-[SnippetController windowWillClose:]):
            (-[SnippetController load]):
            (-[SnippetController loadComplete]):
            (-[SnippetController mainDataSource]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2683 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 34a8a95..aa53ef1 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,42 @@
+2002-11-14  Maciej Stachowiak  <mjs at apple.com>
+
+	Change things so the public interface to loading is loadRequest:
+	and everything else is private.
+	
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
+        * Plugins.subproj/WebPluginController.m:
+        (-[WebPluginController showURL:inFrame:]):
+        * WebView.subproj/WebController.h:
+        * WebView.subproj/WebController.m:
+        (-[WebController init]):
+        * WebView.subproj/WebControllerPrivate.m:
+        (-[WebController _createFrameNamed:inParent:allowsScrolling:]):
+        (-[WebController _downloadURL:toPath:]):
+        * WebView.subproj/WebFrame.h:
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame init]):
+        (-[WebFrame initWithName:webView:controller:]):
+        (-[WebFrame loadRequest:]):
+        (-[WebFrame reload]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _timedLayout:]):
+        (-[WebFrame _clearProvisionalDataSource]):
+        (-[WebFrame _loadItem:fromItem:withLoadType:]):
+        (-[WebFrame _loadRequest:triggeringAction:]):
+        (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]):
+        (-[WebFrame _itemForRestoringDocState]):
+        (-[WebFrame _setProvisionalDataSource:]):
+        (-[WebFrame _startLoading]):
+        (-[WebFrame _downloadRequest:toPath:]):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient handle:willSendRequest:]):
+        (-[WebMainResourceClient stopLoadingAfterContentPolicy]):
+        (-[WebMainResourceClient handle:didReceiveResponse:]):
+        * WebView.subproj/WebView.m:
+        (-[WebView concludeDragOperation:]):
+
 2002-11-14  David Hyatt  <hyatt at apple.com>
 
 	Move text measurement and layout beyond onload.  This
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 34a8a95..aa53ef1 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,42 @@
+2002-11-14  Maciej Stachowiak  <mjs at apple.com>
+
+	Change things so the public interface to loading is loadRequest:
+	and everything else is private.
+	
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
+        * Plugins.subproj/WebPluginController.m:
+        (-[WebPluginController showURL:inFrame:]):
+        * WebView.subproj/WebController.h:
+        * WebView.subproj/WebController.m:
+        (-[WebController init]):
+        * WebView.subproj/WebControllerPrivate.m:
+        (-[WebController _createFrameNamed:inParent:allowsScrolling:]):
+        (-[WebController _downloadURL:toPath:]):
+        * WebView.subproj/WebFrame.h:
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame init]):
+        (-[WebFrame initWithName:webView:controller:]):
+        (-[WebFrame loadRequest:]):
+        (-[WebFrame reload]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _timedLayout:]):
+        (-[WebFrame _clearProvisionalDataSource]):
+        (-[WebFrame _loadItem:fromItem:withLoadType:]):
+        (-[WebFrame _loadRequest:triggeringAction:]):
+        (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]):
+        (-[WebFrame _itemForRestoringDocState]):
+        (-[WebFrame _setProvisionalDataSource:]):
+        (-[WebFrame _startLoading]):
+        (-[WebFrame _downloadRequest:toPath:]):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient handle:willSendRequest:]):
+        (-[WebMainResourceClient stopLoadingAfterContentPolicy]):
+        (-[WebMainResourceClient handle:didReceiveResponse:]):
+        * WebView.subproj/WebView.m:
+        (-[WebView concludeDragOperation:]):
+
 2002-11-14  David Hyatt  <hyatt at apple.com>
 
 	Move text measurement and layout beyond onload.  This
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index 9e0adba..ec4d19d 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -774,41 +774,34 @@
 {
     NSURL *URL = [request URL];
 
-    if(!URL){
+    if (!URL) {
         return NPERR_INVALID_URL;
     }
     
-    if(!target){
+    if (!target) {
         WebNetscapePluginStream *stream = [[WebNetscapePluginStream alloc] initWithRequest:request
                                                                              pluginPointer:instance
                                                                                 notifyData:notifyData];
-        if(stream){
+        if (stream) {
             [streams addObject:stream];
             [stream start];
             [stream release];
-        }else{
+        } else {
             return NPERR_INVALID_URL;
         }
-    }else{
-        WebDataSource *dataSource = [[WebDataSource alloc] initWithRequest:request];
-
-        if(dataSource){
-            WebFrame *frame = [[self webFrame] findOrCreateFramedNamed:target];
-            if ([frame setProvisionalDataSource:dataSource]) {
-                if(notifyData){
-                    if(![target isEqualToString:@"_self"] && ![target isEqualToString:@"_current"] &&
-                       ![target isEqualToString:@"_parent"] && ![target isEqualToString:@"_top"]){
-
-                        [streamNotifications setObject:[NSValue valueWithPointer:notifyData] forKey:URL];
-                        [[NSNotificationCenter defaultCenter] addObserver:self
-                            selector:@selector(frameStateChanged:) name:WebFrameStateChangedNotification object:frame];
-                    }
-                }
-                
-                [frame startLoading];
-            }
-            [dataSource release];
-        }
+    } else {
+	WebFrame *frame = [[self webFrame] findOrCreateFramedNamed:target];
+	[frame loadRequest:request];
+
+	if (notifyData) {
+	    if (![target isEqualToString:@"_self"] && ![target isEqualToString:@"_current"] &&
+		![target isEqualToString:@"_parent"] && ![target isEqualToString:@"_top"]) {
+		
+		[streamNotifications setObject:[NSValue valueWithPointer:notifyData] forKey:URL];
+		[[NSNotificationCenter defaultCenter] addObserver:self
+		selector:@selector(frameStateChanged:) name:WebFrameStateChangedNotification object:frame];
+	    }
+	}
     }
     
     return NPERR_NO_ERROR;
diff --git a/WebKit/Plugins.subproj/WebPluginController.m b/WebKit/Plugins.subproj/WebPluginController.m
index e16f954..2ab0e39 100644
--- a/WebKit/Plugins.subproj/WebPluginController.m
+++ b/WebKit/Plugins.subproj/WebPluginController.m
@@ -98,16 +98,9 @@
         return;
     }
 
-    WebDataSource *dataSource = [[WebDataSource alloc] initWithRequest:[WebResourceRequest requestWithURL:URL]];
-    if(!dataSource){
-        return;
-    }
-
     WebFrame *otherFrame = [frame findOrCreateFramedNamed:target];
 
-    if([otherFrame setProvisionalDataSource:dataSource]){
-        [otherFrame startLoading];
-    }
+    [otherFrame loadRequest:[WebResourceRequest requestWithURL:URL]];
 }
 
 - (void)showStatus:(NSString *)message
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index a8c09d3..8735950 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -50,12 +50,8 @@ extern NSString *WebElementFrameKey;
     WebFrame *mainFrame;
     
     webController  = [[WebController alloc] initWithView: webView provisionalDataSource: nil];
-    dataSource = [[[WebDataSource alloc] initWithURL:url] autorelease];
     mainFrame = [webController mainFrame];
-    
-    if([mainFrame setProvisionalDataSource: dataSource]){
-        [mainFrame startLoading];
-    }
+    [mainFrame loadRequest:request];
     </pre>
     
     WebControllers have the following delegates:  WebWindowOperationsDelegate,
@@ -101,7 +97,7 @@ extern NSString *WebElementFrameKey;
 + (BOOL)canShowFile:(NSString *)path;
 
 /*!
-    @method initWithView:provisionalDataSource:controllerSetName:
+    @method initWithView:controllerSetName:
     @abstract The designated initializer for WebController.
     @discussion Initialize a WebController with the supplied parameters.  This method
     will create a main WebFrame with the view and datasource.  The frame will be
@@ -111,7 +107,7 @@ extern NSString *WebElementFrameKey;
     @param name The name of the controller set to which this controller will be added.  May be nil.
     @result Returns an initialized WebController.
 */
-- initWithView: (WebView *)view provisionalDataSource: (WebDataSource *)dataSource controllerSetName: (NSString *)name;
+- initWithView: (WebView *)view controllerSetName: (NSString *)name;
 
 /*!
     @method setWindowOperationsDelegate:
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index cd00395..25d3de1 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -42,15 +42,15 @@ NSString *WebElementFrameKey = @"WebElementFrame";
 
 - init
 {
-    return [self initWithView: nil provisionalDataSource: nil controllerSetName: nil];
+    return [self initWithView: nil  controllerSetName: nil];
 }
 
-- initWithView: (WebView *)view provisionalDataSource: (WebDataSource *)dataSource controllerSetName: (NSString *)name;
+- initWithView: (WebView *)view controllerSetName: (NSString *)name;
 {
     [super init];
     
     _private = [[WebControllerPrivate alloc] init];
-    _private->mainFrame = [[WebFrame alloc] initWithName: @"_top" webView: view provisionalDataSource: dataSource controller: self];
+    _private->mainFrame = [[WebFrame alloc] initWithName: @"_top" webView: view  controller: self];
     _private->controllerSetName = [name retain];
     if (_private->controllerSetName != nil) {
 	[WebControllerSets addController:self toSetNamed:_private->controllerSetName];
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index 10fa3c6..4f1b2d5 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -85,7 +85,7 @@
     [childView _setController:self];
     [childView setAllowsScrolling:allowsScrolling];
     
-    WebFrame *newFrame = [[WebFrame alloc] initWithName:fname webView:childView provisionalDataSource:nil controller:self];
+    WebFrame *newFrame = [[WebFrame alloc] initWithName:fname webView:childView controller:self];
 
     [childView release];
 
@@ -192,15 +192,11 @@
 
 - (void)_downloadURL:(NSURL *)URL toPath:(NSString *)path
 {
-    WebDataSource *dataSource = [[WebDataSource alloc] initWithURL:URL];
+    WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
     WebFrame *webFrame = [self mainFrame];
-        
-    [dataSource _setIsDownloading:YES];
-    [dataSource _setDownloadPath:path];
-    if([webFrame setProvisionalDataSource:dataSource]){
-        [webFrame startLoading];
-    }
-    [dataSource release];
+
+    [webFrame _downloadRequest:request toPath:path];
+    [request release];
 }
 
 - (BOOL)_defersCallbacks
diff --git a/WebKit/WebView.subproj/WebFrame.h b/WebKit/WebView.subproj/WebFrame.h
index 2755227..45d99fa 100644
--- a/WebKit/WebView.subproj/WebFrame.h
+++ b/WebKit/WebView.subproj/WebFrame.h
@@ -13,6 +13,7 @@
 @class WebError;
 @class WebFramePrivate;
 @class WebView;
+ at class WebResourceRequest;
 
 /*!
     @class WebFrame
@@ -26,15 +27,14 @@
 }
 
 /*!
-    @method initWithName:webView:provisionalDataSource:controller:
+    @method initWithName:webView:controller:
     @abstract The designated initializer of WebFrame.
     @param name The name of the frame.
     @param view The view for the frame.
-    @param dataSource The dataSource for the frame.
     @param controller The controller that manages the frame.
     @result Returns an initialized WebFrame.
 */
-- initWithName: (NSString *)name webView: (WebView *)view provisionalDataSource: (WebDataSource *)dataSource controller: (WebController *)controller;
+- initWithName: (NSString *)name webView: (WebView *)view controller: (WebController *)controller;
 
 /*!
     @method name
@@ -67,16 +67,9 @@
 - (WebView *)webView;
 
 /*!
-    @method setProvisionalDataSource:
-    @discussion Sets the frame's data source.  Note that the data source will be
-    considered 'provisional' until it has been loaded, and at least
-    ~some~ data has been received.
-    
-    @param dataSource
-    @result Returns NO and will not set the provisional data source if the controller
-    disallows by returning a WebURLPolicyIgnore.
+    @method loadRequest:
 */
-- (BOOL)setProvisionalDataSource: (WebDataSource *)dataSource;
+-(void)loadRequest:(WebResourceRequest *)request;
 
 /*!
     @method dataSource
@@ -96,23 +89,12 @@
 - (WebDataSource *)provisionalDataSource;
 
 /*!
-    @method startLoading
-    @discussion If a frame has a provisional data source this method will begin
-    loading data for that provisional data source.  If the frame
-    has no provisional data source this method will do nothing.
-
-    To reload an existing data source call reload.
-*/
-- (void)startLoading;
-
-/*!
     @method stopLoading
     @discussion Stop any pending loads on the frame's data source,
     and its children.
 */
 - (void)stopLoading;
 
-
 /*!
     @method reload
 */
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 07bbe3b..2f72546 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -28,10 +28,10 @@
 
 - init
 {
-    return [self initWithName: nil webView: nil provisionalDataSource: nil controller: nil];
+    return [self initWithName: nil webView: nil controller: nil];
 }
 
-- initWithName: (NSString *)n webView: (WebView *)v provisionalDataSource: (WebDataSource *)d controller: (WebController *)c
+- initWithName: (NSString *)n webView: (WebView *)v controller: (WebController *)c
 {
     [super init];
 
@@ -45,11 +45,6 @@
 
     [_private setName:n];
     
-    if (d && ![self setProvisionalDataSource:d]) {
-        [self release];
-        return nil;
-    }
-    
     if (v)
         [self setWebView:v];
     
@@ -108,58 +103,15 @@
     return [_private dataSource];
 }
 
-
-//    Will return NO and not set the provisional data source if the controller
-//    disallows by returning a WebURLPolicyIgnore.
-- (BOOL)setProvisionalDataSource: (WebDataSource *)newDataSource
+- (void)loadRequest:(WebResourceRequest *)request
 {
-    ASSERT([self controller] != nil);
-
-    // Unfortunately the view must be non-nil, this is ultimately due
-    // to KDE parser requiring a KHTMLView.  Once we settle on a final
-    // KDE drop we should fix this dependency.
-    ASSERT([self webView] != nil);
-
-    if ([self _state] != WebFrameStateComplete) {
-        [self stopLoading];
-    }
-
-    [self _setLoadType: WebFrameLoadTypeStandard];
-
-    // _continueAfterNavigationPolicyForRequest:dataSource: asks the
-    // client for the URL policies and reports errors if there are any
-    // returns YES if we should show the data source
-
-    if (![self _continueAfterNavigationPolicyForRequest:[newDataSource request] dataSource:newDataSource]) {
-        return NO;
-    }
-    
-    if ([self parent]) {
-        [newDataSource _setOverrideEncoding:[[[self parent] dataSource] _overrideEncoding]];
+    WebDataSource *newDataSource = [[WebDataSource alloc] initWithRequest:request];
+    if ([self _setProvisionalDataSource:newDataSource]) {
+	[self _startLoading];
     }
-    [newDataSource _setController:[self controller]];
-    [_private setProvisionalDataSource:newDataSource];
-    
-    ASSERT([newDataSource webFrame] == self);
-    
-    // We tell the documentView provisionalDataSourceChanged:
-    // once it has been created by the controller.
-    
-    [self _setState: WebFrameStateProvisional];
-    
-    return YES;
-}
-
-
-- (void)startLoading
-{
-    if (self == [[self controller] mainFrame])
-        LOG(DocumentLoad, "loading %@", [[[self provisionalDataSource] request] URL]);
-
-    [_private->provisionalDataSource startLoading];
+    [newDataSource release];
 }
 
-
 - (void)stopLoading
 {
     if (_private->state != WebFrameStateComplete) {
@@ -185,9 +137,9 @@
     
     [newDataSource _setOverrideEncoding:[dataSource _overrideEncoding]];
     
-    if ([self setProvisionalDataSource:newDataSource]) {
+    if ([self _setProvisionalDataSource:newDataSource]) {
 	[self _setLoadType:WebFrameLoadTypeReload];
-        [self startLoading];
+        [self _startLoading];
     }
     
     [newDataSource release];
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index fa13050..daf228a 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -104,7 +104,7 @@ typedef enum {
 - (void)_timedLayout: userInfo;
 - (WebBridge *)_bridge;
 - (BOOL)_shouldShowRequest:(WebResourceRequest *)request;
-- (void)_setProvisionalDataSource:(WebDataSource *)d;
+- (void)_clearProvisionalDataSource;
 - (void)_setLoadType: (WebFrameLoadType)loadType;
 - (WebFrameLoadType)_loadType;
 
@@ -139,4 +139,8 @@ typedef enum {
 - (WebHistoryItem *)_itemForRestoringDocState;
 - (void)_handleUnimplementablePolicy:(WebPolicyAction)policy errorCode:(int)code forURL:(NSURL *)URL;
 
+- (BOOL)_setProvisionalDataSource: (WebDataSource *)dataSource;
+- (void)_startLoading;
+- (void)_downloadRequest:(WebResourceRequest *)request toPath:(NSString *)path;
+
 @end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 12d412f..ac8a834 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -323,7 +323,8 @@ static const char * const stateNames[] = {
 
         if ([documentView isKindOfClass: [NSView class]]) {
             NSView *dview = (NSView *)documentView;
-            NSRect frame = [dview frame];  
+            
+            NSRect frame = [dview frame];
             
             if (frame.size.width == 0 || frame.size.height == 0){
                 // We must do the layout now, rather than depend on
@@ -735,9 +736,9 @@ static const char * const stateNames[] = {
     return [self _continueAfterNavigationPolicyForRequest:request dataSource:[self provisionalDataSource]];
 }
 
-- (void)_setProvisionalDataSource:(WebDataSource *)d
+- (void)_clearProvisionalDataSource
 {
-    [_private setProvisionalDataSource:d];
+    [_private setProvisionalDataSource:nil];
 }
 
 // helper method that determines whether the subframes described by the item's subitems
@@ -813,11 +814,11 @@ static const char * const stateNames[] = {
 
         WebDataSource *newDataSource = [[WebDataSource alloc] initWithRequest:request];
         [request release];
-        [self setProvisionalDataSource:newDataSource];
+        [self _setProvisionalDataSource:newDataSource];
         // Remember this item so we can traverse any child items as child frames load
         [_private setProvisionalItem:item];
         [self _setLoadType:type];
-        [self startLoading];
+        [self _startLoading];
         [newDataSource release];
     }
 }
@@ -893,8 +894,8 @@ static const char * const stateNames[] = {
     WebDataSource *newDataSource = [[WebDataSource alloc] initWithRequest:request];
     [newDataSource _setTriggeringAction:action];
 
-    if ([self setProvisionalDataSource:newDataSource]) {
-        [self startLoading];
+    if ([self _setProvisionalDataSource:newDataSource]) {
+        [self _startLoading];
     }
     [newDataSource release];
 }
@@ -1186,9 +1187,9 @@ static const char * const stateNames[] = {
     
     [newDataSource _setOverrideEncoding:encoding];
     
-    if ([self setProvisionalDataSource:newDataSource]) {
+    if ([self _setProvisionalDataSource:newDataSource]) {
 	[self _setLoadType:WebFrameLoadTypeReloadAllowingStaleData];
-        [self startLoading];
+        [self _startLoading];
     }
     
     [newDataSource release];
@@ -1267,4 +1268,67 @@ static const char * const stateNames[] = {
     return [_private currentItem];
 }
 
+
+//    Will return NO and not set the provisional data source if the controller
+//    disallows by returning a WebURLPolicyIgnore.
+- (BOOL)_setProvisionalDataSource: (WebDataSource *)newDataSource
+{
+    ASSERT([self controller] != nil);
+
+    // Unfortunately the view must be non-nil, this is ultimately due
+    // to KDE parser requiring a KHTMLView.  Once we settle on a final
+    // KDE drop we should fix this dependency.
+    ASSERT([self webView] != nil);
+
+    if ([self _state] != WebFrameStateComplete) {
+        [self stopLoading];
+    }
+
+    [self _setLoadType: WebFrameLoadTypeStandard];
+
+    // _continueAfterNavigationPolicyForRequest:dataSource: asks the
+    // client for the URL policies and reports errors if there are any
+    // returns YES if we should show the data source
+
+    if (![self _continueAfterNavigationPolicyForRequest:[newDataSource request] dataSource:newDataSource]) {
+        return NO;
+    }
+    
+    if ([self parent]) {
+        [newDataSource _setOverrideEncoding:[[[self parent] dataSource] _overrideEncoding]];
+    }
+    [newDataSource _setController:[self controller]];
+    [_private setProvisionalDataSource:newDataSource];
+    
+    ASSERT([newDataSource webFrame] == self);
+    
+    // We tell the documentView provisionalDataSourceChanged:
+    // once it has been created by the controller.
+    
+    [self _setState: WebFrameStateProvisional];
+    
+    return YES;
+}
+
+
+- (void)_startLoading
+{
+    if (self == [[self controller] mainFrame])
+        LOG(DocumentLoad, "loading %@", [[[self provisionalDataSource] request] URL]);
+
+    [_private->provisionalDataSource startLoading];
+}
+
+- (void)_downloadRequest:(WebResourceRequest *)request toPath:(NSString *)path
+{
+    WebDataSource *dataSource = [[WebDataSource alloc] initWithRequest:request];
+
+    [dataSource _setIsDownloading:YES];
+    [dataSource _setDownloadPath:path];
+    if([self _setProvisionalDataSource:dataSource]){
+        [self _startLoading];
+    }
+    [dataSource release];
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index e3dd735..639c0db 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -29,6 +29,7 @@
 #import <WebFoundation/WebLocalizableStrings.h>
 #import <WebFoundation/WebNSDictionaryExtras.h>
 #import <WebFoundation/WebNSURLExtras.h>
+#import <WebFoundation/WebResourceRequest.h>
 
 enum {
     SpaceKey = 0x0020
@@ -166,13 +167,10 @@ NSString *WebErrorDomainWebKit = @"WebErrorDomainWebKit";
 {
     NSURL *URL = [[sender draggingPasteboard] _web_bestURL];
 
-    if(URL){
-        WebDataSource *dataSource = [[WebDataSource alloc] initWithURL:URL];
-        WebFrame *frame = [[self controller] mainFrame];
-        if ([frame setProvisionalDataSource:dataSource]){
-            [frame startLoading];
-        }
-        [dataSource release];
+    if (URL) {
+	WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
+	[[[self controller] mainFrame] loadRequest:request];
+	[request release];
     }
 }
 
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 1078484..741762b 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -102,7 +102,7 @@
     if (![[dataSource webFrame] _shouldShowRequest:newRequest]) {
         [self cancelQuietly];
 
-        [[dataSource webFrame] _setProvisionalDataSource:nil];
+        [[dataSource webFrame] _clearProvisionalDataSource];
 	[[[dataSource controller] locationChangeDelegate] locationChangeDone:
             [WebError errorWithCode:WebErrorLocationChangeInterruptedByPolicyChange inDomain:WebErrorDomainWebKit failingURL:nil]
             forDataSource:dataSource];
@@ -136,7 +136,7 @@
 
 -(void)stopLoadingAfterContentPolicy
 {
-    [[dataSource webFrame] _setProvisionalDataSource:nil];
+    [[dataSource webFrame] _clearProvisionalDataSource];
     [self notifyDelegatesOfInterruptionByPolicyChange];
     [self cancelQuietly];
 }
@@ -178,8 +178,7 @@
 	    [dataSource _setDownloadPath:saveFilename];
 	}
 	
-	[[dataSource webFrame] _setProvisionalDataSource:nil];
-	
+	[[dataSource webFrame] _clearProvisionalDataSource];
 	[self notifyDelegatesOfInterruptionByPolicyChange];
 	
 	// Hand off the dataSource to the download handler.  This will cause the remaining
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 1078484..741762b 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -102,7 +102,7 @@
     if (![[dataSource webFrame] _shouldShowRequest:newRequest]) {
         [self cancelQuietly];
 
-        [[dataSource webFrame] _setProvisionalDataSource:nil];
+        [[dataSource webFrame] _clearProvisionalDataSource];
 	[[[dataSource controller] locationChangeDelegate] locationChangeDone:
             [WebError errorWithCode:WebErrorLocationChangeInterruptedByPolicyChange inDomain:WebErrorDomainWebKit failingURL:nil]
             forDataSource:dataSource];
@@ -136,7 +136,7 @@
 
 -(void)stopLoadingAfterContentPolicy
 {
-    [[dataSource webFrame] _setProvisionalDataSource:nil];
+    [[dataSource webFrame] _clearProvisionalDataSource];
     [self notifyDelegatesOfInterruptionByPolicyChange];
     [self cancelQuietly];
 }
@@ -178,8 +178,7 @@
 	    [dataSource _setDownloadPath:saveFilename];
 	}
 	
-	[[dataSource webFrame] _setProvisionalDataSource:nil];
-	
+	[[dataSource webFrame] _clearProvisionalDataSource];
 	[self notifyDelegatesOfInterruptionByPolicyChange];
 	
 	// Hand off the dataSource to the download handler.  This will cause the remaining
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index a8c09d3..8735950 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -50,12 +50,8 @@ extern NSString *WebElementFrameKey;
     WebFrame *mainFrame;
     
     webController  = [[WebController alloc] initWithView: webView provisionalDataSource: nil];
-    dataSource = [[[WebDataSource alloc] initWithURL:url] autorelease];
     mainFrame = [webController mainFrame];
-    
-    if([mainFrame setProvisionalDataSource: dataSource]){
-        [mainFrame startLoading];
-    }
+    [mainFrame loadRequest:request];
     </pre>
     
     WebControllers have the following delegates:  WebWindowOperationsDelegate,
@@ -101,7 +97,7 @@ extern NSString *WebElementFrameKey;
 + (BOOL)canShowFile:(NSString *)path;
 
 /*!
-    @method initWithView:provisionalDataSource:controllerSetName:
+    @method initWithView:controllerSetName:
     @abstract The designated initializer for WebController.
     @discussion Initialize a WebController with the supplied parameters.  This method
     will create a main WebFrame with the view and datasource.  The frame will be
@@ -111,7 +107,7 @@ extern NSString *WebElementFrameKey;
     @param name The name of the controller set to which this controller will be added.  May be nil.
     @result Returns an initialized WebController.
 */
-- initWithView: (WebView *)view provisionalDataSource: (WebDataSource *)dataSource controllerSetName: (NSString *)name;
+- initWithView: (WebView *)view controllerSetName: (NSString *)name;
 
 /*!
     @method setWindowOperationsDelegate:
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index cd00395..25d3de1 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -42,15 +42,15 @@ NSString *WebElementFrameKey = @"WebElementFrame";
 
 - init
 {
-    return [self initWithView: nil provisionalDataSource: nil controllerSetName: nil];
+    return [self initWithView: nil  controllerSetName: nil];
 }
 
-- initWithView: (WebView *)view provisionalDataSource: (WebDataSource *)dataSource controllerSetName: (NSString *)name;
+- initWithView: (WebView *)view controllerSetName: (NSString *)name;
 {
     [super init];
     
     _private = [[WebControllerPrivate alloc] init];
-    _private->mainFrame = [[WebFrame alloc] initWithName: @"_top" webView: view provisionalDataSource: dataSource controller: self];
+    _private->mainFrame = [[WebFrame alloc] initWithName: @"_top" webView: view  controller: self];
     _private->controllerSetName = [name retain];
     if (_private->controllerSetName != nil) {
 	[WebControllerSets addController:self toSetNamed:_private->controllerSetName];
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 10fa3c6..4f1b2d5 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -85,7 +85,7 @@
     [childView _setController:self];
     [childView setAllowsScrolling:allowsScrolling];
     
-    WebFrame *newFrame = [[WebFrame alloc] initWithName:fname webView:childView provisionalDataSource:nil controller:self];
+    WebFrame *newFrame = [[WebFrame alloc] initWithName:fname webView:childView controller:self];
 
     [childView release];
 
@@ -192,15 +192,11 @@
 
 - (void)_downloadURL:(NSURL *)URL toPath:(NSString *)path
 {
-    WebDataSource *dataSource = [[WebDataSource alloc] initWithURL:URL];
+    WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
     WebFrame *webFrame = [self mainFrame];
-        
-    [dataSource _setIsDownloading:YES];
-    [dataSource _setDownloadPath:path];
-    if([webFrame setProvisionalDataSource:dataSource]){
-        [webFrame startLoading];
-    }
-    [dataSource release];
+
+    [webFrame _downloadRequest:request toPath:path];
+    [request release];
 }
 
 - (BOOL)_defersCallbacks

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list