Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1430)

Unified Diff: mojo/apps/js/main.cc

Issue 90203002: [Mojo] Remove static "bootstrap" state in mojo_js (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CHECK, CHECK, CHECK Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/apps/js/bootstrap.cc ('k') | mojo/apps/js/main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/apps/js/main.cc
diff --git a/mojo/apps/js/main.cc b/mojo/apps/js/main.cc
index 5a6842a3da3a61fbf669e80f59bb322d78ef2f44..12ec34e8af43428b5cf2e556615df4df9ba07ce0 100644
--- a/mojo/apps/js/main.cc
+++ b/mojo/apps/js/main.cc
@@ -4,7 +4,6 @@
#include "base/message_loop/message_loop.h"
#include "gin/public/isolate_holder.h"
-#include "mojo/apps/js/bootstrap.h"
#include "mojo/apps/js/mojo_runner_delegate.h"
#include "mojo/common/bindings_support_impl.h"
#include "mojo/public/system/core_cpp.h"
@@ -23,18 +22,13 @@
namespace mojo {
namespace apps {
-void RunMojoJS(MojoHandle pipe) {
- gin::IsolateHolder instance;
- Bootstrap::SetInitialHandle(pipe);
+void Start(MojoHandle pipe, const std::string& module) {
+ base::MessageLoop loop;
+ gin::IsolateHolder instance;
MojoRunnerDelegate delegate;
gin::Runner runner(&delegate, instance.isolate());
-
- {
- gin::Runner::Scope scope(&runner);
- runner.Run("define(['mojo/apps/js/main'], function(main) {});",
- "mojo.js");
- }
+ delegate.Start(&runner, pipe, module);
base::MessageLoop::current()->Run();
}
@@ -43,10 +37,11 @@ void RunMojoJS(MojoHandle pipe) {
} // namespace mojo
extern "C" MOJO_APPS_JS_EXPORT MojoResult CDECL MojoMain(MojoHandle pipe) {
- base::MessageLoop loop;
mojo::common::BindingsSupportImpl bindings_support;
mojo::BindingsSupport::Set(&bindings_support);
- mojo::apps::RunMojoJS(pipe);
+
+ mojo::apps::Start(pipe, "mojo/apps/js/main");
+
mojo::BindingsSupport::Set(NULL);
return MOJO_RESULT_OK;
}
« no previous file with comments | « mojo/apps/js/bootstrap.cc ('k') | mojo/apps/js/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698