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

Unified Diff: content/child/webmessageportchannel_impl.cc

Issue 230183002: Remove unnecessary Platform::createMessagePortChannel method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « content/child/webmessageportchannel_impl.h ('k') | content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webmessageportchannel_impl.cc
diff --git a/content/child/webmessageportchannel_impl.cc b/content/child/webmessageportchannel_impl.cc
index 17b7b16f30802421874f56db24ecf1c901921241..e0fe1264ee761a65bfd1dc837f4c5720194c516c 100644
--- a/content/child/webmessageportchannel_impl.cc
+++ b/content/child/webmessageportchannel_impl.cc
@@ -60,6 +60,23 @@ WebMessagePortChannelImpl::~WebMessagePortChannelImpl() {
}
// static
+void WebMessagePortChannelImpl::CreatePair(
+ base::MessageLoopProxy* child_thread_loop,
+ blink::WebMessagePortChannel** channel1,
+ blink::WebMessagePortChannel** channel2) {
+ WebMessagePortChannelImpl* impl1 =
+ new WebMessagePortChannelImpl(child_thread_loop);
+ WebMessagePortChannelImpl* impl2 =
+ new WebMessagePortChannelImpl(child_thread_loop);
+
+ impl1->Entangle(impl2);
+ impl2->Entangle(impl1);
+
+ *channel1 = impl1;
+ *channel2 = impl2;
+}
+
+// static
std::vector<int> WebMessagePortChannelImpl::ExtractMessagePortIDs(
WebMessagePortChannelArray* channels) {
std::vector<int> message_port_ids;
@@ -93,12 +110,7 @@ void WebMessagePortChannelImpl::destroy() {
}
void WebMessagePortChannelImpl::entangle(WebMessagePortChannel* channel) {
- // The message port ids might not be set up yet, if this channel wasn't
- // created on the main thread. So need to wait until we're on the main thread
- // before getting the other message port id.
- scoped_refptr<WebMessagePortChannelImpl> webchannel(
- static_cast<WebMessagePortChannelImpl*>(channel));
- Entangle(webchannel);
+ NOTREACHED(); // DEPRECATED
}
void WebMessagePortChannelImpl::postMessage(
@@ -160,6 +172,9 @@ void WebMessagePortChannelImpl::Init() {
void WebMessagePortChannelImpl::Entangle(
scoped_refptr<WebMessagePortChannelImpl> channel) {
+ // The message port ids might not be set up yet, if this channel wasn't
+ // created on the main thread. So need to wait until we're on the main thread
+ // before getting the other message port id.
if (!child_thread_loop_->BelongsToCurrentThread()) {
child_thread_loop_->PostTask(
FROM_HERE,
« no previous file with comments | « content/child/webmessageportchannel_impl.h ('k') | content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698