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

Unified Diff: services/js/js_app_shell.cc

Issue 757703002: Creates a JavaScript Applicaiton (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Changes per review feedback Created 6 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 | « services/js/js_app_shell.h ('k') | services/js/mojo_bridge_module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/js/js_app_shell.cc
diff --git a/services/js/js_app_shell.cc b/services/js/js_app_shell.cc
new file mode 100644
index 0000000000000000000000000000000000000000..448ba3d62c0b0014b41e925a4a3ac9b0d694ae08
--- /dev/null
+++ b/services/js/js_app_shell.cc
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "services/js/js_app_shell.h"
+
+#include "gin/object_template_builder.h"
+#include "services/js/js_app.h"
+
+namespace mojo {
+namespace js {
+
+gin::WrapperInfo JSAppShell::kWrapperInfo = {gin::kEmbedderNativeGin};
+
+gin::Handle<JSAppShell> JSAppShell::Create(v8::Isolate* isolate,
+ JSApp* js_app) {
+ return CreateHandle(isolate, new JSAppShell(js_app));
jamesr 2014/11/25 00:54:45 this seems to break the windows build: e:\b\build
+}
+
+JSAppShell::JSAppShell(JSApp* js_app) : js_app_(js_app) {
+}
+
+JSAppShell::~JSAppShell() {
+}
+
+gin::ObjectTemplateBuilder JSAppShell::GetObjectTemplateBuilder(
+ v8::Isolate* isolate) {
+ return gin::Wrappable<JSAppShell>::GetObjectTemplateBuilder(isolate)
+ .SetMethod("connectToApplication", &JSAppShell::ConnectToApplication);
+}
+
+void JSAppShell::ConnectToApplication(
+ const std::string& application_url, mojo::Handle service_provider) {
+ // TODO(hansmuller): Validate arguments.
+ // TODO(hansmuller): Service_provider may be a ServiceProviderProxy.
+ MessagePipeHandle message_pipe_handle(service_provider.value());
+ ScopedMessagePipeHandle scoped_handle(message_pipe_handle);
+ js_app_->ConnectToApplication(application_url, scoped_handle.Pass());
+}
+
+} // namespace js
+} // namespace mojo
« no previous file with comments | « services/js/js_app_shell.h ('k') | services/js/mojo_bridge_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698