RESOLVED WONTFIX 113260
Add a runtime flag in WebRuntimeFeatures to enable 'image/webp' accept header
https://bugs.webkit.org/show_bug.cgi?id=113260
Summary Add a runtime flag in WebRuntimeFeatures to enable 'image/webp' accept header
Urvang Joshi
Reported 2013-03-25 18:32:16 PDT
This flag would be off by default. The main idea is to enable Website owners to test their site with these accept header change, before we turn it on by default (later). See the context here: https://code.google.com/p/chromium/issues/detail?id=169182 Also, this flag is meaningful only when the browser supports WebP (denoted by 'USE(WEBP)') -- only Chromium for now. Note: This change is from Webkit side. One more change from chromium side would actually enable/disable this based on command-line options.
Attachments
Patch (5.99 KB, patch)
2013-03-25 18:45 PDT, Urvang Joshi
no flags
Helper method to set accept header (7.11 KB, patch)
2013-03-25 23:09 PDT, Urvang Joshi
no flags
Patch (7.58 KB, patch)
2013-03-27 11:49 PDT, Urvang Joshi
no flags
Patch (7.55 KB, patch)
2013-03-27 15:10 PDT, Urvang Joshi
no flags
Urvang Joshi
Comment 1 2013-03-25 18:45:08 PDT
WebKit Review Bot
Comment 2 2013-03-25 18:48:14 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.
James Robinson
Comment 3 2013-03-25 19:19:16 PDT
Comment on attachment 194972 [details] Patch Hmm, what does this have to do with WebKit? I thought HTTP headers like 'accept' are set by the network stack on the chromium side.
Urvang Joshi
Comment 4 2013-03-25 21:25:41 PDT
> Hmm, what does this have to do with WebKit? I thought HTTP headers like 'accept' are set by the network stack on the chromium side. It's not so, it seems. All the accept headers for cached resources are set by source files in Source/WebCore/loader/cache/*.[h,cpp]. Chromium only puts default headers for HTML page itself, and for some resources where WebKit doesn't put any accept header, AFAIK.
Darin Fisher (:fishd, Google)
Comment 5 2013-03-25 21:45:48 PDT
jamesr: Take a look at CachedCSSStyleSheet.cpp, CachedSVGDocument.cpp, and CachedXSLStyleSheet.cpp, which all call setAccept. urvang: It seems like you shouldn't duplicate the code that sets the accept header. A helper method seems appropriate.
Urvang Joshi
Comment 6 2013-03-25 23:09:34 PDT
Created attachment 195009 [details] Helper method to set accept header
Urvang Joshi
Comment 7 2013-03-25 23:12:24 PDT
@Darin: Yes, I should have. Pls have a look at the new patch.
Mike West
Comment 8 2013-03-27 02:53:34 PDT
Comment on attachment 195009 [details] Helper method to set accept header View in context: https://bugs.webkit.org/attachment.cgi?id=195009&action=review Two drive-by comments: > Source/WebCore/loader/cache/CachedImage.h:102 > + void setCustomAccept(); // Helper method to set the Accept header. Would you mind renaming this to something that makes it clear that we're setting the header? I think 'CachedImage::setCustomAcceptHeader' would be clear enough that you could remove the comment. > Source/WebKit/chromium/src/WebRuntimeFeatures.cpp:765 > + UNUSED_PARAM(enable); Copy/paste error: There's no 'enable' in this method.
Darin Fisher (:fishd, Google)
Comment 9 2013-03-27 10:45:27 PDT
Comment on attachment 195009 [details] Helper method to set accept header View in context: https://bugs.webkit.org/attachment.cgi?id=195009&action=review >> Source/WebCore/loader/cache/CachedImage.h:102 >> + void setCustomAccept(); // Helper method to set the Accept header. > > Would you mind renaming this to something that makes it clear that we're setting the header? I think 'CachedImage::setCustomAcceptHeader' would be clear enough that you could remove the comment. +1
Urvang Joshi
Comment 10 2013-03-27 11:49:25 PDT
Urvang Joshi
Comment 11 2013-03-27 11:51:03 PDT
Comment on attachment 195009 [details] Helper method to set accept header View in context: https://bugs.webkit.org/attachment.cgi?id=195009&action=review >>> Source/WebCore/loader/cache/CachedImage.h:102 >>> + void setCustomAccept(); // Helper method to set the Accept header. >> >> Would you mind renaming this to something that makes it clear that we're setting the header? I think 'CachedImage::setCustomAcceptHeader' would be clear enough that you could remove the comment. > > +1 Done
Urvang Joshi
Comment 12 2013-03-27 11:51:45 PDT
Comment on attachment 195009 [details] Helper method to set accept header View in context: https://bugs.webkit.org/attachment.cgi?id=195009&action=review >> Source/WebKit/chromium/src/WebRuntimeFeatures.cpp:765 >> + UNUSED_PARAM(enable); > > Copy/paste error: There's no 'enable' in this method. Oops, fixed.
Darin Fisher (:fishd, Google)
Comment 13 2013-03-27 14:26:13 PDT
Comment on attachment 195370 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=195370&action=review > Source/WebCore/ChangeLog:8 > + No new tests (OOPS!). nit: you need to delete this line
Urvang Joshi
Comment 14 2013-03-27 15:10:23 PDT
Urvang Joshi
Comment 15 2013-03-29 15:28:29 PDT
@Reviewers: Gentle reminder to pls have another look.
Urvang Joshi
Comment 16 2013-04-09 14:26:57 PDT
Marking this as WONTFIX as it's Chromium specific, and would be taken care of in Blink repo now. Being tracked here: https://code.google.com/p/chromium/issues/detail?id=169182
Note You need to log in before you can comment on or make changes to this bug.