diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/extensions/extension_message_service.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc index d0717c1..a4b1fd6d 100644 --- a/chrome/browser/extensions/extension_message_service.cc +++ b/chrome/browser/extensions/extension_message_service.cc @@ -61,6 +61,7 @@ static void DispatchOnConnect(const ExtensionMessageService::MessagePort& port, args.Set(1, Value::CreateStringValue(channel_name)); args.Set(2, Value::CreateStringValue(tab_json)); args.Set(3, Value::CreateStringValue(extension_id)); + CHECK(port.sender); port.sender->Send(new ViewMsg_ExtensionMessageInvoke( port.routing_id, ExtensionMessageService::kDispatchOnConnect, args)); } @@ -263,12 +264,20 @@ bool ExtensionMessageService::OpenChannelOnUIThreadImpl( return false; } + // Add extra paranoid CHECKs, since we have crash reports of this being NULL. + // http://code.google.com/p/chromium/issues/detail?id=19067 + CHECK(receiver.sender); + linked_ptr<MessageChannel> channel(new MessageChannel); channel->opener = MessagePort(source, MSG_ROUTING_CONTROL); channel->receiver = receiver; + CHECK(receiver.sender); + channels_[GET_CHANNEL_ID(receiver_port_id)] = channel; + CHECK(receiver.sender); + // Include info about the opener's tab (if it was a tab). std::string tab_json = "null"; TabContents* contents = tab_util::GetTabContentsByID(source_process_id, @@ -278,6 +287,8 @@ bool ExtensionMessageService::OpenChannelOnUIThreadImpl( JSONWriter::Write(tab_value, false, &tab_json); } + CHECK(receiver.sender); + // Send the connect event to the receiver. Give it the opener's port ID (the // opener has the opposite port ID). DispatchOnConnect(receiver, receiver_port_id, channel_name, tab_json, |