summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 19:49:49 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 19:49:49 +0000
commit4007d671b58184dc4f59829e1119a69c9dfed132 (patch)
tree680bbabbab02c932442a94aefc5d06b44c28ff04
parent80cdd3112da7ef937f57d06cda2b752890a6355d (diff)
downloadchromium_src-4007d671b58184dc4f59829e1119a69c9dfed132.zip
chromium_src-4007d671b58184dc4f59829e1119a69c9dfed132.tar.gz
chromium_src-4007d671b58184dc4f59829e1119a69c9dfed132.tar.bz2
Add some paranoid CHECKs to the ExtensionMessageService to track down a crash.
BUG=19067 TEST=no Review URL: http://codereview.chromium.org/165431 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23345 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_message_service.cc11
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,