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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 auto alias_iter = application_package_alias_.find(app_url); | 329 auto alias_iter = application_package_alias_.find(app_url); |
330 if (alias_iter != application_package_alias_.end()) { | 330 if (alias_iter != application_package_alias_.end()) { |
331 // We replace the qualifier with the one our package alias requested. | 331 // We replace the qualifier with the one our package alias requested. |
332 URLResponsePtr response(URLResponse::New()); | 332 URLResponsePtr response(URLResponse::New()); |
333 response->url = String::From(app_url.spec()); | 333 response->url = String::From(app_url.spec()); |
334 | 334 |
335 std::string qualifier; | 335 std::string qualifier; |
336 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 336 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
337 switches::kEnableMultiprocess)) { | 337 switches::kEnableMultiprocess)) { |
338 // Why can't we use this in single process mode? Because of | 338 // Why can't we use this in single process mode? Because of |
339 // base::AtExitManager. If you link in ApplicationRunnerChromium into | 339 // base::AtExitManager. If you link in ApplicationRunner into |
340 // your code, and then we make initialize multiple copies of the | 340 // your code, and then we make initialize multiple copies of the |
341 // application, we end up with multiple AtExitManagers and will check on | 341 // application, we end up with multiple AtExitManagers and will check on |
342 // the second one being created. | 342 // the second one being created. |
343 // | 343 // |
344 // Why doesn't that happen when running different apps? Because | 344 // Why doesn't that happen when running different apps? Because |
345 // your_thing.mojo!base::AtExitManager and | 345 // your_thing.mojo!base::AtExitManager and |
346 // my_thing.mojo!base::AtExitManager are different symbols. | 346 // my_thing.mojo!base::AtExitManager are different symbols. |
347 qualifier = alias_iter->second.second; | 347 qualifier = alias_iter->second.second; |
348 } | 348 } |
349 | 349 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 return pipe.handle0.Pass(); | 515 return pipe.handle0.Pass(); |
516 } | 516 } |
517 | 517 |
518 void ApplicationManager::CleanupRunner(NativeRunner* runner) { | 518 void ApplicationManager::CleanupRunner(NativeRunner* runner) { |
519 native_runners_.erase( | 519 native_runners_.erase( |
520 std::find(native_runners_.begin(), native_runners_.end(), runner)); | 520 std::find(native_runners_.begin(), native_runners_.end(), runner)); |
521 } | 521 } |
522 | 522 |
523 } // namespace shell | 523 } // namespace shell |
524 } // namespace mojo | 524 } // namespace mojo |
OLD | NEW |