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

Side by Side Diff: mojo/services/package_manager/package_manager.cc

Issue 1769163002: Add a instance groups to Connect(), and introduce an Identity struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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/network/network_service_delegate.cc ('k') | mojo/shell/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/services/package_manager/package_manager.h" 5 #include "mojo/services/package_manager/package_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_file_value_serializer.h" 8 #include "base/json/json_file_value_serializer.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/task_runner_util.h" 10 #include "base/task_runner_util.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 system_package_dir_ = 112 system_package_dir_ =
113 mojo::util::AddTrailingSlashIfNeeded(system_package_dir_); 113 mojo::util::AddTrailingSlashIfNeeded(system_package_dir_);
114 114
115 DeserializeCatalog(); 115 DeserializeCatalog();
116 } 116 }
117 PackageManager::~PackageManager() {} 117 PackageManager::~PackageManager() {}
118 118
119 bool PackageManager::AcceptConnection(mojo::Connection* connection) { 119 bool PackageManager::AcceptConnection(mojo::Connection* connection) {
120 connection->AddInterface<mojom::Catalog>(this); 120 connection->AddInterface<mojom::Catalog>(this);
121 connection->AddInterface<mojom::Resolver>(this); 121 connection->AddInterface<mojom::Resolver>(this);
122 if (connection->GetRemoteApplicationName() == "mojo:shell") 122 if (connection->GetRemoteIdentity().name() == "mojo:shell")
123 connection->AddInterface<mojom::ShellResolver>(this); 123 connection->AddInterface<mojom::ShellResolver>(this);
124 return true; 124 return true;
125 } 125 }
126 126
127 void PackageManager::Create(mojo::Connection* connection, 127 void PackageManager::Create(mojo::Connection* connection,
128 mojom::ResolverRequest request) { 128 mojom::ResolverRequest request) {
129 resolver_bindings_.AddBinding(this, std::move(request)); 129 resolver_bindings_.AddBinding(this, std::move(request));
130 } 130 }
131 131
132 void PackageManager::Create(mojo::Connection* connection, 132 void PackageManager::Create(mojo::Connection* connection,
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 347 }
348 SerializeCatalog(); 348 SerializeCatalog();
349 349
350 auto qualifier_iter = qualifiers_.find(name); 350 auto qualifier_iter = qualifiers_.find(name);
351 DCHECK(qualifier_iter != qualifiers_.end()); 351 DCHECK(qualifier_iter != qualifiers_.end());
352 std::string qualifier = qualifier_iter->second; 352 std::string qualifier = qualifier_iter->second;
353 CompleteResolveMojoName(name, qualifier, callback); 353 CompleteResolveMojoName(name, qualifier, callback);
354 } 354 }
355 355
356 } // namespace package_manager 356 } // namespace package_manager
OLDNEW
« no previous file with comments | « mojo/services/network/network_service_delegate.cc ('k') | mojo/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698