OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/shell/application_instance.h" | 5 #include "mojo/shell/application_instance.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/atomic_sequence_num.h" | 11 #include "base/atomic_sequence_num.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "mojo/common/common_type_converters.h" | 14 #include "mojo/common/common_type_converters.h" |
15 #include "mojo/common/url_type_converters.h" | 15 #include "mojo/common/url_type_converters.h" |
16 #include "mojo/shell/application_manager.h" | 16 #include "mojo/shell/application_manager.h" |
17 | 17 |
18 namespace mojo { | 18 namespace mojo { |
19 namespace shell { | 19 namespace shell { |
20 | 20 |
21 ApplicationInstance::ApplicationInstance( | 21 ApplicationInstance::ApplicationInstance( |
22 mojom::ShellClientPtr shell_client, | 22 mojom::ShellClientPtr shell_client, |
23 ApplicationManager* manager, | 23 ApplicationManager* manager, |
24 const Identity& identity, | 24 const Identity& identity, |
25 const base::Closure& on_application_end, | |
26 const String& application_name) | 25 const String& application_name) |
27 : manager_(manager), | 26 : manager_(manager), |
28 id_(GenerateUniqueID()), | 27 id_(GenerateUniqueID()), |
29 identity_(identity), | 28 identity_(identity), |
30 allow_any_application_(identity.filter().size() == 1 && | 29 allow_any_application_(identity.filter().size() == 1 && |
31 identity.filter().count("*") == 1), | 30 identity.filter().count("*") == 1), |
32 on_application_end_(on_application_end), | |
33 shell_client_(std::move(shell_client)), | 31 shell_client_(std::move(shell_client)), |
34 binding_(this), | 32 binding_(this), |
35 pid_receiver_binding_(this), | 33 pid_receiver_binding_(this), |
36 queue_requests_(false), | 34 queue_requests_(false), |
37 native_runner_(nullptr), | 35 native_runner_(nullptr), |
38 application_name_(application_name), | 36 application_name_(application_name), |
39 pid_(base::kNullProcessId) { | 37 pid_(base::kNullProcessId) { |
40 DCHECK_NE(Shell::kInvalidApplicationID, id_); | 38 DCHECK_NE(Shell::kInvalidApplicationID, id_); |
41 } | 39 } |
42 | 40 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 156 |
159 queue_requests_ = false; | 157 queue_requests_ = false; |
160 for (auto request : queued_client_requests_) | 158 for (auto request : queued_client_requests_) |
161 CallAcceptConnection(make_scoped_ptr(request)); | 159 CallAcceptConnection(make_scoped_ptr(request)); |
162 | 160 |
163 queued_client_requests_.clear(); | 161 queued_client_requests_.clear(); |
164 } | 162 } |
165 | 163 |
166 } // namespace shell | 164 } // namespace shell |
167 } // namespace mojo | 165 } // namespace mojo |
OLD | NEW |