Replace FetchContext::Bind with Init

FetchContext::Bind and FetchContext::Unbind were introduced to make
splitting FetchContext smoother, but their semantics were complex and
somewhat conflicting with FetchContext::Detach. Also, we want use
GetFetchResourceProperties() in FetchContext after detached, which
is not possible with the current implementation because |fetcher_|
is cleared when Unbind is called.

This CL introduces Init and removes Bind and Unbind. Now
ResourceFetcherProperties, not ResourceFetcher, is stored in
FetchContext. As ResourceFetcherProperties is safe to be
accessed after detached, we don't clear
the ResourceFetcherProperties when detached. Also,
FetchContext::IsDetached is removed as we can use
GetFetchResourceProperties().IsDetached now.

Bug: 914739
Change-Id: Ia1a41c0d7f8d8a47288868b5165a3ee08c106de9
Reviewed-on: https://chromium-review.googlesource.com/c/1424103
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#627268}
7 files changed