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

Unified Diff: extensions/renderer/extension_frame_helper.cc

Issue 2331263002: [Extensions] Finish making port creation asynchronous (Closed)
Patch Set: lazyboy's Created 4 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 | « extensions/renderer/extension_frame_helper.h ('k') | extensions/renderer/messaging_bindings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/extension_frame_helper.cc
diff --git a/extensions/renderer/extension_frame_helper.cc b/extensions/renderer/extension_frame_helper.cc
index 01ee2314dfbf82c8384229ae3f35ec6836c3b7b0..f590b01ccc4f54dc172f2b2076863bba01e1fc19 100644
--- a/extensions/renderer/extension_frame_helper.cc
+++ b/extensions/renderer/extension_frame_helper.cc
@@ -190,6 +190,34 @@ void ExtensionFrameHelper::RequestPortId(
}
}
+void ExtensionFrameHelper::RequestTabPortId(
+ const ExtensionMsg_TabTargetConnectionInfo& info,
+ const std::string& extension_id,
+ const std::string& channel_name,
+ const base::Callback<void(int)>& callback) {
+ int port_request_id = next_port_request_id_++;
+ pending_port_requests_[port_request_id] = callback;
+ {
+ SCOPED_UMA_HISTOGRAM_TIMER("Extensions.Messaging.GetPortIdSyncTime.Tab");
+ render_frame()->Send(new ExtensionHostMsg_OpenChannelToTab(
+ render_frame()->GetRoutingID(), info, extension_id, channel_name,
+ port_request_id));
+ }
+}
+
+void ExtensionFrameHelper::RequestNativeAppPortId(
+ const std::string& native_app_name,
+ const base::Callback<void(int)>& callback) {
+ int port_request_id = next_port_request_id_++;
+ pending_port_requests_[port_request_id] = callback;
+ {
+ SCOPED_UMA_HISTOGRAM_TIMER(
+ "Extensions.Messaging.GetPortIdSyncTime.NativeApp");
+ render_frame()->Send(new ExtensionHostMsg_OpenChannelToNativeApp(
+ render_frame()->GetRoutingID(), native_app_name, port_request_id));
+ }
+}
+
void ExtensionFrameHelper::DidMatchCSS(
const blink::WebVector<blink::WebString>& newly_matching_selectors,
const blink::WebVector<blink::WebString>& stopped_matching_selectors) {
« no previous file with comments | « extensions/renderer/extension_frame_helper.h ('k') | extensions/renderer/messaging_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698