commit | 6199b09d49207616849f69d912e0d68005c3b28b | [log] [tgz] |
---|---|---|
author | Shivani Sharma <shivanisha@chromium.org> | Sun Aug 11 23:18:34 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Sun Aug 11 23:18:34 2019 |
tree | a3560f179f08fbf2d0fa5151f64380e3a1afdf32 | |
parent | d5937743706ee9c4f3e5d4fee6cebed8b614666b [diff] |
Httpcache transaction's mode to be set to WRITE before creating entry https://bugs.chromium.org/p/chromium/issues/detail?id=986211#c49 describes the code path that may lead to mode_ being set to NONE(do not use entry) and state being set to STATE_CREATE_ENTRY. While the intention of DoRestartPartialRequest() is to set the mode to WRITE before setting the state to STATE_CREATE_ENTRY, ResetPartialState() ends up overwriting the mode_ to NONE via HttpCache::Writers::EraseTransaction. Both are doing the correct thing independently so changing the order of mode_ = WRITE and calling ResetPartialState() should fix the issue. This leads to another dcheck to be hit which is that RecordHistograms should only be invoked once. To fix that this CL also moves the calling site of RecordHistograms() to the destructor of HttpCache::Transaction which makes the invariant that RecordHistograms should only be called once, easier to follow in the code. TEST: net_unittests --gtest_filter=*RangeGET_OverlappingRangesCouldntConditionalize Bug: 986211 Change-Id: I176b6187dc69aa23de73d45263da104da622e0bf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1739410 Reviewed-by: Zhongyi Shi <zhongyi@chromium.org> Commit-Queue: Shivani Sharma <shivanisha@chromium.org> Cr-Commit-Position: refs/heads/master@{#685901}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .