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

Side by Side Diff: mojo/apps/js/application_delegate_impl.cc

Issue 627563002: Mojo JS standalone app launches files specified with mojo_shell command-line args (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 | « no previous file | mojo/apps/js/js_app.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
8 #include "gin/public/isolate_holder.h"
7 #include "mojo/apps/js/js_app.h" 9 #include "mojo/apps/js/js_app.h"
8 #include "mojo/public/cpp/application/application_impl.h" 10 #include "mojo/public/cpp/application/application_impl.h"
9 11
10 namespace mojo { 12 namespace mojo {
11 namespace apps { 13 namespace apps {
12 14
13 ApplicationDelegateImpl::ApplicationDelegateImpl() 15 ApplicationDelegateImpl::ApplicationDelegateImpl()
14 : application_impl_(nullptr) { 16 : application_impl_(nullptr) {
15 } 17 }
16 18
17 void ApplicationDelegateImpl::Initialize(ApplicationImpl* app) { 19 void ApplicationDelegateImpl::Initialize(ApplicationImpl* app) {
18 application_impl_ = app; 20 application_impl_ = app;
21 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
22 gin::ArrayBufferAllocator::SharedInstance());
19 } 23 }
20 24
21 ApplicationDelegateImpl::~ApplicationDelegateImpl() { 25 ApplicationDelegateImpl::~ApplicationDelegateImpl() {
22 } 26 }
23 27
24 void ApplicationDelegateImpl::StartJSApp(scoped_ptr<JSApp> app_ptr) { 28 void ApplicationDelegateImpl::StartJSApp(scoped_ptr<JSApp> app_ptr) {
25 JSApp *app = app_ptr.release(); 29 JSApp *app = app_ptr.release();
26 app_vector_.push_back(app); 30 app_vector_.push_back(app);
27 // TODO(hansmuller): deal with the Start() return value. 31 // TODO(hansmuller): deal with the Start() return value.
28 app->Start(); 32 app->Start();
(...skipping 12 matching lines...) Expand all
41 const std::string& interface_name) { 45 const std::string& interface_name) {
42 CHECK(application_impl_); 46 CHECK(application_impl_);
43 ServiceProvider* service_provider = 47 ServiceProvider* service_provider =
44 application_impl_->ConnectToApplication(application_url) 48 application_impl_->ConnectToApplication(application_url)
45 ->GetServiceProvider(); 49 ->GetServiceProvider();
46 service_provider->ConnectToService(interface_name, pipe_handle.Pass()); 50 service_provider->ConnectToService(interface_name, pipe_handle.Pass());
47 } 51 }
48 52
49 } // namespace apps 53 } // namespace apps
50 } // namespace mojo 54 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/apps/js/js_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698