Commit 91928576 authored by Karan Bhatia's avatar Karan Bhatia Committed by Commit Bot

NetworkService: Fix undefined behavior in RegisterNonNetworkSubresourceURLLoaderFactories.

In ChromeContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories,
it's possible that no ExtensionWebContentsObserver is attached to the
WebContents for the given RenderFrameHost. Return early in that case.

BUG=818875

Change-Id: Ifca9cc67d36fe5aee0da496952125ef8ee199849
Reviewed-on: https://chromium-review.googlesource.com/950134Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541014}
parent 3ddb6c86
...@@ -3813,6 +3813,11 @@ void ChromeContentBrowserClient:: ...@@ -3813,6 +3813,11 @@ void ChromeContentBrowserClient::
extensions::ChromeExtensionWebContentsObserver::FromWebContents( extensions::ChromeExtensionWebContentsObserver::FromWebContents(
web_contents); web_contents);
// There is nothing to do if no ChromeExtensionWebContentsObserver is attached
// to the |web_contents|.
if (!web_observer)
return;
const Extension* extension = const Extension* extension =
web_observer->GetExtensionFromFrame(frame_host, false); web_observer->GetExtensionFromFrame(frame_host, false);
if (!extension) if (!extension)
......
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