| Index: third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp b/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
|
| index 93b148bd7cc51667a59ce76944fc8a854bcc0ca3..5754c09c822091a711f532aefdbd20e75cf45fda 100644
|
| --- a/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
|
| @@ -490,6 +490,7 @@ static bool AllowCreatingBackgroundTabs() {
|
|
|
| NavigationPolicy LocalFrameClientImpl::DecidePolicyForNavigation(
|
| const ResourceRequest& request,
|
| + Document* origin_document,
|
| DocumentLoader* loader,
|
| NavigationType type,
|
| NavigationPolicy policy,
|
| @@ -551,8 +552,14 @@ NavigationPolicy LocalFrameClientImpl::DecidePolicyForNavigation(
|
| if (form)
|
| navigation_info.form = WebFormElement(form);
|
|
|
| + // The frame has navigated either by itself or by the action of the
|
| + // |origin_document| when it is defined. |source_location| represents the
|
| + // line of code that has initiated the navigation. It is used to let web
|
| + // developpers locate the root cause of blocked navigations.
|
| std::unique_ptr<SourceLocation> source_location =
|
| - SourceLocation::Capture(web_frame_->GetFrame()->GetDocument());
|
| + origin_document
|
| + ? SourceLocation::Capture(origin_document)
|
| + : SourceLocation::Capture(web_frame_->GetFrame()->GetDocument());
|
| if (source_location && !source_location->IsUnknown()) {
|
| navigation_info.source_location.url = source_location->Url();
|
| navigation_info.source_location.line_number = source_location->LineNumber();
|
|
|