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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:32:15 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 762c145c0243954be5bd5ab0ba92ffa6ec7e5910
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Aug 17 03:01:47 2002 +0000

    top level:
    
            * Tests/WebFoundationC/ifurlhandlec-test.c: (run):
    	Keep this test compiling. It won't run any more, though.
    
    WebFoundation:
    
    	Step 1 in adding user agent API to WebKit and WebFoundation.
    	In this step, I change WebResourceHandle's API so that there's only
    	one client per handle, passed in at init time. I haven't changed the
    	internals of WebResourceHandle yet.
    
            * CacheLoader.subproj/IFHTTPURLHandleC.m: Remove IFHTTPURLHandleCreate.
            * CacheLoader.subproj/IFURLHandleC.m: Remove IFURLHandleCreate.
    
            * CacheLoader.subproj/WebHTTPResourceHandle.m: Remove unneeded init methods that
    	just did the same thing the superclass would have.
    
            * CacheLoader.subproj/WebResourceHandle.h: Remove addClient and removeClient methods.
    	Add client parameter to all the init methods.
            * CacheLoader.subproj/WebResourceHandle.m:
            (-[WebResourceSynchronousClient run:]): Don't addClient here. Caller is responsible for that.
            (-[WebResourceHandle loadInForeground:]): Add client to the clients list.
            (-[WebResourceHandle initWithClient:URL:]): Pass client parameter through.
            (-[WebResourceHandle initWithClient:URL:cached:]): Pass client parameter through.
            (-[WebResourceHandle initWithClient:URL:attributes:flags:]): Rearrange the function. The
    	only substantive change is that the passed-in client is added to the clients list.
    
            * WebFoundation.exp: Don't export _IFHTTPURLHandleCreate and _IFURLHandleCreate
    	any more.
    
    WebKit:
    
    	Update for change to the WebResourceHandle API where the client is
    	passed in at init time.
    
            * Misc.subproj/WebIconLoader.m:
            (-[WebIconLoader iconFromCache]): Pass self as client when creating handle for
    	foreground "only if cached" load. Also don't put the handle into the class's
    	data structure in this case.
            (-[WebIconLoader startLoading]): Pass self as client when creating handle
    	instead of making a separate addClient call. Also fix potential leak if this
    	is called when we are already loading.
            (-[WebIconLoader stopLoading]): Release the handle and nil it out right here.
            * Plugins.subproj/WebPluginStream.m:
            (-[WebPluginStream startLoad]): Pass client when creating handle rather than
    	doing an addClient afterward.
            (-[WebPluginStream stop]): Don't do a removeClient.
            * WebCoreSupport.subproj/WebSubresourceClient.m:
            (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]):
            * WebView.subproj/WebDataSource.m:
    	(-[WebDataSource initWithURL:attributes:flags:]): Pass client when creating handle.
            * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]):
    	Since client is not created in init, don't bother creating it here.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1854 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 9716193..f7265e1 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,27 @@
+2002-08-16  Darin Adler  <darin at apple.com>
+
+	Update for change to the WebResourceHandle API where the client is
+	passed in at init time.
+
+        * Misc.subproj/WebIconLoader.m:
+        (-[WebIconLoader iconFromCache]): Pass self as client when creating handle for
+	foreground "only if cached" load. Also don't put the handle into the class's
+	data structure in this case.
+        (-[WebIconLoader startLoading]): Pass self as client when creating handle
+	instead of making a separate addClient call. Also fix potential leak if this
+	is called when we are already loading.
+        (-[WebIconLoader stopLoading]): Release the handle and nil it out right here.
+        * Plugins.subproj/WebPluginStream.m:
+        (-[WebPluginStream startLoad]): Pass client when creating handle rather than
+	doing an addClient afterward.
+        (-[WebPluginStream stop]): Don't do a removeClient.
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]):
+        * WebView.subproj/WebDataSource.m:
+	(-[WebDataSource initWithURL:attributes:flags:]): Pass client when creating handle.
+        * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]):
+	Since client is not created in init, don't bother creating it here.
+
 2002-08-16  John Sullivan  <sullivan at apple.com>
 
 	Split searchability out from WebTextView so it could be used
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 9716193..f7265e1 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,27 @@
+2002-08-16  Darin Adler  <darin at apple.com>
+
+	Update for change to the WebResourceHandle API where the client is
+	passed in at init time.
+
+        * Misc.subproj/WebIconLoader.m:
+        (-[WebIconLoader iconFromCache]): Pass self as client when creating handle for
+	foreground "only if cached" load. Also don't put the handle into the class's
+	data structure in this case.
+        (-[WebIconLoader startLoading]): Pass self as client when creating handle
+	instead of making a separate addClient call. Also fix potential leak if this
+	is called when we are already loading.
+        (-[WebIconLoader stopLoading]): Release the handle and nil it out right here.
+        * Plugins.subproj/WebPluginStream.m:
+        (-[WebPluginStream startLoad]): Pass client when creating handle rather than
+	doing an addClient afterward.
+        (-[WebPluginStream stop]): Don't do a removeClient.
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]):
+        * WebView.subproj/WebDataSource.m:
+	(-[WebDataSource initWithURL:attributes:flags:]): Pass client when creating handle.
+        * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]):
+	Since client is not created in init, don't bother creating it here.
+
 2002-08-16  John Sullivan  <sullivan at apple.com>
 
 	Split searchability out from WebTextView so it could be used
diff --git a/WebKit/Misc.subproj/WebIconLoader.m b/WebKit/Misc.subproj/WebIconLoader.m
index 243daa3..bc80d87 100644
--- a/WebKit/Misc.subproj/WebIconLoader.m
+++ b/WebKit/Misc.subproj/WebIconLoader.m
@@ -15,7 +15,7 @@
 @interface WebIconLoaderPrivate : NSObject
 {
 @public
-    WebResourceHandle *resourceHandle;
+    WebResourceHandle *handle;
     id delegate;
     NSURL *URL;
 }
@@ -27,7 +27,7 @@
 - (void)dealloc
 {
     [URL release];
-    [resourceHandle release];
+    [handle release];
     [super dealloc];
 }
 
@@ -126,27 +126,26 @@
 
 - (NSImage *)iconFromCache
 {
-    NSImage *icon=nil;
-
-    icon = [[self _icons] objectForKey:_private->URL];
-
-    if(icon){
+    NSImage *icon = [[self _icons] objectForKey:_private->URL];
+    if (icon) {
         return icon;
     }
     
     NSDictionary *attributes = [NSDictionary dictionaryWithObject:@"" forKey:@"only-if-cached"];
-    _private->resourceHandle = [[WebResourceHandle alloc] initWithURL:_private->URL
-                                                           attributes:attributes
-                                                                flags:WebResourceHandleFlagNone];
-    if(_private->resourceHandle){        
-        NSData *data = [_private->resourceHandle loadInForeground];
-        if(data){
+    WebResourceHandle *handle = [[WebResourceHandle alloc] initWithClient:self
+                                                                      URL:_private->URL
+                                                               attributes:attributes
+                                                                    flags:WebResourceHandleFlagNone];
+    if (handle) {        
+        NSData *data = [handle loadInForeground];
+        if (data) {
             icon = [[[NSImage alloc] initWithData:data] autorelease];
-            if(icon){
+            if (icon) {
                 [[self class] _resizeImage:icon];
                 [[self _icons] setObject:icon forKey:_private->URL];
             }
         }
+        [handle release];
     }
     
     return icon;
@@ -154,35 +153,35 @@
 
 - (void)startLoading
 {
-    NSImage *icon=nil;
-
-    icon = [[self _icons] objectForKey:_private->URL];
-
-    if(icon){
+    if (_private->handle != nil) {
+        return;
+    }
+    
+    NSImage *icon = [[self _icons] objectForKey:_private->URL];
+    if (icon) {
         [_private->delegate iconLoader:self receivedPageIcon:icon];
         return;
     }
     
-    _private->resourceHandle = [[WebResourceHandle alloc] initWithURL:_private->URL];
-    if(_private->resourceHandle){
-        [_private->resourceHandle addClient:self];
-        [_private->resourceHandle loadInBackground];
+    _private->handle = [[WebResourceHandle alloc] initWithClient:self URL:_private->URL];
+    if (_private->handle) {
+        [_private->handle loadInBackground];
     }
 }
 
 - (void)stopLoading
 {
-    [_private->resourceHandle cancelLoadInBackground];
+    [_private->handle cancelLoadInBackground];
+    [_private->handle release];
+    _private->handle = nil;
 }
 
 - (void)WebResourceHandleDidBeginLoading:(WebResourceHandle *)sender
 {
-
 }
 
 - (void)WebResourceHandleDidCancelLoading:(WebResourceHandle *)sender
 {
-
 }
 
 - (void)WebResourceHandleDidFinishLoading:(WebResourceHandle *)sender data:(NSData *)data
diff --git a/WebKit/Plugins.subproj/WebPluginStream.h b/WebKit/Plugins.subproj/WebPluginStream.h
index ac28da8..aee28dd 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.h
+++ b/WebKit/Plugins.subproj/WebPluginStream.h
@@ -27,7 +27,6 @@
     void *notifyData;
     
     BOOL isFirstChunk;
-    BOOL stopped;
     
     WebResourceHandle *resource;
     
diff --git a/WebKit/Plugins.subproj/WebPluginStream.m b/WebKit/Plugins.subproj/WebPluginStream.m
index 92f1a2a..d310a17 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.m
+++ b/WebKit/Plugins.subproj/WebPluginStream.m
@@ -34,7 +34,6 @@
     [super init];
 
     isFirstChunk = YES;
-    stopped = YES;
     
     return self;
 }
@@ -68,7 +67,6 @@
     [self getFunctionPointersFromPluginView:view];
     
     isFirstChunk = YES;
-    stopped = YES;
     
     return self;
 }
@@ -90,26 +88,15 @@
 
 - (void)startLoad
 {
-    if(stopped){
-        stopped = NO;
-        resource = [[WebResourceHandle alloc] initWithURL:URL attributes:attributes flags:0];
-        if(resource){
-            [resource addClient:self];
-            [resource loadInBackground];
-        }
-    }
+    resource = [[WebResourceHandle alloc] initWithClient:self URL:URL attributes:attributes flags:0];
+    [resource loadInBackground];
 }
 
 - (void)stop
 {
-    if(!stopped){
-        stopped = YES;
-        if([resource statusCode] == WebResourceHandleStatusLoading){
-            [resource cancelLoadInBackground];
-        }
-        [resource removeClient:self];
-        [resource release];
-    }
+    [resource cancelLoadInBackground];
+    [resource release];
+    resource = nil;
     [view release];
     view = nil;
 }
@@ -245,8 +232,12 @@
     [self finishedLoadingWithData:[dataSource data]];
 }
 
+ at end
+
 #pragma mark WebResourceHandle
 
+ at implementation WebPluginStream (WebResourceClient)
+
 - (void)WebResourceHandleDidBeginLoading:(WebResourceHandle *)handle
 {
     [[view webController] _didStartLoading:URL];
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index 9d273b6..25777a1 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -59,10 +59,10 @@
 + (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
     withURL:(NSURL *)URL dataSource:(WebDataSource *)source
 {
-    WebResourceHandle *handle;
-    WebSubresourceClient *client;
-    
-    handle = [[[WebResourceHandle alloc] initWithURL:URL attributes:[source attributes] flags:[source flags]] autorelease];
+    WebSubresourceClient *client = [[self alloc] initWithLoader:rLoader dataSource:source];
+    WebResourceHandle *handle = [[[WebResourceHandle alloc] initWithClient:client URL:URL attributes:[source attributes] flags:[source flags]] autorelease];
+    [client release];
+
     if (handle == nil) {
         [rLoader cancel];
 
@@ -74,11 +74,6 @@
         [badURLError release];
     } else {
         [source _addResourceHandle:handle];
-        
-        client = [[self alloc] initWithLoader:rLoader dataSource:source];
-        [handle addClient:client];
-        [client release];
-        
         [handle loadInBackground];
     }
         
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index 9d273b6..25777a1 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -59,10 +59,10 @@
 + (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
     withURL:(NSURL *)URL dataSource:(WebDataSource *)source
 {
-    WebResourceHandle *handle;
-    WebSubresourceClient *client;
-    
-    handle = [[[WebResourceHandle alloc] initWithURL:URL attributes:[source attributes] flags:[source flags]] autorelease];
+    WebSubresourceClient *client = [[self alloc] initWithLoader:rLoader dataSource:source];
+    WebResourceHandle *handle = [[[WebResourceHandle alloc] initWithClient:client URL:URL attributes:[source attributes] flags:[source flags]] autorelease];
+    [client release];
+
     if (handle == nil) {
         [rLoader cancel];
 
@@ -74,11 +74,6 @@
         [badURLError release];
     } else {
         [source _addResourceHandle:handle];
-        
-        client = [[self alloc] initWithLoader:rLoader dataSource:source];
-        [handle addClient:client];
-        [client release];
-        
         [handle loadInBackground];
     }
         
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index ffc283c..0cff48a 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -43,7 +43,8 @@
     _private->inputURL = [URL retain];
     _private->flags = theFlags;
     _private->attributes = [theAttributes retain];
-    _private->mainHandle = [[WebResourceHandle alloc] initWithURL: _private->inputURL attributes:theAttributes flags:theFlags];
+    _private->mainResourceHandleClient = [[WebMainResourceClient alloc] initWithDataSource: self];
+    _private->mainHandle = [[WebResourceHandle alloc] initWithClient:_private->mainResourceHandleClient URL:_private->inputURL attributes:theAttributes flags:theFlags];
     
     ++WebDataSourceCount;
     
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index d032be2..93cd83c 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -174,9 +174,6 @@
     
     [self _clearErrors];
     
-    _private->mainResourceHandleClient = [[WebMainResourceClient alloc] initWithDataSource: self];
-    [_private->mainHandle addClient: _private->mainResourceHandleClient];
-    
     // Mark the start loading time.
     _private->loadingStartedTime = CFAbsoluteTimeGetCurrent();
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list