| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 define([ | 5 define([ |
| 6 "console", | 6 "console", |
| 7 "mojo/apps/js/threading", | 7 "mojo/apps/js/bindings/connector", |
| 8 "mojo/public/bindings/js/connector", | 8 "mojo/apps/js/bindings/threading", |
| 9 "mojom/hello_world_service", | 9 "mojom/hello_world_service", |
| 10 ], function(console, threading, connector, hello) { | 10 ], function(console, connector, threading, hello) { |
| 11 | 11 |
| 12 function HelloWorldClientImpl() { | 12 function HelloWorldClientImpl() { |
| 13 } | 13 } |
| 14 | 14 |
| 15 HelloWorldClientImpl.prototype = | 15 HelloWorldClientImpl.prototype = |
| 16 Object.create(hello.HelloWorldClientStub.prototype); | 16 Object.create(hello.HelloWorldClientStub.prototype); |
| 17 | 17 |
| 18 HelloWorldClientImpl.prototype.didReceiveGreeting = function(result) { | 18 HelloWorldClientImpl.prototype.didReceiveGreeting = function(result) { |
| 19 console.log("DidReceiveGreeting from pipe: " + result); | 19 console.log("DidReceiveGreeting from pipe: " + result); |
| 20 connection.close(); | 20 connection.close(); |
| 21 threading.quit(); | 21 threading.quit(); |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 var connection = null; | 24 var connection = null; |
| 25 | 25 |
| 26 return function(handle) { | 26 return function(handle) { |
| 27 connection = new connector.Connection(handle, | 27 connection = new connector.Connection(handle, |
| 28 HelloWorldClientImpl, | 28 HelloWorldClientImpl, |
| 29 hello.HelloWorldServiceProxy); | 29 hello.HelloWorldServiceProxy); |
| 30 | 30 |
| 31 connection.remote.greeting("hello, world!"); | 31 connection.remote.greeting("hello, world!"); |
| 32 }; | 32 }; |
| 33 }); | 33 }); |
| OLD | NEW |