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

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

Issue 627093002: mojo_js_standalone will quit after the last JSApp quits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Attempt to fix the inexplicable fail-to-commit with a resync 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.h » ('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" 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"
(...skipping 19 matching lines...) Expand all
30 app_vector_.push_back(app); 30 app_vector_.push_back(app);
31 // TODO(hansmuller): deal with the Start() return value. 31 // TODO(hansmuller): deal with the Start() return value.
32 app->Start(); 32 app->Start();
33 } 33 }
34 34
35 void ApplicationDelegateImpl::QuitJSApp(JSApp* app) { 35 void ApplicationDelegateImpl::QuitJSApp(JSApp* app) {
36 AppVector::iterator itr = 36 AppVector::iterator itr =
37 std::find(app_vector_.begin(), app_vector_.end(), app); 37 std::find(app_vector_.begin(), app_vector_.end(), app);
38 if (itr != app_vector_.end()) 38 if (itr != app_vector_.end())
39 app_vector_.erase(itr); 39 app_vector_.erase(itr);
40 if (app_vector_.empty())
41 base::MessageLoop::current()->QuitWhenIdle();
40 } 42 }
41 43
42 void ApplicationDelegateImpl::ConnectToService( 44 void ApplicationDelegateImpl::ConnectToService(
43 ScopedMessagePipeHandle pipe_handle, 45 ScopedMessagePipeHandle pipe_handle,
44 const std::string& application_url, 46 const std::string& application_url,
45 const std::string& interface_name) { 47 const std::string& interface_name) {
46 CHECK(application_impl_); 48 CHECK(application_impl_);
47 ServiceProvider* service_provider = 49 ServiceProvider* service_provider =
48 application_impl_->ConnectToApplication(application_url) 50 application_impl_->ConnectToApplication(application_url)
49 ->GetServiceProvider(); 51 ->GetServiceProvider();
50 service_provider->ConnectToService(interface_name, pipe_handle.Pass()); 52 service_provider->ConnectToService(interface_name, pipe_handle.Pass());
51 } 53 }
52 54
53 } // namespace apps 55 } // namespace apps
54 } // namespace mojo 56 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/apps/js/js_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698