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

Unified Diff: extensions/renderer/dispatcher.cc

Issue 2547753002: [Extensions] Extension Port Ids and Initialization 2.0 (Closed)
Patch Set: rkaplow Created 4 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 | « extensions/renderer/dispatcher.h ('k') | extensions/renderer/extension_frame_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/dispatcher.cc
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index 8e32524de77bc64e306fd4458f9885f656da4689..81fc54108fe039b2ed3721641eba0c2ab7e3b183 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -999,7 +999,7 @@ void Dispatcher::OnCancelSuspend(const std::string& extension_id) {
base::DictionaryValue());
}
-void Dispatcher::OnDeliverMessage(int target_port_id,
+void Dispatcher::OnDeliverMessage(const PortId& target_port_id,
const Message& message) {
MessagingBindings::DeliverMessage(*script_context_set_, target_port_id,
message,
@@ -1007,12 +1007,12 @@ void Dispatcher::OnDeliverMessage(int target_port_id,
}
void Dispatcher::OnDispatchOnConnect(
- int target_port_id,
+ const PortId& target_port_id,
const std::string& channel_name,
const ExtensionMsg_TabConnectionInfo& source,
const ExtensionMsg_ExternalConnectionInfo& info,
const std::string& tls_channel_id) {
- DCHECK_EQ(1, target_port_id % 2); // target renderer ports have odd IDs.
+ DCHECK(!target_port_id.is_opener);
MessagingBindings::DispatchOnConnect(*script_context_set_, target_port_id,
channel_name, source, info,
@@ -1020,7 +1020,7 @@ void Dispatcher::OnDispatchOnConnect(
NULL); // All render frames.
}
-void Dispatcher::OnDispatchOnDisconnect(int port_id,
+void Dispatcher::OnDispatchOnDisconnect(const PortId& port_id,
const std::string& error_message) {
MessagingBindings::DispatchOnDisconnect(*script_context_set_, port_id,
error_message,
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | extensions/renderer/extension_frame_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698