1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "mojo/public/cpp/application/application.h" 6 #include "mojo/public/cpp/environment/environment.h" 7 #include "mojo/public/cpp/utility/run_loop.h" 8 MojoMain(MojoHandle service_provider_handle)9extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain( 10 MojoHandle service_provider_handle) { 11 mojo::Environment env; 12 mojo::RunLoop loop; 13 14 mojo::Application* app = mojo::Application::Create(); 15 app->BindServiceProvider( 16 mojo::MakeScopedHandle(mojo::MessagePipeHandle(service_provider_handle))); 17 app->Initialize(); 18 loop.Run(); 19 delete app; 20 21 return MOJO_RESULT_OK; 22 } 23