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

Side by Side Diff: mojo/shell/shell.cc

Issue 1872903003: Generalize InterfacePtrSet for [Associated]InterfacePtr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put PtrSet in mojo::internal. Created 4 years, 8 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 | « mojo/services/tracing/tracing_app.cc ('k') | no next file » | 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/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
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
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
OLDNEW
« no previous file with comments | « mojo/services/tracing/tracing_app.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698