Remove usage of GetProvisionalDocumentLoader in UserAgentOverride

Currently, there is a single case where we actually reach for
provisional document loader in UserAgentOverride, but it seems wrong
since it accesses loader for the new Document, while trying to save
user agent for the old Document being detached. The stack trace would be:
  content::RenderFrameImpl::UserAgentOverride()
  content::RenderFrameImpl::UserAgentOverride()
  blink::LocalFrameClientImpl::UserAgent()
  blink::FrameLoader::UserAgent()
  blink::FrameFetchContext::GetUserAgent()
  blink::FrameFetchContext::Detach()
  blink::ResourceFetcher::ClearContext()
  blink::Document::Shutdown()
  blink::FrameLoader::PrepareForCommit()
  blink::FrameLoader::CommitProvisionalLoad()
  blink::DocumentLoader::CommitNavigation()
  blink::DocumentLoader::StartLoadingInternal()
  blink::DocumentLoader::StartLoading()
  blink::FrameLoader::CommitNavigation()
  blink::WebLocalFrameImpl::CommitNavigation()
  content::RenderFrameImpl::CommitNavigationWithParams()

In every other case, we should not have provisional document loader,
since we commit load synchronously, and loader is in a provisional
state for a short amount of time (only inside CommitNavigation).

Bug: 855189
Change-Id: I4cbe2b30fbd2b3eee5f606e24681875898d0ffb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1589247
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657015}
1 file changed