Commit b1ba4234 authored by Tsuyoshi Horo's avatar Tsuyoshi Horo Committed by Commit Bot

Initialize FrameResourceFetcherProperties::web_bundle_physical_url_ in ctor

When HtmlImportsRequestInitiatorLock is disabled, FrameLoader::document_loader_
is cleared by FrameLoader::DetachDocument() before FrameLoader::DetachDocument()
calls Document::Shutdown()
 -> HTMLImportsController::Dispose()
  -> HTMLImportLoader::Dispose()
   -> Document::ClearImportsController()
    -> ResourceFetcher::ClearContext()
     -> DetachableResourceFetcherProperties::Detach()
      -> FrameResourceFetcherProperties::WebBundlePhysicalUrl()
       -> FrameOrImportedDocument::GetMasterDocumentLoader()
        -> FrameLoader::GetDocumentLoader()
So frame_or_imported_document_->GetMasterDocumentLoader() returns invalid
reference of DocumentLoader.

This is causing crashes from Dec 20 when HtmlImportsRequestInitiatorLock was
disabled in M80 using Field Trial Testing Configuration.

To avoid this crash, this cl change FrameResourceFetcherProperties not to
call ResourceFetcherProperties::WebBundlePhysicalUrl() from
DetachableResourceFetcherProperties::Detach().

Bug: 1036049
Change-Id: If6a947ebec0dbbea0e39d5eb979eed8c8d39f018
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1978340Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728756}
parent 11e34763
......@@ -24,7 +24,10 @@ FrameResourceFetcherProperties::FrameResourceFetcherProperties(
: frame_or_imported_document_(frame_or_imported_document),
fetch_client_settings_object_(
MakeGarbageCollected<FetchClientSettingsObjectImpl>(
frame_or_imported_document.GetDocument())) {}
frame_or_imported_document.GetDocument())),
web_bundle_physical_url_(
frame_or_imported_document_->GetMasterDocumentLoader()
.WebBundlePhysicalUrl()) {}
void FrameResourceFetcherProperties::Trace(Visitor* visitor) {
visitor->Trace(frame_or_imported_document_);
......@@ -107,8 +110,7 @@ scheduler::FrameStatus FrameResourceFetcherProperties::GetFrameStatus() const {
}
const KURL& FrameResourceFetcherProperties::WebBundlePhysicalUrl() const {
return frame_or_imported_document_->GetMasterDocumentLoader()
.WebBundlePhysicalUrl();
return web_bundle_physical_url_;
}
} // namespace blink
......@@ -8,6 +8,7 @@
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher_properties.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
namespace blink {
......@@ -46,6 +47,7 @@ class CORE_EXPORT FrameResourceFetcherProperties final
private:
const Member<FrameOrImportedDocument> frame_or_imported_document_;
Member<const FetchClientSettingsObject> fetch_client_settings_object_;
const KURL web_bundle_physical_url_;
};
} // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment