Description[Cronet] Make sure to only pass the application Context to InitApplicationContext to avoid DCHECK failures.
An application may have multiple Contexts but only one application Context. InitApplicationContext DCHECKs if passed more than one Context, so make sure to always pass it only the application Context.
Also, clean up other uses of Contexts in Cronet to only use the application Context when necessary. Unnecessarily using the application Context was hiding the bug this CL fixes. I'm renaming variables to make it clear where an application context is needed versus where any Context is okay. It's good practice to use the Context explicitly passed in as the wrapping it provides may add additional functionality on top of wrapped Contexts and the application Context.
Also, add a test that Cronet can be simultaneously instantiated upon a Context, a wrapped version of the Context and the application Context to verify Cronet doesn't DCHECK.
BUG=453845
Committed: https://crrev.com/6c10657ea6fc4bfe370e61fde5d0405aa22b0e81
Cr-Commit-Position: refs/heads/master@{#319622}
Patch Set 1 : #
Total comments: 13
Patch Set 2 : add ChromiumUrlRequestContext test too #Messages
Total messages: 19 (4 generated)
|