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/shell.h" | 5 #include "mojo/shell/shell.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 return instance; | 632 return instance; |
633 } | 633 } |
634 | 634 |
635 void Shell::AddInstanceListener(mojom::InstanceListenerPtr listener) { | 635 void Shell::AddInstanceListener(mojom::InstanceListenerPtr listener) { |
636 // TODO(beng): filter instances provided by those visible to this client. | 636 // TODO(beng): filter instances provided by those visible to this client. |
637 Array<mojom::InstanceInfoPtr> instances; | 637 Array<mojom::InstanceInfoPtr> instances; |
638 for (auto& instance : identity_to_instance_) | 638 for (auto& instance : identity_to_instance_) |
639 instances.push_back(instance.second->CreateInstanceInfo()); | 639 instances.push_back(instance.second->CreateInstanceInfo()); |
640 listener->SetExistingInstances(std::move(instances)); | 640 listener->SetExistingInstances(std::move(instances)); |
641 | 641 |
642 instance_listeners_.AddInterfacePtr(std::move(listener)); | 642 instance_listeners_.AddPtr(std::move(listener)); |
643 } | 643 } |
644 | 644 |
645 void Shell::CreateShellClientWithFactory(const Identity& source, | 645 void Shell::CreateShellClientWithFactory(const Identity& source, |
646 const Identity& shell_client_factory, | 646 const Identity& shell_client_factory, |
647 const std::string& name, | 647 const std::string& name, |
648 mojom::ShellClientRequest request) { | 648 mojom::ShellClientRequest request) { |
649 mojom::ShellClientFactory* factory = | 649 mojom::ShellClientFactory* factory = |
650 GetShellClientFactory(shell_client_factory, source); | 650 GetShellClientFactory(shell_client_factory, source); |
651 factory->CreateShellClient(std::move(request), name); | 651 factory->CreateShellClient(std::move(request), name); |
652 } | 652 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 for (auto it = native_runners_.begin(); it != native_runners_.end(); ++it) { | 782 for (auto it = native_runners_.begin(); it != native_runners_.end(); ++it) { |
783 if (it->get() == runner) { | 783 if (it->get() == runner) { |
784 native_runners_.erase(it); | 784 native_runners_.erase(it); |
785 return; | 785 return; |
786 } | 786 } |
787 } | 787 } |
788 } | 788 } |
789 | 789 |
790 } // namespace shell | 790 } // namespace shell |
791 } // namespace mojo | 791 } // namespace mojo |
OLD | NEW |