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 "mojo/apps/js/application_delegate_impl.h" | 5 #include "mojo/apps/js/application_delegate_impl.h" |
6 | 6 |
7 #include "gin/array_buffer.h" | 7 #include "gin/array_buffer.h" |
8 #include "gin/public/isolate_holder.h" | 8 #include "gin/public/isolate_holder.h" |
9 #include "mojo/apps/js/js_app.h" | 9 #include "mojo/apps/js/js_app.h" |
10 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 namespace apps { | 13 namespace apps { |
14 | 14 |
15 ApplicationDelegateImpl::ApplicationDelegateImpl() | 15 ApplicationDelegateImpl::ApplicationDelegateImpl() |
16 : application_impl_(nullptr) { | 16 : application_impl_(nullptr) { |
17 } | 17 } |
18 | 18 |
19 void ApplicationDelegateImpl::Initialize(ApplicationImpl* app) { | 19 void ApplicationDelegateImpl::Initialize(ApplicationImpl* app) { |
20 application_impl_ = app; | 20 application_impl_ = app; |
21 | |
22 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | |
23 gin::IsolateHolder::LoadV8Snapshot(); | |
24 #endif | |
25 | |
rmcilroy
2014/10/07 16:16:11
nit - remove newline
baixo
2014/10/08 11:28:55
Done.
| |
21 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode, | 26 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode, |
22 gin::ArrayBufferAllocator::SharedInstance()); | 27 gin::ArrayBufferAllocator::SharedInstance()); |
23 } | 28 } |
24 | 29 |
25 ApplicationDelegateImpl::~ApplicationDelegateImpl() { | 30 ApplicationDelegateImpl::~ApplicationDelegateImpl() { |
26 } | 31 } |
27 | 32 |
28 void ApplicationDelegateImpl::StartJSApp(scoped_ptr<JSApp> app_ptr) { | 33 void ApplicationDelegateImpl::StartJSApp(scoped_ptr<JSApp> app_ptr) { |
29 JSApp *app = app_ptr.release(); | 34 JSApp *app = app_ptr.release(); |
30 app_vector_.push_back(app); | 35 app_vector_.push_back(app); |
(...skipping 14 matching lines...) Expand all Loading... | |
45 const std::string& interface_name) { | 50 const std::string& interface_name) { |
46 CHECK(application_impl_); | 51 CHECK(application_impl_); |
47 ServiceProvider* service_provider = | 52 ServiceProvider* service_provider = |
48 application_impl_->ConnectToApplication(application_url) | 53 application_impl_->ConnectToApplication(application_url) |
49 ->GetServiceProvider(); | 54 ->GetServiceProvider(); |
50 service_provider->ConnectToService(interface_name, pipe_handle.Pass()); | 55 service_provider->ConnectToService(interface_name, pipe_handle.Pass()); |
51 } | 56 } |
52 | 57 |
53 } // namespace apps | 58 } // namespace apps |
54 } // namespace mojo | 59 } // namespace mojo |
OLD | NEW |