This source file includes following definitions.
- Start
- MojoMain
#include "base/message_loop/message_loop.h"
#include "gin/public/isolate_holder.h"
#include "mojo/apps/js/mojo_runner_delegate.h"
#include "mojo/public/cpp/gles2/gles2.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/public/cpp/system/macros.h"
#if defined(WIN32)
#if !defined(CDECL)
#define CDECL __cdecl
#endif
#define MOJO_APPS_JS_EXPORT __declspec(dllexport)
#else
#define CDECL
#define MOJO_APPS_JS_EXPORT __attribute__((visibility("default")))
#endif
namespace mojo {
namespace apps {
void Start(MojoHandle pipe, const std::string& module) {
base::MessageLoop loop;
gin::IsolateHolder instance;
MojoRunnerDelegate delegate;
gin::ShellRunner runner(&delegate, instance.isolate());
delegate.Start(&runner, pipe, module);
base::MessageLoop::current()->Run();
}
}
}
extern "C" MOJO_APPS_JS_EXPORT MojoResult CDECL MojoMain(MojoHandle pipe) {
mojo::GLES2Initializer gles2;
mojo::apps::Start(pipe, "mojo/apps/js/main");
return MOJO_RESULT_OK;
}