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/shell/application_manager.h" | 5 #include "mojo/shell/application_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 const auto& it = identity_to_instance_.find(identity); | 115 const auto& it = identity_to_instance_.find(identity); |
116 return it != identity_to_instance_.end() ? it->second : nullptr; | 116 return it != identity_to_instance_.end() ? it->second : nullptr; |
117 } | 117 } |
118 | 118 |
119 void ApplicationManager::CreateInstanceForHandle(ScopedHandle channel, | 119 void ApplicationManager::CreateInstanceForHandle(ScopedHandle channel, |
120 const GURL& url, | 120 const GURL& url, |
121 const std::string& qualifier) { | 121 const std::string& qualifier) { |
122 // Instances created by others are considered unique, and thus have no | 122 // Instances created by others are considered unique, and thus have no |
123 // identity. As such they cannot be connected to by anyone else, and so we | 123 // identity. As such they cannot be connected to by anyone else, and so we |
124 // never call ConnectToClient(). | 124 // never call ConnectToClient(). |
| 125 // TODO(beng): GetPermissiveCapabilityFilter() here obviously cannot make it |
| 126 // to production. See note in application_manager.mojom. |
| 127 // http://crbug.com/555392 |
125 Identity target_id(url, qualifier, GetPermissiveCapabilityFilter()); | 128 Identity target_id(url, qualifier, GetPermissiveCapabilityFilter()); |
126 InterfaceRequest<Application> application_request = | 129 InterfaceRequest<Application> application_request = |
127 CreateInstance(target_id, base::Closure(), nullptr); | 130 CreateInstance(target_id, base::Closure(), nullptr); |
128 NativeRunner* runner = | 131 NativeRunner* runner = |
129 native_runner_factory_->Create(base::FilePath()).release(); | 132 native_runner_factory_->Create(base::FilePath()).release(); |
130 native_runners_.push_back(runner); | 133 native_runners_.push_back(runner); |
131 runner->InitHost(channel.Pass(), application_request.Pass()); | 134 runner->InitHost(channel.Pass(), application_request.Pass()); |
132 } | 135 } |
133 | 136 |
134 InterfaceRequest<Application> ApplicationManager::CreateAndConnectToInstance( | 137 InterfaceRequest<Application> ApplicationManager::CreateAndConnectToInstance( |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 native_runners_.erase( | 289 native_runners_.erase( |
287 std::find(native_runners_.begin(), native_runners_.end(), runner)); | 290 std::find(native_runners_.begin(), native_runners_.end(), runner)); |
288 } | 291 } |
289 | 292 |
290 Shell::ConnectToApplicationCallback EmptyConnectCallback() { | 293 Shell::ConnectToApplicationCallback EmptyConnectCallback() { |
291 return base::Bind(&OnEmptyOnConnectCallback); | 294 return base::Bind(&OnEmptyOnConnectCallback); |
292 } | 295 } |
293 | 296 |
294 } // namespace shell | 297 } // namespace shell |
295 } // namespace mojo | 298 } // namespace mojo |
OLD | NEW |