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

Unified Diff: chrome/browser/extensions/api/messaging/message_service.cc

Issue 791343003: Fix Native Messaging to handle missing caller RenderWidgetHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/extensions/api/messaging/message_service.cc
diff --git a/chrome/browser/extensions/api/messaging/message_service.cc b/chrome/browser/extensions/api/messaging/message_service.cc
index d52997437acc70f5e2c69d466309f7ee3d59bd95..74142f4f723084a88c2c9a6c845dc4638e7efcf4 100644
--- a/chrome/browser/extensions/api/messaging/message_service.cc
+++ b/chrome/browser/extensions/api/messaging/message_service.cc
@@ -403,9 +403,11 @@ void MessageService::OpenChannelToNativeApp(
source_extension_id));
// Get handle of the native view and pass it to the native messaging host.
+ content::RenderWidgetHost* render_widget_host =
+ content::RenderWidgetHost::FromID(source_process_id, source_routing_id);
gfx::NativeView native_view =
- content::RenderWidgetHost::FromID(source_process_id, source_routing_id)->
- GetView()->GetNativeView();
+ render_widget_host ? render_widget_host->GetView()->GetNativeView()
+ : NULL;
not at google - send to devlin 2014/12/11 17:24:42 Are we supposed to use nullptr these days? I'm los
Sergey Ulanov 2014/12/11 19:25:29 Yes, it should be nullptr. This is my first change
not at google - send to devlin 2014/12/11 20:19:46 Where is native_view used then?
std::string error = kReceivingEndDoesntExistError;
scoped_ptr<NativeMessageHost> native_host = NativeMessageHost::Create(
« 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