WebCore:
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Sep 2006 07:29:59 +0000 (07:29 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Sep 2006 07:29:59 +0000 (07:29 +0000)
        Reviewed by Hyatt

        Pruning code relating to WebKit's icon loader

        * bridge/mac/WebCoreIconDatabaseBridge.h:
        * bridge/mac/WebCoreIconDatabaseBridge.mm:
        * loader/icon/IconDatabase.h:
        * page/Frame.cpp:
        (WebCore::Frame::endIfNotLoading): Moved a FIXME in from WebKit's IconLoader to
        its new home

WebKit:

        Reviewed by Hyatt

        WebIconLoader is dead, long live WebCore::IconLoader
        (code prune)

        * Loader/WebFrameLoader.h:
        * Loader/WebFrameLoader.m:
        (-[WebFrameLoader dealloc]):
        (-[WebFrameLoader commitProvisionalLoad]):
        * Loader/WebIconLoader.h: Removed.
        * Loader/WebIconLoader.m: Removed.
        * Misc/WebIconDatabase.h:
        * Misc/WebIconDatabase.m:
        * Misc/WebIconDatabasePrivate.h:
        * WebCoreSupport/WebFrameBridge.m:
        (-[WebFrameBridge notifyIconChanged:]):
        * WebCoreSupport/WebIconDatabaseBridge.h:
        * WebCoreSupport/WebIconDatabaseBridge.m:
        (-[WebIconDatabaseBridge _init]):
        (-[WebIconDatabaseBridge _setIconData:forIconURL:]):
        (-[WebIconDatabaseBridge _setHaveNoIconForIconURL:]):
        * WebKit.exp:
        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebDataSource.m:
        (-[WebDataSourcePrivate dealloc]):
        (-[WebDataSource _stopLoading]):
        (-[WebDataSource _setPrimaryLoadComplete:]):
        * WebView/WebDataSourceInternal.h:

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

20 files changed:
WebCore/ChangeLog
WebCore/bridge/mac/WebCoreIconDatabaseBridge.h
WebCore/bridge/mac/WebCoreIconDatabaseBridge.mm
WebCore/loader/icon/IconDatabase.h
WebCore/page/Frame.cpp
WebKit/ChangeLog
WebKit/Loader/WebFrameLoader.h
WebKit/Loader/WebFrameLoader.m
WebKit/Loader/WebIconLoader.h [deleted file]
WebKit/Loader/WebIconLoader.m [deleted file]
WebKit/Misc/WebIconDatabase.h
WebKit/Misc/WebIconDatabase.m
WebKit/Misc/WebIconDatabasePrivate.h
WebKit/WebCoreSupport/WebFrameBridge.m
WebKit/WebCoreSupport/WebIconDatabaseBridge.h
WebKit/WebCoreSupport/WebIconDatabaseBridge.m
WebKit/WebKit.exp
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebDataSource.m
WebKit/WebView/WebDataSourceInternal.h

index 2d5de2ce811b4bac2635240289f549b668c1311a..5f6644ddee63fc4221e617298a0b0cdf972584ad 100644 (file)
@@ -1,3 +1,16 @@
+2006-09-16  Brady Eidson <beidson@apple.com>
+
+        Reviewed by Hyatt
+
+        Pruning code relating to WebKit's icon loader
+
+        * bridge/mac/WebCoreIconDatabaseBridge.h:
+        * bridge/mac/WebCoreIconDatabaseBridge.mm:
+        * loader/icon/IconDatabase.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::endIfNotLoading): Moved a FIXME in from WebKit's IconLoader to 
+        its new home
+
 2006-09-16  Sam Weinig  <sam.weinig@gmail.com>
 
         Reviewed by Tim H.
index 78e859f4e100c20fe681ab6d51277181f143bd8d..e526a5a2f5371937c8f81c647459dfcb3caaec8e 100644 (file)
@@ -66,7 +66,6 @@ typedef WebCore::IconDatabase WebCoreIconDatabase;
 
 @protocol WebCoreIconDatabaseBridge
 + (WebCoreIconDatabaseBridge *)sharedInstance;
-- (void)loadIconFromURL:(NSString *)iconURL;
 @end
 
 // This interface definition allows those who hold a WebCoreIconDatabaseBridge * to call all the methods
index 9a778ce49d5c248c2f19d4534e1720e978ed2088..65330591ffb1fdb1f2131ff03a627fffd184c1c6 100644 (file)
 
 using namespace WebCore;
 
-namespace WebCore {
-
-void IconDatabase::loadIconFromURL(const String& url)
-{
-    if (url.isEmpty())
-        return;
-    [[WebCoreIconDatabaseBridge sharedInstance] loadIconFromURL:(NSString *)url];
-}
-
-}
-
 @implementation WebCoreIconDatabaseBridge
 
 - (BOOL)openSharedDatabaseWithPath:(NSString *)path
index 11fe23f6ffc8c3785d0f35db27884fc188c42140..91a84dc95878d8845aed1189761771e2d24cfbc3 100644 (file)
@@ -177,7 +177,7 @@ private:
     // FIXME: This method is currently implemented in WebCoreIconDatabaseBridge so we can be in ObjC++ and fire off a loader in Webkit
     // Once all of the loader logic is sufficiently moved into WebCore we need to move this implementation to IconDatabase.cpp
     // using WebCore-style loaders
-    void loadIconFromURL(const String&);
+    // void loadIconFromURL(const String&);
     
     static IconDatabase* m_sharedInstance;
         
index b1bcab7db2c1d1824f8c0c004d1fbf97cc4769cf..b2c7e03b2c7f99259cff36b16f3656a2f21bb620 100644 (file)
@@ -759,6 +759,10 @@ void Frame::endIfNotLoading()
         // last one to complete.
         checkCompleted();
     
+    // FIXME - Right now, we kick off the icon loader when the frame is done receiving all its main resource.
+    // We could kick off the icon loader after we're done parsing the HEAD element, if that becomes convinient to find
+    // at a future date
+    
     // Don't load an icon if -
     // 1) This is not the main frame 
     // 2) The database is disabled
index 3f68ad895fec7f7110bf48a815505932855ee6d0..1dac0bc420ab1e8e53e52df9fa4c846a4dd10dc3 100644 (file)
@@ -1,3 +1,34 @@
+2006-09-16  Brady Eidson <beidson@apple.com>
+
+        Reviewed by Hyatt
+
+        WebIconLoader is dead, long live WebCore::IconLoader
+        (code prune)
+
+        * Loader/WebFrameLoader.h:
+        * Loader/WebFrameLoader.m:
+        (-[WebFrameLoader dealloc]):
+        (-[WebFrameLoader commitProvisionalLoad]):
+        * Loader/WebIconLoader.h: Removed.
+        * Loader/WebIconLoader.m: Removed.
+        * Misc/WebIconDatabase.h:
+        * Misc/WebIconDatabase.m:
+        * Misc/WebIconDatabasePrivate.h:
+        * WebCoreSupport/WebFrameBridge.m:
+        (-[WebFrameBridge notifyIconChanged:]):
+        * WebCoreSupport/WebIconDatabaseBridge.h:
+        * WebCoreSupport/WebIconDatabaseBridge.m:
+        (-[WebIconDatabaseBridge _init]):
+        (-[WebIconDatabaseBridge _setIconData:forIconURL:]):
+        (-[WebIconDatabaseBridge _setHaveNoIconForIconURL:]):
+        * WebKit.exp:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebView/WebDataSource.m:
+        (-[WebDataSourcePrivate dealloc]):
+        (-[WebDataSource _stopLoading]):
+        (-[WebDataSource _setPrimaryLoadComplete:]):
+        * WebView/WebDataSourceInternal.h:
+
 2006-09-16  Mark Rowe  <opendarwin.org@bdash.net.nz>
 
         Reviewed by Anders.
index ba0ebf2f23d29b2019225e29284162cae8474ece..d6aa4cf44590f89b4a20f648f9dc67b86cb93706 100644 (file)
@@ -33,7 +33,6 @@
 @class WebArchive;
 @class WebDataSource;
 @class WebMainResourceLoader;
-@class WebIconLoader;
 @class WebLoader;
 @class WebResource;
 @class WebFrame;
@@ -62,7 +61,6 @@ typedef enum {
     
     NSMutableArray *subresourceLoaders;
     NSMutableArray *plugInStreamLoaders;
-    WebIconLoader *iconLoader;
     
     WebFrame *webFrame;
     WebDataSource *dataSource;
@@ -75,10 +73,6 @@ typedef enum {
 }
 
 - (id)initWithWebFrame:(WebFrame *)wf;
-// FIXME: should really split isLoadingIcon from hasLoadedIcon, no?
-- (BOOL)hasIconLoader;
-- (void)loadIconWithRequest:(NSURLRequest *)request;
-- (void)stopLoadingIcon;
 - (void)addPlugInStreamLoader:(WebLoader *)loader;
 - (void)removePlugInStreamLoader:(WebLoader *)loader;
 - (void)setDefersCallbacks:(BOOL)defers;
@@ -135,7 +129,6 @@ typedef enum {
 - (void)_setResponse:(NSURLResponse *)response;
 - (void)_mainReceivedError:(NSError *)error complete:(BOOL)isComplete;
 - (void)_finishedLoading;
-- (void)_iconLoaderReceivedPageIcon:(NSURL *)iconURL;
 - (NSURL *)_URL;
 
 - (NSError *)cancelledErrorWithRequest:(NSURLRequest *)request;
@@ -153,7 +146,6 @@ typedef enum {
 + (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;
index ac3a2c4f7afce087b574f3d34b756f68b17a73d0..936f6a945aadb106cefeb7a5081a4fcebb982473 100644 (file)
@@ -31,7 +31,6 @@
 #import <JavaScriptCore/Assertions.h>
 #import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebFrameInternal.h>
-#import <WebKit/WebIconLoader.h>
 #import <WebKit/WebMainResourceLoader.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebViewInternal.h>
     [mainResourceLoader release];
     [subresourceLoaders release];
     [plugInStreamLoaders release];
-    [iconLoader release];
     [dataSource release];
     [provisionalDataSource release];
     
     [super dealloc];
 }
 
-- (BOOL)hasIconLoader
-{
-    return iconLoader != nil;
-}
-
-- (void)loadIconWithRequest:(NSURLRequest *)request
-{
-    ASSERT(!iconLoader);
-    iconLoader = [[WebIconLoader alloc] initWithRequest:request];
-    [iconLoader setFrameLoader:self];
-    [iconLoader loadWithRequest:request];
-}
-
-- (void)stopLoadingIcon
-{
-    [iconLoader stopLoading];
-}
-
 - (void)addPlugInStreamLoader:(WebLoader *)loader
 {
     if (!plugInStreamLoaders)
@@ -307,17 +287,10 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [self _setState:WebFrameStateComplete];
 }
 
-- (void)clearIconLoader
-{
-    [iconLoader release];
-    iconLoader = nil;
-}
-
 - (void)commitProvisionalLoad
 {
     [self stopLoadingSubresources];
     [self stopLoadingPlugIns];
-    [self clearIconLoader];
 
     [self _setDataSource:provisionalDataSource];
     [self _setProvisionalDataSource:nil];
@@ -509,17 +482,6 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [self release];
 }
 
-- (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]);
@@ -536,12 +498,6 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [[webFrame webView] _didChangeValueForKey:_WebMainFrameIconKey];
 }
 
-- (void)_iconLoaderReceivedPageIcon:(NSURL *)iconURL
-{
-    [self _updateIconDatabaseWithURL:iconURL];
-    [self _notifyIconChanged:iconURL];
-}
-
 - (NSURL *)_URL
 {
     return [[self activeDataSource] _URL];
diff --git a/WebKit/Loader/WebIconLoader.h b/WebKit/Loader/WebIconLoader.h
deleted file mode 100644 (file)
index 3ba9178..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <WebKit/WebLoader.h>
-
-@class WebIconLoaderPrivate;
-
-/*!
-    @class WebIconLoader
-*/
-@interface WebIconLoader : WebLoader
-{
-    WebIconLoaderPrivate *_private;
-}
-
-/*!
-    @method initWithRequest:
-    @param request
-*/
-- (id)initWithRequest:(NSURLRequest *)request;
-
-/*!
-    @method URL
-*/
-- (NSURL *)URL;
-
-/*!
-    @method startLoading
-*/
-- (void)startLoading;
-
-/*!
-    @method stopLoading
-*/
-- (void)stopLoading;
-@end
-
-@interface NSObject(WebIconLoaderDelegate)
-- (void)_iconLoaderReceivedPageIcon:(WebIconLoader *)iconLoader;
-@end;
diff --git a/WebKit/Loader/WebIconLoader.m b/WebKit/Loader/WebIconLoader.m
deleted file mode 100644 (file)
index d80f53b..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#import <WebKit/WebIconLoader.h>
-
-#import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebFrameLoader.h>
-#import <WebKit/WebIconDatabase.h>
-#import <WebKit/WebIconDatabaseBridge.h>
-#import <WebKit/WebIconDatabasePrivate.h>
-#import <WebKit/WebKitLogging.h>
-
-#import <WebKit/WebNSURLExtras.h>
-
-@interface WebIconLoaderPrivate : NSObject
-{
-@public
-    NSURLRequest *initialRequest;
-}
-
-@end;
-
-@implementation WebIconLoaderPrivate
-
-- (void)dealloc
-{
-    [initialRequest release];
-    [super dealloc];
-}
-
-@end;
-
-@implementation WebIconLoader
-
-- (id)initWithRequest:(NSURLRequest *)initialRequest;
-{
-    ASSERT([[WebIconDatabase sharedIconDatabase] _isEnabled]);
-    [super init];
-    _private = [[WebIconLoaderPrivate alloc] init];
-    _private->initialRequest = [initialRequest copy];
-    return self;
-}
-
-- (void)dealloc
-{
-    [_private release];
-    [super dealloc];
-}
-
-- (NSURL *)URL
-{
-    return [_private->initialRequest URL];
-}
-
-- (void)startLoading
-{
-    [self loadWithRequest:_private->initialRequest];
-}
-
-- (void)stopLoading
-{
-    [self cancel];
-}
-
-- (void)didFinishLoading
-{
-    NSData *data;
-        
-    id response = [self response];
-    if ([response isKindOfClass:[NSHTTPURLResponse class]] && ([response statusCode] < 200 || [response statusCode] > 299))
-        data = nil;
-    else
-        data = [self resourceData];
-    
-    if (data) 
-        [[WebIconDatabase sharedIconDatabase] _setIconData:data forIconURL:[[self URL] _web_originalDataAsString]];
-    else 
-        [[WebIconDatabase sharedIconDatabase] _setHaveNoIconForIconURL:[[self URL] _web_originalDataAsString]];
-    
-    [frameLoader _iconLoaderReceivedPageIcon:[self URL]];
-    [super didFinishLoading];
-}
-
-- (NSURLRequest *)willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse;
-{
-    ASSERT(!reachedTerminalState);
-    
-    // We now allow a WebIconLoader without an associated WebDataSource for kicking off a contextless icon load,
-    // so we override this special case in WebIconLoader only.  If we passed this through to the super class version,
-    // it would pass back a nil Request so the icon wouldn't actually load because it is designed to be part of a page load
-    if (!frameLoader) 
-        return newRequest;
-    return [super willSendRequest:newRequest redirectResponse:redirectResponse];
-}
-
-// We don't ever want to prompt for authentication just for a site icon, so
-// override this WebBaseResourceDelegate method to refuse the challenge
-- (void)didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
-{
-    [[challenge sender] cancelAuthenticationChallenge:challenge];
-}
-
-- (void)didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
-{
-}
-
-@end
index 70cf7251f4cfd557299adbf6c60b2620b7a1b276..fbd8fbdba03ada5702ab28876f4af1e04a134413 100644 (file)
@@ -52,7 +52,6 @@ extern NSSize WebIconLargeSize;  // 128 x 128
         - icon update notification
         
         Uses:
-        - WebIconLoader to cache icon images
         - UI elements to retrieve icons that represent site URLs.
         - Save icons to disk for later use.
  
index 290860e16a90eb4575e55087176a7966934be56a..2406ef29c7807fa10be6f11c47694e5d34fe7892 100644 (file)
@@ -269,11 +269,6 @@ NSSize WebIconLargeSize = {128, 128};
                                                       userInfo:userInfo];
 }
 
-- (void)loadIconFromURL:(NSString *)iconURL
-{
-    [_private->databaseBridge loadIconFromURL:iconURL];
-}
-
 @end
 
 @implementation WebIconDatabase (WebInternal)
index 4afe9ef895c49e3a0664b48af570a2bc31bf67f4..3b04828bbb104f35ad4c697de730aa22c66a322b 100644 (file)
@@ -70,16 +70,10 @@ extern NSString *WebIconDatabaseDidRemoveAllIconsNotification;
 
 - (BOOL)_isEnabled;
 
-// Called by WebIconLoader after loading an icon.
-- (void)_setIconData:(NSData *)data forIconURL:(NSString *)iconURL;
-- (void)_setHaveNoIconForIconURL:(NSString *)iconURL;
-
 // Called by WebDataSource to bind a web site URL to a icon URL and icon image.
 - (void)_setIconURL:(NSString *)iconURL forURL:(NSString *)URL;
 
 - (BOOL)_hasEntryForIconURL:(NSString *)iconURL;
 - (void)_sendNotificationForURL:(NSString *)URL;
 
-- (void)loadIconFromURL:(NSString *)iconURL;
-
 @end
index 9f3f5a15c02243d28459f110088111da717a3b92..aa3f5f45b3ac5759277a4096498a4aaef2abb569 100644 (file)
@@ -1705,18 +1705,7 @@ static id <WebFormDelegate> formDelegate(WebFrameBridge *self)
 
 - (void)notifyIconChanged:(NSURL*)iconURL
 {
-    ASSERT([[WebIconDatabase sharedIconDatabase] _isEnabled]);
-    ASSERT(_frame == [[_frame webView] mainFrame]);
-        
-    [[_frame webView] _willChangeValueForKey:_WebMainFrameIconKey];
-    
-    NSImage *icon = [[WebIconDatabase sharedIconDatabase] iconForURL:[[[[_frame _frameLoader] activeDataSource] _URL] _web_originalDataAsString] withSize:WebIconSmallSize];
-    
-    [[[_frame webView] _frameLoadDelegateForwarder] webView:[_frame webView]
-                                               didReceiveIcon:icon
-                                                     forFrame:_frame];
-    
-    [[_frame webView] _didChangeValueForKey:_WebMainFrameIconKey];
+    [[_frame _frameLoader] _notifyIconChanged:iconURL];
 }
 
 - (NSURL*)originalRequestURL
index 11596bd1aeae4957d8559acbe83693612bdc5546..a820b3fde0a901bcb8ae410ee37654f741a88f71 100644 (file)
@@ -30,6 +30,5 @@
 
 @interface WebIconDatabaseBridge : WebCoreIconDatabaseBridge <WebCoreIconDatabaseBridge>
 {
-    NSMutableDictionary* cachedLoaders;
 }
 @end
index 2e15ab3ac9416b5844f964b122272fb2b332fd7c..ccca3ee482a488b54932b5eb8708379d9dc323d6 100644 (file)
@@ -29,7 +29,6 @@
 #import "WebIconDatabaseBridge.h"
 
 #import "WebIconDatabasePrivate.h"
-#import "WebIconLoader.h"
 #import <JavaScriptCore/Assertions.h>
 
 @implementation WebIconDatabaseBridge
 - (id)_init
 {
     self = [super init];
-    if (!self)
-        return nil;
-    cachedLoaders = [[NSMutableDictionary alloc] init];
     return self;
 }
 
-- (void)loadIconFromURL:(NSString *)iconURL
-{
-    if ([cachedLoaders valueForKey:iconURL])
-        return;
-    
-    NSURL *url = [[NSURL alloc] initWithString:iconURL];
-    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60];
-    [url release];
-    
-    WebIconLoader *iconLoader = [[WebIconLoader alloc] initWithRequest:request];
-
-    [iconLoader loadWithRequest:request];
-    [cachedLoaders setValue:iconLoader forKey:iconURL];
-    [iconLoader release];
-    [request release];
-}
-
-- (void)releaseCachedLoaderForIconURL:(NSString*)iconURL
-{
-    WebIconLoader *iconLoader = [cachedLoaders valueForKey:iconURL];
-    if (iconLoader) {
-        [iconLoader stopLoading];
-        [cachedLoaders removeObjectForKey:iconURL];
-    }
-}
-
 // FIXME rdar://4668102 - This is a likely place to add an NSNotification here to notify the app of the updated icon
 - (void)_setIconData:(NSData *)data forIconURL:(NSString *)iconURL
 {
-    [self releaseCachedLoaderForIconURL:iconURL];
     [super _setIconData:data forIconURL:iconURL];
 }
 
 // FIXME rdar://4668102 - This is a likely place to add an NSNotification here to notify the app of the updated icon
 - (void)_setHaveNoIconForIconURL:(NSString *)iconURL
 {
-    [self releaseCachedLoaderForIconURL:iconURL];
     [super _setHaveNoIconForIconURL:iconURL];
 }
 
index 6761e7700ea179ad9806e915f68cc9b42bfc27b5..0cdc778d11a234bad51d99a9edb59260f330d109 100644 (file)
@@ -14,7 +14,6 @@
 .objc_class_name_WebHistory
 .objc_class_name_WebHistoryItem
 .objc_class_name_WebIconDatabase
-.objc_class_name_WebIconLoader
 .objc_class_name_WebInspector
 .objc_class_name_WebJavaScriptTextInputPanel
 .objc_class_name_WebKeyGenerator
index c355207109b376b5450943880a50e5f4c2889754..82facf9f8cc59eea5a2119fec6949b4ae654f0fa 100644 (file)
@@ -32,8 +32,6 @@
                22E42A4F0A5B9F620003275B /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22E42A4E0A5B9F620003275B /* OpenGL.framework */; };
                22E42A9A0A5BA4D00003275B /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22E42A990A5BA4D00003275B /* AGL.framework */; };
                22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               51700DAA0A9052A700DAAA8E /* WebIconLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 51700DA80A9052A700DAAA8E /* WebIconLoader.h */; };
-               51700DAB0A9052A700DAAA8E /* WebIconLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 51700DA90A9052A700DAAA8E /* WebIconLoader.m */; };
                51E4D3990A886B5E00ECEE2C /* WebIconDatabaseBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E4D3970A886B5E00ECEE2C /* WebIconDatabaseBridge.h */; };
                51E4D39A0A886B5E00ECEE2C /* WebIconDatabaseBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 51E4D3980A886B5E00ECEE2C /* WebIconDatabaseBridge.m */; };
                650F74E409E488F70020118A /* WebUnarchivingState.h in Headers */ = {isa = PBXBuildFile; fileRef = 650F74E209E488F70020118A /* WebUnarchivingState.h */; };
                515E27CF0458CA4B00CA2D3A /* WebDefaultUIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDefaultUIDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                515E27D00458CA4B00CA2D3A /* WebDefaultUIDelegate.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDefaultUIDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                516F296F03A6C45A00CA2D3A /* WebHistoryItemPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItemPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               51700DA80A9052A700DAAA8E /* WebIconLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebIconLoader.h; sourceTree = "<group>"; };
-               51700DA90A9052A700DAAA8E /* WebIconLoader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WebIconLoader.m; sourceTree = "<group>"; };
                51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebJavaPlugIn.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                51A8B52E04282B5900CA2D3A /* WebFrameView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                51A8B52F04282B5900CA2D3A /* WebFrameView.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebFrameView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                651A93860A83F883007FEDF0 /* WebDataProtocol.m */,
                                654B3C290A82C47200E1AE3D /* WebFrameLoader.h */,
                                654B3C2A0A82C47200E1AE3D /* WebFrameLoader.m */,
-                               51700DA80A9052A700DAAA8E /* WebIconLoader.h */,
-                               51700DA90A9052A700DAAA8E /* WebIconLoader.m */,
                                654B3C2B0A82C47200E1AE3D /* WebLoader.h */,
                                654B3C2C0A82C47200E1AE3D /* WebLoader.m */,
                                654B3C2D0A82C47200E1AE3D /* WebMainResourceLoader.h */,
                                654B3C3B0A82C47200E1AE3D /* WebSubresourceLoader.h in Headers */,
                                651A93870A83F883007FEDF0 /* WebDataProtocol.h in Headers */,
                                51E4D3990A886B5E00ECEE2C /* WebIconDatabaseBridge.h in Headers */,
-                               51700DAA0A9052A700DAAA8E /* WebIconLoader.h in Headers */,
                                6538B1C80A90596D00A07522 /* WebFormDataStream.h in Headers */,
                                65A734610A923948001B57E8 /* WebPlugInStreamLoaderDelegate.h in Headers */,
                                659044280A9D3B4200E89459 /* WebDocumentLoadState.h in Headers */,
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
                        projectRoot = "";
-                       shouldCheckCompatibility = 1;
                        targets = (
                                9398100A0824BF01008DF038 /* WebKit */,
                        );
                                654B3C3C0A82C47200E1AE3D /* WebSubresourceLoader.m in Sources */,
                                651A93880A83F883007FEDF0 /* WebDataProtocol.m in Sources */,
                                51E4D39A0A886B5E00ECEE2C /* WebIconDatabaseBridge.m in Sources */,
-                               51700DAB0A9052A700DAAA8E /* WebIconLoader.m in Sources */,
                                6538B1C90A90596E00A07522 /* WebFormDataStream.m in Sources */,
                                659044290A9D3B4200E89459 /* WebDocumentLoadState.m in Sources */,
                        );
index 3d3b7cccaf4885c9da0acfe51871dd4adc51d441..c248645483563dff930b64cd1f221e85f5892756 100644 (file)
     BOOL representationFinishedLoading;
     
     BOOL defersCallbacks;
-    
-    NSURL *iconURL;
-    
+        
     // The action that triggered loading of this data source -
     // we keep this around for the benefit of the various policy
     // handlers.
     [pageTitle release];
     [response release];
     [mainDocumentError release];
-    [iconURL release];
     [triggeringAction release];
     [lastCheckedRequest release];
     [responses release];
     _private->representationFinishedLoading = NO;
 }
 
-- (void)_loadIcon
-{
-}
-
 - (NSError *)_cancelledError
 {
     return [NSError _webKitErrorWithDomain:NSURLErrorDomain
@@ -786,11 +779,8 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
 // but not loads initiated by child frames' data sources -- that's the WebFrame's job.
 - (void)_stopLoading
 {
-    // Always attempt to stop the icon loader because it may still be loading after the data source
+    // Always attempt to stop the bridge/part because it may still be loading/parsing after the data source
     // is done loading and not stopping it can cause a world leak.
-    [[_private->webFrame _frameLoader] stopLoadingIcon];
-    
-    // The same goes for the bridge/part, which may still be parsing.
     if (_private->committed)
         [[self _bridge] stopLoading];
     
@@ -869,11 +859,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     _private->primaryLoadComplete = flag;
     
     if (flag) {
-        // FIXME: We could actually load it as soon as we've parsed
-        // the HEAD section, or determined there isn't one - but
-        // there's no callback for that.
-        [self _loadIcon];
-        
         if ([[_private->webFrame _frameLoader] isLoadingMainResource]) {
             [_private->loadState setMainResourceData:[[_private->webFrame _frameLoader] mainResourceData]];
             [[_private->webFrame _frameLoader] releaseMainResourceLoader];
@@ -948,22 +933,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     _private->overrideEncoding = copy;
 }
 
-- (void)_setIconURL:(NSURL *)URL
-{
-    // Lower priority than typed icon, so ignore this if we already have an iconURL.
-    if (_private->iconURL == nil) {
-        [_private->iconURL release];
-        _private->iconURL = [URL retain];
-    }
-}
-
-- (void)_setIconURL:(NSURL *)URL withType:(NSString *)iconType
-{
-    // FIXME: Should check to make sure the type is one we know how to handle.
-    [_private->iconURL release];
-    _private->iconURL = [URL retain];
-}
-
 - (NSString *)_overrideEncoding
 {
     return [[_private->overrideEncoding copy] autorelease];
index 6059e75f6ef574294001bb1a67d7438471e05922..0396656537164b922b9dfa8d4ae9787dba68e1ef 100644 (file)
@@ -51,8 +51,6 @@
 @interface WebDataSource (WebInternal)
 - (void)_setTitle:(NSString *)title;
 - (NSString *)_overrideEncoding;
-- (void)_setIconURL:(NSURL *)URL;
-- (void)_setIconURL:(NSURL *)URL withType:(NSString *)iconType;
 - (void)_setOverrideEncoding:(NSString *)overrideEncoding;
 - (void)_addToUnarchiveState:(WebArchive *)archive;
 - (NSURL *)_URLForHistory;