)]}' { "commit": "6199b09d49207616849f69d912e0d68005c3b28b", "tree": "a3560f179f08fbf2d0fa5151f64380e3a1afdf32", "parents": [ "d5937743706ee9c4f3e5d4fee6cebed8b614666b" ], "author": { "name": "Shivani Sharma", "email": "shivanisha@chromium.org", "time": "Sun Aug 11 23:18:34 2019" }, "committer": { "name": "Commit Bot", "email": "commit-bot@chromium.org", "time": "Sun Aug 11 23:18:34 2019" }, "message": "Httpcache transaction\u0027s mode to be set to WRITE before creating entry\n\nhttps://bugs.chromium.org/p/chromium/issues/detail?id\u003d986211#c49 describes the\ncode path that may lead to mode_ being set to NONE(do not use entry) and state\nbeing set to STATE_CREATE_ENTRY.\n\nWhile the intention of DoRestartPartialRequest() is to set the mode to WRITE before\nsetting the state to STATE_CREATE_ENTRY, ResetPartialState() ends up overwriting the\nmode_ to NONE via HttpCache::Writers::EraseTransaction. Both are doing the correct\nthing independently so changing the order of mode_ \u003d WRITE and calling\nResetPartialState() should fix the issue.\n\nThis leads to another dcheck to be hit which is that RecordHistograms should only\nbe invoked once. To fix that this CL also moves the calling site of RecordHistograms()\nto the destructor of HttpCache::Transaction which makes the invariant that RecordHistograms\nshould only be called once, easier to follow in the code.\n\nTEST: net_unittests --gtest_filter\u003d*RangeGET_OverlappingRangesCouldntConditionalize\nBug: 986211\nChange-Id: I176b6187dc69aa23de73d45263da104da622e0bf\nReviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1739410\nReviewed-by: Zhongyi Shi \u003czhongyi@chromium.org\u003e\nCommit-Queue: Shivani Sharma \u003cshivanisha@chromium.org\u003e\nCr-Commit-Position: refs/heads/master@{#685901}\n", "tree_diff": [ { "type": "modify", "old_id": "ada5de2e1d819aea6708ad0fa1d306aab04af307", "old_mode": 33188, "old_path": "net/http/http_cache_transaction.cc", "new_id": "d32f2519bd611083612ebb5dfdcc7c9d33ca1329", "new_mode": 33188, "new_path": "net/http/http_cache_transaction.cc" }, { "type": "modify", "old_id": "8d4f37b7cbabbee0c7699d22e480b8b2721bab17", "old_mode": 33188, "old_path": "net/http/http_cache_unittest.cc", "new_id": "22dc8705dcd71cc67f91daa91370d1b0b1c82f92", "new_mode": 33188, "new_path": "net/http/http_cache_unittest.cc" } ] }