static void createChannel(MessagePort* port1, MessagePort* port2)
{
- // Create proxies for each endpoint.
- OwnPtr<blink::WebMessagePortChannel> channel1 = adoptPtr(blink::Platform::current()->createMessagePortChannel());
- OwnPtr<blink::WebMessagePortChannel> channel2 = adoptPtr(blink::Platform::current()->createMessagePortChannel());
-
- // Entangle the two endpoints.
- channel1->entangle(channel2.get());
- channel2->entangle(channel1.get());
+ blink::WebMessagePortChannel* channel1;
+ blink::WebMessagePortChannel* channel2;
+ blink::Platform::current()->createMessageChannel(&channel1, &channel2);
+ ASSERT(channel1 && channel2);
// Now entangle the proxies with the appropriate local ports.
- port1->entangle(channel2.release());
- port2->entangle(channel1.release());
+ port1->entangle(adoptPtr(channel2));
+ port2->entangle(adoptPtr(channel1));
}
MessageChannel::MessageChannel(ExecutionContext* context)