Race in Cronet initialization enables HTTP cache when it shouldn't be enabled |
|||
Issue descriptionThere's a race between creation of the CronetURLRequestAdapter and initialization of the CronetURLRequestContextAdapter on the network thread that causes cache to be enabled when it shouldn't be if a UrlRequest is created immediately after building the CronetEngine.
,
Jul 17 2017
,
Jul 17 2017
Yikes CronetURLRequestAdapter() reads from CronetURLRequestContextAdapter::default_load_flags_...which isn't initialized until CronetURLRequestContextAdapter::InitializeOnNetworkThread()
,
Jul 17 2017
Yup, that's what I found. If not for this bug, testHostCachePersistence would have failed every time instead of about 1% of the time. I'm fixing it now.
,
Jul 17 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5b7eb518eef51dfbc0fbc05330dfba8994863f92 commit 5b7eb518eef51dfbc0fbc05330dfba8994863f92 Author: Miriam Gershenson <mgersh@chromium.org> Date: Mon Jul 17 20:34:04 2017 Fix Cronet load flag initialization Load flags were being read from the CronetURLRequestContextAdapter on the main thread, which could potentially happen before they were initialized on the network thread if a UrlRequest is created immediately after the CronetEngine. Now they are read at request start time on the network thread, which must be after context initialization. BUG= 743232 Change-Id: I3f9c5cd1cde906555c5ba68b4a45a9a3ee71b014 Reviewed-on: https://chromium-review.googlesource.com/574827 Reviewed-by: Paul Jensen <pauljensen@chromium.org> Commit-Queue: Miriam Gershenson <mgersh@chromium.org> Cr-Commit-Position: refs/heads/master@{#487227} [modify] https://crrev.com/5b7eb518eef51dfbc0fbc05330dfba8994863f92/components/cronet/android/cronet_url_request_adapter.cc [modify] https://crrev.com/5b7eb518eef51dfbc0fbc05330dfba8994863f92/components/cronet/android/cronet_url_request_context_adapter.cc [modify] https://crrev.com/5b7eb518eef51dfbc0fbc05330dfba8994863f92/components/cronet/android/cronet_url_request_context_adapter.h [modify] https://crrev.com/5b7eb518eef51dfbc0fbc05330dfba8994863f92/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
,
Jul 17 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by mge...@chromium.org
, Jul 14 2017