OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "services/js/js_app_shell.h" | 5 #include "services/js/js_app_shell.h" |
6 | 6 |
7 #include "gin/object_template_builder.h" | 7 #include "gin/object_template_builder.h" |
8 #include "services/js/js_app.h" | 8 #include "services/js/js_app.h" |
9 | 9 |
10 namespace mojo { | 10 namespace mojo { |
11 namespace js { | 11 namespace js { |
12 | 12 |
13 gin::WrapperInfo JSAppShell::kWrapperInfo = {gin::kEmbedderNativeGin}; | 13 gin::WrapperInfo JSAppShell::kWrapperInfo = {gin::kEmbedderNativeGin}; |
14 | 14 |
15 gin::Handle<JSAppShell> JSAppShell::Create(v8::Isolate* isolate, | 15 gin::Handle<JSAppShell> JSAppShell::Create(v8::Isolate* isolate, |
16 JSApp* js_app) { | 16 JSApp* js_app) { |
17 return CreateHandle(isolate, new JSAppShell(js_app)); | 17 return gin::CreateHandle(isolate, new JSAppShell(js_app)); |
jamesr
2014/11/25 18:27:55
do you have any idea how this compiled before? 'i
jamesr
2014/11/25 18:29:19
Actually, JSAppShell inherits from gin::Wrappable<
| |
18 } | 18 } |
19 | 19 |
20 JSAppShell::JSAppShell(JSApp* js_app) : js_app_(js_app) { | 20 JSAppShell::JSAppShell(JSApp* js_app) : js_app_(js_app) { |
21 } | 21 } |
22 | 22 |
23 JSAppShell::~JSAppShell() { | 23 JSAppShell::~JSAppShell() { |
24 } | 24 } |
25 | 25 |
26 gin::ObjectTemplateBuilder JSAppShell::GetObjectTemplateBuilder( | 26 gin::ObjectTemplateBuilder JSAppShell::GetObjectTemplateBuilder( |
27 v8::Isolate* isolate) { | 27 v8::Isolate* isolate) { |
28 return gin::Wrappable<JSAppShell>::GetObjectTemplateBuilder(isolate) | 28 return gin::Wrappable<JSAppShell>::GetObjectTemplateBuilder(isolate) |
29 .SetMethod("connectToApplication", &JSAppShell::ConnectToApplication); | 29 .SetMethod("connectToApplication", &JSAppShell::ConnectToApplication); |
30 } | 30 } |
31 | 31 |
32 void JSAppShell::ConnectToApplication( | 32 void JSAppShell::ConnectToApplication( |
33 const std::string& application_url, mojo::Handle service_provider) { | 33 const std::string& application_url, mojo::Handle service_provider) { |
34 // TODO(hansmuller): Validate arguments. | 34 // TODO(hansmuller): Validate arguments. |
35 // TODO(hansmuller): Service_provider may be a ServiceProviderProxy. | 35 // TODO(hansmuller): Service_provider may be a ServiceProviderProxy. |
36 MessagePipeHandle message_pipe_handle(service_provider.value()); | 36 MessagePipeHandle message_pipe_handle(service_provider.value()); |
37 ScopedMessagePipeHandle scoped_handle(message_pipe_handle); | 37 ScopedMessagePipeHandle scoped_handle(message_pipe_handle); |
38 js_app_->ConnectToApplication(application_url, scoped_handle.Pass()); | 38 js_app_->ConnectToApplication(application_url, scoped_handle.Pass()); |
39 } | 39 } |
40 | 40 |
41 } // namespace js | 41 } // namespace js |
42 } // namespace mojo | 42 } // namespace mojo |
OLD | NEW |