| Index: extensions/browser/extension_function.cc
|
| diff --git a/extensions/browser/extension_function.cc b/extensions/browser/extension_function.cc
|
| index 98ef88f9ca8cd02a8c68a04814ca032b73a84721..b5a58e947cad2555e4c2b8cdc1f9cb34eb852999 100644
|
| --- a/extensions/browser/extension_function.cc
|
| +++ b/extensions/browser/extension_function.cc
|
| @@ -425,8 +425,8 @@ void ExtensionFunction::OnRespondingLater(ResponseValue value) {
|
| UIThreadExtensionFunction::UIThreadExtensionFunction()
|
| : context_(nullptr),
|
| render_frame_host_(nullptr),
|
| - delegate_(nullptr) {
|
| -}
|
| + is_from_service_worker_(false),
|
| + delegate_(nullptr) {}
|
|
|
| UIThreadExtensionFunction::~UIThreadExtensionFunction() {
|
| if (dispatcher() && render_frame_host())
|
| @@ -454,8 +454,11 @@ UIThreadExtensionFunction::render_view_host_do_not_use() const {
|
| void UIThreadExtensionFunction::SetRenderFrameHost(
|
| content::RenderFrameHost* render_frame_host) {
|
| // An extension function from Service Worker does not have a RenderFrameHost.
|
| - if (!render_frame_host)
|
| + if (is_from_service_worker_) {
|
| + DCHECK(!render_frame_host);
|
| return;
|
| + }
|
| +
|
| DCHECK_NE(render_frame_host_ == nullptr, render_frame_host == nullptr);
|
| render_frame_host_ = render_frame_host;
|
| tracker_.reset(
|
|
|