RESOLVED FIXED Bug 32334
[GTK] Should provide an API to control the IconDatabase
https://bugs.webkit.org/show_bug.cgi?id=32334
Summary [GTK] Should provide an API to control the IconDatabase
Gustavo Noronha (kov)
Reported 2009-12-09 11:30:12 PST
WebKit has a full-blown icon database. We should probably take advantage of it, and implement a nice API on top of it. For now, I would like to at least allow applications to be notified of icon URLs.
Attachments
first step (8.51 KB, patch)
2009-12-09 11:34 PST, Gustavo Noronha (kov)
gustavo: commit-queue-
Epiphany patch using this API (7.32 KB, patch)
2009-12-09 11:38 PST, Gustavo Noronha (kov)
no flags
second try (16.18 KB, patch)
2009-12-10 05:57 PST, Gustavo Noronha (kov)
gustavo: commit-queue-
real second try (16.50 KB, patch)
2009-12-10 06:01 PST, Gustavo Noronha (kov)
xan.lopez: review+
gustavo: commit-queue-
Gustavo Noronha (kov)
Comment 1 2009-12-09 11:34:30 PST
Created attachment 44549 [details] first step There are some caveats (the full blown icon database is enabled, but only a tiny bit is being used), but this allows us to move forward with implementing favicons, and is a first step towards adopting the internal icon database.
WebKit Review Bot
Comment 2 2009-12-09 11:37:40 PST
Attachment 44549 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 WebKit/gtk/webkit/webkitwebview.cpp:2398: Use 0 instead of NULL. [readability/null] [5] WebKit/gtk/webkit/webkitwebview.cpp:4003: Use 0 instead of NULL. [readability/null] [5] WebKit/gtk/webkit/webkitprivate.cpp:262: Use 0 instead of NULL. [readability/null] [5] WebKit/gtk/webkit/webkitwebview.h:371: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 4
Gustavo Noronha (kov)
Comment 3 2009-12-09 11:38:00 PST
Created attachment 44550 [details] Epiphany patch using this API As usual =).
Gustavo Noronha (kov)
Comment 4 2009-12-09 12:01:17 PST
(In reply to comment #2) > Attachment 44549 [details] did not pass style-queue: > > Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 > WebKit/gtk/webkit/webkitwebview.cpp:2398: Use 0 instead of NULL. > [readability/null] [5] > WebKit/gtk/webkit/webkitwebview.cpp:4003: Use 0 instead of NULL. > [readability/null] [5] > WebKit/gtk/webkit/webkitprivate.cpp:262: Use 0 instead of NULL. > [readability/null] [5] This is caused by our convention that NULL should be used for any calls gcc checks for the sentinel, and for code inside WebKit/gtk/. > WebKit/gtk/webkit/webkitwebview.h:371: Extra space before ( in function call > [whitespace/parens] [4] > Total errors found: 4 This is caused by the GTK+ API convention of using vertical alignment for parameters. Any .h inside WebKit/gtk/webkit/ will have that.
Eric Seidel (no email)
Comment 5 2009-12-09 13:34:07 PST
(In reply to comment #4) > (In reply to comment #2) > > Attachment 44549 [details] [details] did not pass style-queue: > > > > Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 > > WebKit/gtk/webkit/webkitwebview.cpp:2398: Use 0 instead of NULL. > > [readability/null] [5] > > WebKit/gtk/webkit/webkitwebview.cpp:4003: Use 0 instead of NULL. > > [readability/null] [5] > > WebKit/gtk/webkit/webkitprivate.cpp:262: Use 0 instead of NULL. > > [readability/null] [5] > > This is caused by our convention that NULL should be used for any calls gcc > checks for the sentinel, and for code inside WebKit/gtk/. > > > WebKit/gtk/webkit/webkitwebview.h:371: Extra space before ( in function call > > [whitespace/parens] [4] > > Total errors found: 4 > > This is caused by the GTK+ API convention of using vertical alignment for > parameters. Any .h inside WebKit/gtk/webkit/ will have that. If you believe check-webkit-style is wrong here, please file a bug an CC Dave Levin and Adam Barth.
Adam Barth
Comment 6 2009-12-09 13:38:12 PST
Please file the bug. We don't want the bot spamming suggestions we don't expect to follow.
Xan Lopez
Comment 7 2009-12-09 23:00:17 PST
Comment on attachment 44549 [details] first step I realize it would be an API break, but seems to me it would be a lot more convenient to have 'icon-loaded' carry the favicon URI, right? Any anyway you are already kind of changing the API to ack the fact that the signal was carrying a frame. What do you think?
Xan Lopez
Comment 8 2009-12-10 02:21:17 PST
Also, per comments on IRC, seems you need to close the icon database somehow if you are opening it. The other ports seem to detect when the process is being terminated to do that.
Julian de Navascues
Comment 9 2009-12-10 02:39:32 PST
(In reply to comment #0) > WebKit has a full-blown icon database. We should probably take advantage of it, > and implement a nice API on top of it. Hi! I'm working in this subject.
Gustavo Noronha (kov)
Comment 10 2009-12-10 04:26:18 PST
(In reply to comment #9) > (In reply to comment #0) > > WebKit has a full-blown icon database. We should probably take advantage of it, > > and implement a nice API on top of it. > > Hi! I'm working in this subject. Good =) thoughts on the patch I posted? =)
Gustavo Noronha (kov)
Comment 11 2009-12-10 05:57:40 PST
Created attachment 44608 [details] second try
Gustavo Noronha (kov)
Comment 12 2009-12-10 06:01:44 PST
Created attachment 44610 [details] real second try Oops, forgot an important part of the test! Here it is.
Xan Lopez
Comment 13 2009-12-10 06:12:49 PST
Comment on attachment 44610 [details] real second try Looks good to me. The test has some style issues wrt pointer types and the '*', try to go through it once before landing.
Gustavo Noronha (kov)
Comment 14 2009-12-10 06:36:05 PST
Landed as 51948, with the problems noticed by Xan fixed. I am going to report a bug on the style checker later today.
Julian de Navascues
Comment 15 2009-12-13 05:06:34 PST
(In reply to comment #11) > Created an attachment (id=44608) [details] > second try (In reply to comment #10) > (In reply to comment #9) > > (In reply to comment #0) > > > WebKit has a full-blown icon database. We should probably take advantage of it, > > > and implement a nice API on top of it. > > > > Hi! I'm working in this subject. > > Good =) thoughts on the patch I posted? =) I think we should use #if ENABLE (ICONDATABASE) directive in future patchs like WebCore does. In the case of Epiphany I guess icons will be cached twice, but that's not a big problem. Closing icondatabse with atexit seems a great idea to me.
Gustavo Noronha (kov)
Comment 16 2009-12-13 07:09:47 PST
(In reply to comment #15) > > Good =) thoughts on the patch I posted? =) > > I think we should use #if ENABLE (ICONDATABASE) directive in future patchs like > WebCore does. In the case of Epiphany I guess icons will be cached twice, but > that's not a big problem. Closing icondatabse with atexit seems a great idea to > me. The reason I did not do this is because we already enable the icon database unconditionally for the gtk+ port, so it seemed unnecessary. This has to of course be revisited if we intend to support building with it disabled.
Julian de Navascues
Comment 17 2009-12-14 05:25:15 PST
I have opened a new bug to discuss the API to control the Icon Database: https://bugs.webkit.org/show_bug.cgi?id=3251
Julian de Navascues
Comment 18 2009-12-14 05:27:51 PST
(In reply to comment #17) > I have opened a new bug to discuss the API to control the Icon Database: > https://bugs.webkit.org/show_bug.cgi?id=3251 The right link is: https://bugs.webkit.org/show_bug.cgi?id=32510 Sorry!
Note You need to log in before you can comment on or make changes to this bug.