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

Unified Diff: chrome/browser/renderer_host/chrome_extension_message_filter.cc

Issue 617053002: Fix crash in ChromeExtensionMessageFilter::OnPostMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_extension_message_filter.cc
diff --git a/chrome/browser/renderer_host/chrome_extension_message_filter.cc b/chrome/browser/renderer_host/chrome_extension_message_filter.cc
index 69f919c3e283504efa9616666a3b9c7aba0e09d4..c0ab760f8c3cf4966e539df5f37ee8c3c5e7efb6 100644
--- a/chrome/browser/renderer_host/chrome_extension_message_filter.cc
+++ b/chrome/browser/renderer_host/chrome_extension_message_filter.cc
@@ -229,6 +229,9 @@ void ChromeExtensionMessageFilter::OpenChannelToTabOnUIThread(
void ChromeExtensionMessageFilter::OnPostMessage(
int port_id,
const extensions::Message& message) {
+ if (!profile_)
+ return;
+
extensions::MessageService::Get(profile_)->PostMessage(port_id, message);
}
@@ -269,6 +272,9 @@ void ChromeExtensionMessageFilter::OnGetExtMessageBundleOnBlockingPool(
void ChromeExtensionMessageFilter::OnExtensionCloseChannel(
int port_id,
const std::string& error_message) {
+ if (!profile_)
+ return;
+
if (!content::RenderProcessHost::FromID(render_process_id_))
return; // To guard against crash in browser_tests shutdown.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698