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

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:09:49 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 8ef34f2f0fedfc3eb19b0aa883de065fa1552a75
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Apr 26 00:30:56 2002 +0000

            * MIME.subproj/IFDownloadHandler.h:
            * MIME.subproj/IFDownloadHandler.mm:
            (+[IFDownloadHandler launchURL:]):
    
            Added the above method as a way to universally launch an URL
            within WebKit
    
            * WebView.subproj/IFBaseWebController.mm:
            (-[IFBaseWebController URLPolicyForURL:]):
    
            We handle http, https and file URL's
    
            * WebView.subproj/IFWebDataSource.mm:
            (-[IFWebDataSource initWithURL:]):
            (-[IFWebDataSource startLoading:]):
    
            The IFURLHandle is now lazilly allocated.
    
            * WebView.subproj/IFWebFrame.mm:
            (-[IFWebFrame setProvisionalDataSource:]):
    
            We only load a data source if the URL policy is IFURLPolicyUseContentPolicy
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1078 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4f6d569..07257ba 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,28 @@
+2002-04-25  Chris Blumenberg  <set EMAIL_ADDRESS environment variable>
+
+	* MIME.subproj/IFDownloadHandler.h:
+	* MIME.subproj/IFDownloadHandler.mm:
+	(+[IFDownloadHandler launchURL:]):
+
+	Added the above method as a way to universally launch an URL
+	within WebKit
+
+	* WebView.subproj/IFBaseWebController.mm:
+	(-[IFBaseWebController URLPolicyForURL:]):
+
+	We handle http, https and file URL's
+
+	* WebView.subproj/IFWebDataSource.mm:
+	(-[IFWebDataSource initWithURL:]):
+	(-[IFWebDataSource startLoading:]):
+
+	The IFURLHandle is now lazilly allocated.
+
+	* WebView.subproj/IFWebFrame.mm:
+	(-[IFWebFrame setProvisionalDataSource:]):
+
+	We only load a data source if the URL policy is IFURLPolicyUseContentPolicy
+
 2002-04-25  Richard Williamson  <rjw at apple.com>
 
         Fixed problem with errors potentially being reported on
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 4f6d569..07257ba 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,28 @@
+2002-04-25  Chris Blumenberg  <set EMAIL_ADDRESS environment variable>
+
+	* MIME.subproj/IFDownloadHandler.h:
+	* MIME.subproj/IFDownloadHandler.mm:
+	(+[IFDownloadHandler launchURL:]):
+
+	Added the above method as a way to universally launch an URL
+	within WebKit
+
+	* WebView.subproj/IFBaseWebController.mm:
+	(-[IFBaseWebController URLPolicyForURL:]):
+
+	We handle http, https and file URL's
+
+	* WebView.subproj/IFWebDataSource.mm:
+	(-[IFWebDataSource initWithURL:]):
+	(-[IFWebDataSource startLoading:]):
+
+	The IFURLHandle is now lazilly allocated.
+
+	* WebView.subproj/IFWebFrame.mm:
+	(-[IFWebFrame setProvisionalDataSource:]):
+
+	We only load a data source if the URL policy is IFURLPolicyUseContentPolicy
+
 2002-04-25  Richard Williamson  <rjw at apple.com>
 
         Fixed problem with errors potentially being reported on
diff --git a/WebKit/MIME.subproj/IFDownloadHandler.h b/WebKit/MIME.subproj/IFDownloadHandler.h
index a0ea013..b8fa0c1 100644
--- a/WebKit/MIME.subproj/IFDownloadHandler.h
+++ b/WebKit/MIME.subproj/IFDownloadHandler.h
@@ -15,4 +15,6 @@
 
 - initWithDataSource:(IFWebDataSource *)dSource;
 - (void)downloadCompletedWithData:(NSData *)data;
+
++ (void) launchURL:(NSURL *) url;
 @end
diff --git a/WebKit/MIME.subproj/IFDownloadHandler.mm b/WebKit/MIME.subproj/IFDownloadHandler.mm
index c079aca..dbd9bb4 100644
--- a/WebKit/MIME.subproj/IFDownloadHandler.mm
+++ b/WebKit/MIME.subproj/IFDownloadHandler.mm
@@ -28,7 +28,6 @@
 {
     NSString *path = [dataSource _downloadPath];
     NSFileManager *fileManager;
-    CFURLRef pathURL;
        
     // FIXME: Should probably not replace existing file
     // FIXME: Should report error if there is one
@@ -38,14 +37,16 @@
     
     // Send Finder notification
     WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "Notifying Finder");
-    FNNotifyByPath((UInt8 *)[[path stringByDeletingLastPathComponent] cString], kFNDirectoryModifiedMessage, kNilOptions);
+    FNNotifyByPath((UInt8 *)[[path stringByDeletingLastPathComponent] UTF8String], kFNDirectoryModifiedMessage, kNilOptions);
     
-    if([dataSource _contentPolicy] == IFContentPolicyOpenExternally){
-        pathURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)path, kCFURLPOSIXPathStyle, FALSE);
-        WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD,"Opening: %s", [path cString]);
-        LSOpenCFURLRef(pathURL, NULL);
-        CFRelease(pathURL);
+    if([dataSource contentPolicy] == IFContentPolicyOpenExternally){
+        [IFDownloadHandler launchURL:[NSURL fileURLWithPath:path]];
     }
 }
 
++ (void) launchURL:(NSURL *) url{
+    WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD,"Launching: %s", [[url absoluteString] cString]);
+    LSOpenCFURLRef((CFURLRef)url, NULL);
+}
+
 @end
diff --git a/WebKit/WebView.subproj/IFBaseWebController.mm b/WebKit/WebView.subproj/IFBaseWebController.mm
index 22a655b..a5600f8 100644
--- a/WebKit/WebView.subproj/IFBaseWebController.mm
+++ b/WebKit/WebView.subproj/IFBaseWebController.mm
@@ -246,7 +246,12 @@
 
 - (IFURLPolicy)URLPolicyForURL: (NSURL *)url
 {
-    return IFURLPolicyNone;
+    // We need a factory method or something that tells us what schemes we handle
+    if([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"] || [[url scheme] isEqualToString:@"file"]){
+        return IFURLPolicyUseContentPolicy;
+    }else{
+        return IFURLPolicyOpenExternally;
+    }
 }
 
 - (void)unableToImplementURLPolicyForURL: (NSURL *)url error: (IFError *)error
diff --git a/WebKit/WebView.subproj/IFWebDataSource.mm b/WebKit/WebView.subproj/IFWebDataSource.mm
index 464f2cc..5721f22 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.mm
+++ b/WebKit/WebView.subproj/IFWebDataSource.mm
@@ -36,10 +36,10 @@ static id IFWebDataSourceMake(void *handle)
 // Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
 - initWithURL: (NSURL *)inputURL 
 {
-    IFURLHandle *handle;
-    
-    handle = [[[IFURLHandle alloc] initWithURL: inputURL attributes: nil flags: 0] autorelease];
-    return [self initWithHandle: handle];
+    [super init];
+    [self _commonInitialization];
+    _private->inputURL = [inputURL retain];
+    return self;
 }
 
 - initWithHandle: (IFURLHandle *)handle
@@ -185,6 +185,9 @@ static id IFWebDataSourceMake(void *handle)
 // If forceRefresh is YES the document will load from the net, not the cache.
 - (void)startLoading: (BOOL)forceRefresh
 {
+    if(!_private->mainHandle){
+        _private->mainHandle = [[IFURLHandle alloc] initWithURL: _private->inputURL attributes: nil flags: 0];
+    }
     [self _startLoading: forceRefresh];
 }
 
diff --git a/WebKit/WebView.subproj/IFWebFrame.mm b/WebKit/WebView.subproj/IFWebFrame.mm
index 8087ce1..e75a8f2 100644
--- a/WebKit/WebView.subproj/IFWebFrame.mm
+++ b/WebKit/WebView.subproj/IFWebFrame.mm
@@ -12,6 +12,8 @@
 #import <WebKit/IFBaseWebControllerPrivate.h>
 #import <WebKit/IFWebController.h>
 #import <WebKit/IFLocationChangeHandler.h>
+#import <WebKit/IFDownloadHandler.h>
+#import <WebFoundation/WebFoundation.h>
 
 #import <WebKit/WebKitDebug.h>
 
@@ -102,7 +104,8 @@
 {
     IFWebDataSource *oldDataSource;
     id <IFLocationChangeHandler>locationChangeHandler;
-
+    IFURLPolicy urlPolicy;
+    
     WEBKIT_ASSERT ([self controller] != nil);
 
     // Unfortunately the view must be non-nil, this is ultimately due
@@ -110,39 +113,48 @@
     // KDE drop we should fix this dependency.
     WEBKIT_ASSERT ([self view] != nil);
 
-    if ([self _state] != IFWEBFRAMESTATE_COMPLETE){
-        [self stopLoading];
-    }
-    
-    locationChangeHandler = [[self controller] provideLocationChangeHandlerForFrame: self];
-
-    [newDataSource _setLocationChangeHandler: locationChangeHandler];
+    urlPolicy = [[self controller] URLPolicyForURL:[newDataSource inputURL]];
 
-    oldDataSource = [self dataSource];
+    if(urlPolicy == IFURLPolicyUseContentPolicy){
+            
+        if ([self _state] != IFWEBFRAMESTATE_COMPLETE){
+            [self stopLoading];
+        }
+        
+        locationChangeHandler = [[self controller] provideLocationChangeHandlerForFrame: self];
     
-    // Is this the top frame?  If so set the data source's parent to nil.
-    if (self == [[self controller] mainFrame])
-        [newDataSource _setParent: nil];
+        [newDataSource _setLocationChangeHandler: locationChangeHandler];
+    
+        oldDataSource = [self dataSource];
         
-    // Otherwise set the new data source's parent to the old data source's parent.
-    else if (oldDataSource && oldDataSource != newDataSource)
-        [newDataSource _setParent: [oldDataSource parent]];
+        // Is this the top frame?  If so set the data source's parent to nil.
+        if (self == [[self controller] mainFrame])
+            [newDataSource _setParent: nil];
             
-    [newDataSource _setController: [self controller]];
+        // Otherwise set the new data source's parent to the old data source's parent.
+        else if (oldDataSource && oldDataSource != newDataSource)
+            [newDataSource _setParent: [oldDataSource parent]];
+                
+        [newDataSource _setController: [self controller]];
+        
+        [_private setProvisionalDataSource: newDataSource];
+        
+        [[self view] provisionalDataSourceChanged: newDataSource];
     
-    [_private setProvisionalDataSource: newDataSource];
+    #ifdef OLD_WAY
+        // This introduces a nasty dependency on the view.
+        khtml::RenderPart *renderPartFrame = [self _renderFramePart];
+        id view = [self view];
+        if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")])
+            renderPartFrame->setWidget ([view _provisionalWidget]);
+    #endif
     
-    [[self view] provisionalDataSourceChanged: newDataSource];
-
-#ifdef OLD_WAY
-    // This introduces a nasty dependency on the view.
-    khtml::RenderPart *renderPartFrame = [self _renderFramePart];
-    id view = [self view];
-    if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")])
-        renderPartFrame->setWidget ([view _provisionalWidget]);
-#endif
-
-    [self _setState: IFWEBFRAMESTATE_PROVISIONAL];
+        [self _setState: IFWEBFRAMESTATE_PROVISIONAL];
+    }
+    
+    else if(urlPolicy == IFURLPolicyOpenExternally){
+        [IFDownloadHandler launchURL:[newDataSource inputURL]];
+    }
     
     return YES;
 }
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 464f2cc..5721f22 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -36,10 +36,10 @@ static id IFWebDataSourceMake(void *handle)
 // Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
 - initWithURL: (NSURL *)inputURL 
 {
-    IFURLHandle *handle;
-    
-    handle = [[[IFURLHandle alloc] initWithURL: inputURL attributes: nil flags: 0] autorelease];
-    return [self initWithHandle: handle];
+    [super init];
+    [self _commonInitialization];
+    _private->inputURL = [inputURL retain];
+    return self;
 }
 
 - initWithHandle: (IFURLHandle *)handle
@@ -185,6 +185,9 @@ static id IFWebDataSourceMake(void *handle)
 // If forceRefresh is YES the document will load from the net, not the cache.
 - (void)startLoading: (BOOL)forceRefresh
 {
+    if(!_private->mainHandle){
+        _private->mainHandle = [[IFURLHandle alloc] initWithURL: _private->inputURL attributes: nil flags: 0];
+    }
     [self _startLoading: forceRefresh];
 }
 
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 8087ce1..e75a8f2 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -12,6 +12,8 @@
 #import <WebKit/IFBaseWebControllerPrivate.h>
 #import <WebKit/IFWebController.h>
 #import <WebKit/IFLocationChangeHandler.h>
+#import <WebKit/IFDownloadHandler.h>
+#import <WebFoundation/WebFoundation.h>
 
 #import <WebKit/WebKitDebug.h>
 
@@ -102,7 +104,8 @@
 {
     IFWebDataSource *oldDataSource;
     id <IFLocationChangeHandler>locationChangeHandler;
-
+    IFURLPolicy urlPolicy;
+    
     WEBKIT_ASSERT ([self controller] != nil);
 
     // Unfortunately the view must be non-nil, this is ultimately due
@@ -110,39 +113,48 @@
     // KDE drop we should fix this dependency.
     WEBKIT_ASSERT ([self view] != nil);
 
-    if ([self _state] != IFWEBFRAMESTATE_COMPLETE){
-        [self stopLoading];
-    }
-    
-    locationChangeHandler = [[self controller] provideLocationChangeHandlerForFrame: self];
-
-    [newDataSource _setLocationChangeHandler: locationChangeHandler];
+    urlPolicy = [[self controller] URLPolicyForURL:[newDataSource inputURL]];
 
-    oldDataSource = [self dataSource];
+    if(urlPolicy == IFURLPolicyUseContentPolicy){
+            
+        if ([self _state] != IFWEBFRAMESTATE_COMPLETE){
+            [self stopLoading];
+        }
+        
+        locationChangeHandler = [[self controller] provideLocationChangeHandlerForFrame: self];
     
-    // Is this the top frame?  If so set the data source's parent to nil.
-    if (self == [[self controller] mainFrame])
-        [newDataSource _setParent: nil];
+        [newDataSource _setLocationChangeHandler: locationChangeHandler];
+    
+        oldDataSource = [self dataSource];
         
-    // Otherwise set the new data source's parent to the old data source's parent.
-    else if (oldDataSource && oldDataSource != newDataSource)
-        [newDataSource _setParent: [oldDataSource parent]];
+        // Is this the top frame?  If so set the data source's parent to nil.
+        if (self == [[self controller] mainFrame])
+            [newDataSource _setParent: nil];
             
-    [newDataSource _setController: [self controller]];
+        // Otherwise set the new data source's parent to the old data source's parent.
+        else if (oldDataSource && oldDataSource != newDataSource)
+            [newDataSource _setParent: [oldDataSource parent]];
+                
+        [newDataSource _setController: [self controller]];
+        
+        [_private setProvisionalDataSource: newDataSource];
+        
+        [[self view] provisionalDataSourceChanged: newDataSource];
     
-    [_private setProvisionalDataSource: newDataSource];
+    #ifdef OLD_WAY
+        // This introduces a nasty dependency on the view.
+        khtml::RenderPart *renderPartFrame = [self _renderFramePart];
+        id view = [self view];
+        if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")])
+            renderPartFrame->setWidget ([view _provisionalWidget]);
+    #endif
     
-    [[self view] provisionalDataSourceChanged: newDataSource];
-
-#ifdef OLD_WAY
-    // This introduces a nasty dependency on the view.
-    khtml::RenderPart *renderPartFrame = [self _renderFramePart];
-    id view = [self view];
-    if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")])
-        renderPartFrame->setWidget ([view _provisionalWidget]);
-#endif
-
-    [self _setState: IFWEBFRAMESTATE_PROVISIONAL];
+        [self _setState: IFWEBFRAMESTATE_PROVISIONAL];
+    }
+    
+    else if(urlPolicy == IFURLPolicyOpenExternally){
+        [IFDownloadHandler launchURL:[newDataSource inputURL]];
+    }
     
     return YES;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list