Index: mojo/examples/sample_app/sample_app.cc |
diff --git a/mojo/examples/sample_app/sample_app.cc b/mojo/examples/sample_app/sample_app.cc |
index 5bc67dc44bb9ee582f35a853f6a10dee5e86ff21..ba7f3f88173773916ef74c6b3c0f7e8ce73313c8 100644 |
--- a/mojo/examples/sample_app/sample_app.cc |
+++ b/mojo/examples/sample_app/sample_app.cc |
@@ -25,16 +25,17 @@ |
namespace mojo { |
namespace examples { |
-static HelloWorldClientImpl* g_client = 0; |
- |
void SayHello(mojo::Handle pipe) { |
- g_client = new HelloWorldClientImpl(pipe); |
- |
+ base::MessageLoop loop; |
darin (slow to review)
2013/11/15 00:01:37
it would be rational for BindingsSupportImpl to as
DaveMoore
2013/11/15 00:11:33
Done.
|
+ // Send message out. |
+ HelloWorldClientImpl client(pipe); |
mojo::ScratchBuffer buf; |
const std::string kGreeting("hello, world!"); |
mojo::String* greeting = mojo::String::NewCopyOf(&buf, kGreeting); |
+ client.service()->Greeting(greeting); |
- g_client->service()->Greeting(greeting); |
+ // Run loop to receieve Ack. The client will quit the loop. |
+ loop.Run(); |
} |
} // examples |
@@ -42,20 +43,13 @@ void SayHello(mojo::Handle pipe) { |
extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain( |
mojo::Handle pipe) { |
- // Create a message loop on this thread for processing incoming messages. |
- // This creates a dependency on base that we'll be removing soon. |
- base::MessageLoop loop; |
- |
+ printf("here!\n"); |
abarth-chromium
2013/11/14 23:59:05
We probably want to remove this before landing. :
DaveMoore
2013/11/15 00:11:33
Done.
|
// Set the global bindings support. |
mojo::common::BindingsSupportImpl bindings_support; |
mojo::BindingsSupport::Set(&bindings_support); |
- // Send message out. |
mojo::examples::SayHello(pipe); |
- // Run loop to receieve Ack. |
- loop.Run(); |
- |
mojo::BindingsSupport::Set(NULL); |
return MOJO_RESULT_OK; |
} |