|
|
DescriptionStore, use and send etags.
We use them to validate/invalide cached but expired data.
We send Match-If headers to prevent mixing of old/new cached data.
This should all be safe to do, since the HTTP cache already sends
etags to manage it's internal cached state, this CL just extends
this behavior to apply to client-side in-memory cached data as well.
BUG=504194
Committed: https://crrev.com/fd30799f6f8a7d1366d97693b72b0b20be94d5c0
Cr-Commit-Position: refs/heads/master@{#419264}
Patch Set 1 #
Total comments: 2
Patch Set 2 : comments addressed #Patch Set 3 : comments addressed #
Total comments: 3
Messages
Total messages: 28 (15 generated)
The CQ bit was checked by hubbe@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
hubbe@chromium.org changed reviewers: + dalecurtis@google.com
dalecurtis@chromium.org changed reviewers: + dalecurtis@chromium.org, tombergan@chromium.org - dalecurtis@google.com
lg2m, but +tombergan to verify.
https://codereview.chromium.org/2338963002/diff/1/media/blink/url_index.cc File media/blink/url_index.cc (right): https://codereview.chromium.org/2338963002/diff/1/media/blink/url_index.cc#ne... media/blink/url_index.cc:224: bool HasStrongEtag(const scoped_refptr<UrlData>& entry) { Don't pass scoped_refptr by const& anymore. I'd just pass a const& directly to the etag here.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by hubbe@chromium.org to run a CQ dry run
https://codereview.chromium.org/2338963002/diff/1/media/blink/url_index.cc File media/blink/url_index.cc (right): https://codereview.chromium.org/2338963002/diff/1/media/blink/url_index.cc#ne... media/blink/url_index.cc:224: bool HasStrongEtag(const scoped_refptr<UrlData>& entry) { On 2016/09/13 23:31:52, DaleCurtis wrote: > Don't pass scoped_refptr by const& anymore. I'd just pass a const& directly to > the etag here. Done.
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
(Can't reply on the codereview tool right now because I left my phone at home, so I can't get past two-factor auth :-/) > media/blink/resource_multibuffer_data_provider.cc:88 > request.setHTTPHeaderField(WebString::fromUTF8("Match-If"), Two questions about this: First, did you mean to say If-Match, not Match-if? https://tools.ietf.org/html/rfc7232#section-3.1 Second, I think If-Range is more appropriate since this is a Range request (see line 82 above)? https://tools.ietf.org/html/rfc7232#section-3.5 > media/blink/url_index.cc:227 I think lines 227-229 can simplify to: return etag[0] == '"'; // <- that's checking if the first character is a double quote https://tools.ietf.org/html/rfc7232#section-2.3 On Tue, Sep 13, 2016 at 5:23 PM, <hubbe@chromium.org> wrote: > > https://codereview.chromium.org/2338963002/diff/1/media/blink/url_index.cc > File media/blink/url_index.cc (right): > > https://codereview.chromium.org/2338963002/diff/1/media/ > blink/url_index.cc#newcode224 > media/blink/url_index.cc:224: bool HasStrongEtag(const > scoped_refptr<UrlData>& entry) { > On 2016/09/13 23:31:52, DaleCurtis wrote: > > Don't pass scoped_refptr by const& anymore. I'd just pass a const& > directly to > > the etag here. > > Done. > > https://codereview.chromium.org/2338963002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
On Wed, Sep 14, 2016 at 12:04 PM, Tom Bergan <tombergan@chromium.org> wrote: > (Can't reply on the codereview tool right now because I left my phone at > home, so I can't get past two-factor auth :-/) > > > media/blink/resource_multibuffer_data_provider.cc:88 > > request.setHTTPHeaderField(WebString::fromUTF8("Match-If"), > > Two questions about this: First, did you mean to say If-Match, not > Match-if? > https://tools.ietf.org/html/rfc7232#section-3.1 > > Second, I think If-Range is more appropriate since this is a Range request > (see line 82 above)? > https://tools.ietf.org/html/rfc7232#section-3.5 > Just remembered from the bug why you suggested If-Match instead of If-Range -- because the player cannot proceed if the video changed, so there's no point in returning the full video. However, note that the cache layer uses If-Range but does not use If-Match (to my knowledge), so from a deployment perspective, this may be more risky than If-Range. Not sure though. > > media/blink/url_index.cc:227 > I think lines 227-229 can simplify to: > return etag[0] == '"'; // <- that's checking if the first character is a > double quote > > https://tools.ietf.org/html/rfc7232#section-2.3 > > On Tue, Sep 13, 2016 at 5:23 PM, <hubbe@chromium.org> wrote: > >> >> https://codereview.chromium.org/2338963002/diff/1/media/blin >> k/url_index.cc >> File media/blink/url_index.cc (right): >> >> https://codereview.chromium.org/2338963002/diff/1/media/blin >> k/url_index.cc#newcode224 >> media/blink/url_index.cc:224: bool HasStrongEtag(const >> scoped_refptr<UrlData>& entry) { >> On 2016/09/13 23:31:52, DaleCurtis wrote: >> > Don't pass scoped_refptr by const& anymore. I'd just pass a const& >> directly to >> > the etag here. >> >> Done. >> >> https://codereview.chromium.org/2338963002/ >> > > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
The CQ bit was checked by hubbe@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
PTAL On 2016/09/14 19:07:47, Tom Bergan wrote: > On Wed, Sep 14, 2016 at 12:04 PM, Tom Bergan <mailto:tombergan@chromium.org> wrote: > > > (Can't reply on the codereview tool right now because I left my phone at > > home, so I can't get past two-factor auth :-/) > > > > > media/blink/resource_multibuffer_data_provider.cc:88 > > > request.setHTTPHeaderField(WebString::fromUTF8("Match-If"), > > > > Two questions about this: First, did you mean to say If-Match, not > > Match-if? > > https://tools.ietf.org/html/rfc7232#section-3.1 > > Yes, done. > > Second, I think If-Range is more appropriate since this is a Range request > > (see line 82 above)? > > https://tools.ietf.org/html/rfc7232#section-3.5 > > > > Just remembered from the bug why you suggested If-Match instead of If-Range > -- because the player cannot proceed if the video changed, so there's no > point in returning the full video. However, note that the cache layer uses > If-Range but does not use If-Match (to my knowledge), so from a deployment > perspective, this may be more risky than If-Range. Not sure though. > I agree, there is a small additional risk in using If-Match instead of If-Range. I think it's pretty small though. The problem with If-Range is that people just get confused about "I responded with a 200, why doesn't it work??". > > > > media/blink/url_index.cc:227 > > I think lines 227-229 can simplify to: > > return etag[0] == '"'; // <- that's checking if the first character is a > > double quote > > > > https://tools.ietf.org/html/rfc7232#section-2.3 > > Done.
One more question, otherwise LGTM https://codereview.chromium.org/2338963002/diff/40001/media/blink/url_index.cc File media/blink/url_index.cc (right): https://codereview.chromium.org/2338963002/diff/40001/media/blink/url_index.c... media/blink/url_index.cc:238: return false; Missed this on the first read ... What if the response doesn't have any validator headers (neither Etag nor Last-Modified)? This happens frequently. In this case, I believe the code currently assumes the content hasn't changed, and I think we should continue making that assumption. Basically, to scope this change as narrowly as possible: - If the response has a strong etag, then combine only if the etag matches the buffered version - Otherwise, do the same thing as before this change
https://codereview.chromium.org/2338963002/diff/40001/media/blink/url_index.cc File media/blink/url_index.cc (right): https://codereview.chromium.org/2338963002/diff/40001/media/blink/url_index.c... media/blink/url_index.cc:238: return false; On 2016/09/16 19:30:21, Tom Bergan wrote: > Missed this on the first read ... What if the response doesn't have any > validator headers (neither Etag nor Last-Modified)? This happens frequently. In > this case, I believe the code currently assumes the content hasn't changed, and > I think we should continue making that assumption. > > Basically, to scope this change as narrowly as possible: > > - If the response has a strong etag, then combine only if the etag matches the > buffered version > - Otherwise, do the same thing as before this change That is exactly what this code does. (Unless I wrote it wrong somehow?)
lgtm Thanks for doing this! https://codereview.chromium.org/2338963002/diff/40001/media/blink/url_index.cc File media/blink/url_index.cc (right): https://codereview.chromium.org/2338963002/diff/40001/media/blink/url_index.c... media/blink/url_index.cc:238: return false; On 2016/09/16 19:33:41, hubbe wrote: > On 2016/09/16 19:30:21, Tom Bergan wrote: > > Missed this on the first read ... What if the response doesn't have any > > validator headers (neither Etag nor Last-Modified)? This happens frequently. > In > > this case, I believe the code currently assumes the content hasn't changed, > and > > I think we should continue making that assumption. > > > > Basically, to scope this change as narrowly as possible: > > > > - If the response has a strong etag, then combine only if the etag matches the > > buffered version > > - Otherwise, do the same thing as before this change > > That is exactly what this code does. > (Unless I wrote it wrong somehow?) It is, I misread the meaning of "false" in this context (for some reason I thought this should return "true" if the response had no validators). Sorry!
The CQ bit was unchecked by hubbe@chromium.org
The CQ bit was checked by hubbe@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== Store, use and send etags. We use them to validate/invalide cached but expired data. We send Match-If headers to prevent mixing of old/new cached data. This should all be safe to do, since the HTTP cache already sends etags to manage it's internal cached state, this CL just extends this behavior to apply to client-side in-memory cached data as well. BUG=504194 ========== to ========== Store, use and send etags. We use them to validate/invalide cached but expired data. We send Match-If headers to prevent mixing of old/new cached data. This should all be safe to do, since the HTTP cache already sends etags to manage it's internal cached state, this CL just extends this behavior to apply to client-side in-memory cached data as well. BUG=504194 Committed: https://crrev.com/fd30799f6f8a7d1366d97693b72b0b20be94d5c0 Cr-Commit-Position: refs/heads/master@{#419264} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/fd30799f6f8a7d1366d97693b72b0b20be94d5c0 Cr-Commit-Position: refs/heads/master@{#419264} |