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

Side by Side Diff: services/catalog/catalog.cc

Issue 2215133002: Change signature of OnConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: . Created 4 years, 4 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 | « services/catalog/catalog.h ('k') | services/navigation/navigation.h » ('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 "services/catalog/catalog.h" 5 #include "services/catalog/catalog.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 void Catalog::ScanSystemPackageDir() { 98 void Catalog::ScanSystemPackageDir() {
99 base::FilePath system_package_dir; 99 base::FilePath system_package_dir;
100 PathService::Get(base::DIR_MODULE, &system_package_dir); 100 PathService::Get(base::DIR_MODULE, &system_package_dir);
101 system_package_dir = system_package_dir.AppendASCII(kPackagesDirName); 101 system_package_dir = system_package_dir.AppendASCII(kPackagesDirName);
102 system_reader_->Read(system_package_dir, &system_cache_, 102 system_reader_->Read(system_package_dir, &system_cache_,
103 base::Bind(&Catalog::SystemPackageDirScanned, 103 base::Bind(&Catalog::SystemPackageDirScanned,
104 weak_factory_.GetWeakPtr())); 104 weak_factory_.GetWeakPtr()));
105 } 105 }
106 106
107 bool Catalog::OnConnect(shell::Connection* connection) { 107 bool Catalog::OnConnect(const shell::Identity& remote_identity,
108 connection->AddInterface<mojom::Catalog>(this); 108 shell::InterfaceRegistry* registry) {
109 connection->AddInterface<filesystem::mojom::Directory>(this); 109 registry->AddInterface<mojom::Catalog>(this);
110 connection->AddInterface<shell::mojom::Resolver>(this); 110 registry->AddInterface<filesystem::mojom::Directory>(this);
111 registry->AddInterface<shell::mojom::Resolver>(this);
111 return true; 112 return true;
112 } 113 }
113 114
114 void Catalog::Create(const shell::Identity& remote_identity, 115 void Catalog::Create(const shell::Identity& remote_identity,
115 shell::mojom::ResolverRequest request) { 116 shell::mojom::ResolverRequest request) {
116 Instance* instance = GetInstanceForUserId(remote_identity.user_id()); 117 Instance* instance = GetInstanceForUserId(remote_identity.user_id());
117 instance->BindResolver(std::move(request)); 118 instance->BindResolver(std::move(request));
118 } 119 }
119 120
120 void Catalog::Create(const shell::Identity& remote_identity, 121 void Catalog::Create(const shell::Identity& remote_identity,
(...skipping 27 matching lines...) Expand all
148 return instance; 149 return instance;
149 } 150 }
150 151
151 void Catalog::SystemPackageDirScanned() { 152 void Catalog::SystemPackageDirScanned() {
152 loaded_ = true; 153 loaded_ = true;
153 for (auto& instance : instances_) 154 for (auto& instance : instances_)
154 instance.second->CacheReady(&system_cache_); 155 instance.second->CacheReady(&system_cache_);
155 } 156 }
156 157
157 } // namespace catalog 158 } // namespace catalog
OLDNEW
« no previous file with comments | « services/catalog/catalog.h ('k') | services/navigation/navigation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698