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

Side by Side 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 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 "services/js/js_app_shell.h"
6
7 #include "gin/object_template_builder.h"
8 #include "services/js/js_app.h"
9
10 namespace mojo {
11 namespace js {
12
13 gin::WrapperInfo JSAppShell::kWrapperInfo = {gin::kEmbedderNativeGin};
14
15 gin::Handle<JSAppShell> JSAppShell::Create(v8::Isolate* isolate,
16 JSApp* js_app) {
17 return CreateHandle(isolate, new JSAppShell(js_app));
jamesr 2014/11/25 00:54:45 this seems to break the windows build: e:\b\build
18 }
19
20 JSAppShell::JSAppShell(JSApp* js_app) : js_app_(js_app) {
21 }
22
23 JSAppShell::~JSAppShell() {
24 }
25
26 gin::ObjectTemplateBuilder JSAppShell::GetObjectTemplateBuilder(
27 v8::Isolate* isolate) {
28 return gin::Wrappable<JSAppShell>::GetObjectTemplateBuilder(isolate)
29 .SetMethod("connectToApplication", &JSAppShell::ConnectToApplication);
30 }
31
32 void JSAppShell::ConnectToApplication(
33 const std::string& application_url, mojo::Handle service_provider) {
34 // TODO(hansmuller): Validate arguments.
35 // TODO(hansmuller): Service_provider may be a ServiceProviderProxy.
36 MessagePipeHandle message_pipe_handle(service_provider.value());
37 ScopedMessagePipeHandle scoped_handle(message_pipe_handle);
38 js_app_->ConnectToApplication(application_url, scoped_handle.Pass());
39 }
40
41 } // namespace js
42 } // namespace mojo
OLDNEW
« 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