Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: extensions/browser/extension_function.cc

Issue 2034543002: Clear UIThreadExtensionFunction::render_frame_host_ when RFH is gone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/extension_function.h ('k') | extensions/browser/extension_function_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « extensions/browser/extension_function.h ('k') | extensions/browser/extension_function_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698