Bug 22374

Summary: Need API to access favicons using the favicon URL.
Product: WebKit Reporter: Yael <yael>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: hausmann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Implementation of the new required API darin: review-

Description Yael 2008-11-19 18:32:07 PST
Applications need to fetch the favicon data without having the exact URL of the page that loaded the favicon originally. An example would be when displaying a list of local storage databases. The application has only the security origin. By appending "/favicon.ico" applications can get the favicon in most cases.
Comment 1 Yael 2008-11-19 18:34:30 PST
Created attachment 25300 [details]
Implementation of the new required API
Comment 2 Eric Seidel (no email) 2008-11-26 15:18:25 PST
Comment on attachment 25300 [details]
Implementation of the new required API

If the application needs these icons cached, it seems it should have its own cache with a lifetime tied to the lifetime of the storage databases.  But maybe I'm misunderstanding the problem?

Also, you should note that WebCore has no public interfaces.  If you application directly depends on WebCore it will break in the future.  I'm not sure if that's the case here or not.  A good example of this is when Qt exposed the "is this url in your history database" function call from WebCore to Qt embedders.  This changed when we moved to a better hash-based history lookup, and broke the Qt build.  Now they have an ugly hack in place to support this (hopefully soon deprecated Qt API).

Marking as r- to remove it from the review queue pending further comment.  Certainly please correct me if I've misunderstood.
Comment 3 Simon Hausmann 2008-12-02 13:44:44 PST
(In reply to comment #2)
> (From update of attachment 25300 [details] [review])
> If the application needs these icons cached, it seems it should have its own
> cache with a lifetime tied to the lifetime of the storage databases.  But maybe
> I'm misunderstanding the problem?

I think there is a misunderstanding indeed :). The storage database list is just an example. If I understand this correctly it is more about the ability to query a site-wide favicon.   

> Also, you should note that WebCore has no public interfaces.  If you
> application directly depends on WebCore it will break in the future.  I'm not
> sure if that's the case here or not.  A good example of this is when Qt exposed
> the "is this url in your history database" function call from WebCore to Qt
> embedders.  This changed when we moved to a better hash-based history lookup,
> and broke the Qt build.  Now they have an ugly hack in place to support this
> (hopefully soon deprecated Qt API).

I agree that in the history case it was a mistake to rely on this design :(, but I feel this case is different in the sense that it's just about exposing something that exists by design.
Comment 4 Darin Adler 2008-12-05 09:41:25 PST
Comment on attachment 25300 [details]
Implementation of the new required API

I'm not sure I understand the use of the term "API" here. This is the internal interface between WebCore and WebKit. I don't see a patch adding API to any platform's WebKit.

A patch that adds an unused function is not a good idea.

Further, there's too much copied and pasted code here -- this should not just be a copy of iconForPageURL; instead it should be factored so the code is shared appropriately.

Because of these two issues I'm going to say review- for this version of the patch.