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

Unified Diff: services/js/js_app.cc

Issue 767323002: Mojo JS Bindings: restore the ServiceProvider class, add an application test (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Removed console import from ServiceProvider Created 6 years 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 | « services/js/BUILD.gn ('k') | services/js/js_app_bridge_module.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/js/js_app.cc
diff --git a/services/js/js_app.cc b/services/js/js_app.cc
index af17009d15c31cc0db3b01f9778770332db29f19..8b9690182905a5ae7ff6c12b88869298ea48ac3d 100644
--- a/services/js/js_app.cc
+++ b/services/js/js_app.cc
@@ -14,9 +14,9 @@
#include "mojo/edk/js/handle.h"
#include "mojo/edk/js/support.h"
#include "mojo/public/cpp/bindings/interface_request.h"
+#include "services/js/js_app_bridge_module.h"
#include "services/js/js_app_message_loop_observers.h"
#include "services/js/js_app_shell.h"
-#include "services/js/mojo_bridge_module.h"
namespace mojo {
namespace js {
@@ -89,6 +89,9 @@ JSApp::JSApp(ShellPtr shell, URLResponsePtr response) : shell_(shell.Pass()) {
std::string source;
CHECK(common::BlockingCopyToString(response->body.Pass(), &source));
+ runner_delegate_.AddBuiltinModule(AppBridge::kModuleName,
+ base::Bind(&AppBridge::GetModule, base::Unretained(this)));
+
shell_runner_.reset(new gin::ShellRunner(&runner_delegate_, isolate));
gin::Runner::Scope scope(shell_runner_.get());
shell_runner_->Run(source.c_str(), kMainModuleName);
@@ -165,7 +168,7 @@ void JSApp::AcceptConnection(const String& requestor_url,
v8::Isolate* isolate = isolate_holder_.isolate();
v8::Handle<v8::Value> argv[] = {
gin::ConvertToV8(isolate, requestor_url.To<std::string>()),
- gin::ConvertToV8(isolate, provider.PassMessagePipe().get()),
+ gin::ConvertToV8(isolate, provider.PassMessagePipe().release()),
};
CallAppInstanceMethod("acceptConnection", arraysize(argv), argv);
}
« no previous file with comments | « services/js/BUILD.gn ('k') | services/js/js_app_bridge_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698