RESOLVED FIXED Bug 92933
[chromium] Add API to make it possible to request several variants of a WebImage
https://bugs.webkit.org/show_bug.cgi?id=92933
Summary [chromium] Add API to make it possible to request several variants of a WebImage
Nico Weber
Reported 2012-08-01 19:00:37 PDT
[chromium] Add API to make it possible to request several variants of a WebImage
Attachments
Patch (4.78 KB, patch)
2012-08-01 19:01 PDT, Nico Weber
no flags
Patch (4.95 KB, patch)
2012-08-02 15:29 PDT, Nico Weber
no flags
Patch (4.18 KB, patch)
2012-08-03 14:50 PDT, Nico Weber
no flags
Patch (4.17 KB, patch)
2012-08-03 15:02 PDT, Nico Weber
no flags
Patch for landing (4.04 KB, patch)
2012-08-03 16:17 PDT, Nico Weber
no flags
Nico Weber
Comment 1 2012-08-01 19:01:04 PDT
Nico Weber
Comment 2 2012-08-01 19:01:18 PDT
Comment on attachment 155948 [details] Patch just wip
Nico Weber
Comment 3 2012-08-02 15:29:39 PDT
Nico Weber
Comment 4 2012-08-03 14:50:41 PDT
WebKit Review Bot
Comment 5 2012-08-03 14:53:06 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Adam Barth
Comment 6 2012-08-03 14:57:12 PDT
Comment on attachment 156463 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=156463&action=review > Source/WebKit/chromium/src/WebImageSkia.cpp:92 > + // This is to protect from malicious favicons. It should be big enough that it's never hit in pracice. > + const size_t kMaxFaviconCount = 8; As written, this function doesn't have anything to do with favicons. Maybe we should use a different name for this constant? Also, WebKit doesn't use the k prefix. > Source/WebKit/chromium/src/WebImageSkia.cpp:100 > + // Frames are arranged by decreasing size, then decreasing bit depth. > + // Keep the first frame at every size, has the highest bit depth. Is this true of things other than favicons? I would imagine that a GIF might not follow this rule.
Adam Barth
Comment 7 2012-08-03 14:57:45 PDT
Is this function specific to favicons? If so, we should put that in the name somewhere.
Nico Weber
Comment 8 2012-08-03 15:02:28 PDT
Thanks! (In reply to comment #6) > (From update of attachment 156463 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=156463&action=review > > > Source/WebKit/chromium/src/WebImageSkia.cpp:92 > > + // This is to protect from malicious favicons. It should be big enough that it's never hit in pracice. > > + const size_t kMaxFaviconCount = 8; > > As written, this function doesn't have anything to do with favicons. Maybe we should use a different name for this constant? Also, WebKit doesn't use the k prefix. Change "favicon" to "frame". WebKit/Source/WTF/wtf/ThreadSpecific.h and a few other places do seem to use it. But constantNamesLikeThis seem most common, so changed to that. > > Source/WebKit/chromium/src/WebImageSkia.cpp:100 > > + // Frames are arranged by decreasing size, then decreasing bit depth. > > + // Keep the first frame at every size, has the highest bit depth. > > Is this true of things other than favicons? I would imagine that a GIF might not follow this rule. WebImage::fromData() above has the same comment. In practice, these functions are only used for favicon-like functionality at the moment, but they aren't inherently favicon-specific. The APIs can't be used to get all frames from a gif, but since that's not needed anywhere at the moment I think that's fine?
Nico Weber
Comment 9 2012-08-03 15:02:56 PDT
Adam Barth
Comment 10 2012-08-03 15:08:35 PDT
Comment on attachment 156466 [details] Patch ok
Darin Fisher (:fishd, Google)
Comment 11 2012-08-03 16:13:41 PDT
Comment on attachment 156466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=156466&action=review > Source/WebKit/chromium/src/WebImageSkia.cpp:119 > + return result; nit: you should just be able to write "return frames;" here. It should auto-convert to WebVector for you. See the WebVector(const C&) constructor.
Nico Weber
Comment 12 2012-08-03 16:17:28 PDT
Created attachment 156476 [details] Patch for landing
Nico Weber
Comment 13 2012-08-03 16:17:43 PDT
> nit: you should just be able to write "return frames;" here. It should auto-convert to WebVector for you. See the WebVector(const C&) constructor. Neat! Done.
WebKit Review Bot
Comment 14 2012-08-03 20:25:37 PDT
Comment on attachment 156476 [details] Patch for landing Clearing flags on attachment: 156476 Committed r124688: <http://trac.webkit.org/changeset/124688>
WebKit Review Bot
Comment 15 2012-08-03 20:25:42 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.