Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / dom / MessageChannel.cpp
index 20a493d..2530e65 100644 (file)
@@ -35,17 +35,14 @@ namespace WebCore {
 
 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)