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

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

Issue 1962503002: Add mojom module suffix in .mojom files for components/filesystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/catalog/manifest.json » ('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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(kMojoApplicationsDirName); 101 system_package_dir = system_package_dir.AppendASCII(kMojoApplicationsDirName);
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::AcceptConnection(shell::Connection* connection) { 107 bool Catalog::AcceptConnection(shell::Connection* connection) {
108 connection->AddInterface<mojom::Catalog>(this); 108 connection->AddInterface<mojom::Catalog>(this);
109 connection->AddInterface<filesystem::Directory>(this); 109 connection->AddInterface<filesystem::mojom::Directory>(this);
110 connection->AddInterface<shell::mojom::ShellResolver>(this); 110 connection->AddInterface<shell::mojom::ShellResolver>(this);
111 return true; 111 return true;
112 } 112 }
113 113
114 void Catalog::Create(shell::Connection* connection, 114 void Catalog::Create(shell::Connection* connection,
115 shell::mojom::ShellResolverRequest request) { 115 shell::mojom::ShellResolverRequest request) {
116 Instance* instance = 116 Instance* instance =
117 GetInstanceForUserId(connection->GetRemoteIdentity().user_id()); 117 GetInstanceForUserId(connection->GetRemoteIdentity().user_id());
118 instance->BindShellResolver(std::move(request)); 118 instance->BindShellResolver(std::move(request));
119 } 119 }
120 120
121 void Catalog::Create(shell::Connection* connection, 121 void Catalog::Create(shell::Connection* connection,
122 mojom::CatalogRequest request) { 122 mojom::CatalogRequest request) {
123 Instance* instance = 123 Instance* instance =
124 GetInstanceForUserId(connection->GetRemoteIdentity().user_id()); 124 GetInstanceForUserId(connection->GetRemoteIdentity().user_id());
125 instance->BindCatalog(std::move(request)); 125 instance->BindCatalog(std::move(request));
126 } 126 }
127 127
128 void Catalog::Create(shell::Connection* connection, 128 void Catalog::Create(shell::Connection* connection,
129 filesystem::DirectoryRequest request) { 129 filesystem::mojom::DirectoryRequest request) {
130 if (!lock_table_) 130 if (!lock_table_)
131 lock_table_ = new filesystem::LockTable; 131 lock_table_ = new filesystem::LockTable;
132 base::FilePath resources_path = 132 base::FilePath resources_path =
133 GetPathForApplicationName(connection->GetRemoteIdentity().name()); 133 GetPathForApplicationName(connection->GetRemoteIdentity().name());
134 new filesystem::DirectoryImpl(std::move(request), resources_path, 134 new filesystem::DirectoryImpl(std::move(request), resources_path,
135 scoped_refptr<filesystem::SharedTempDir>(), 135 scoped_refptr<filesystem::SharedTempDir>(),
136 lock_table_); 136 lock_table_);
137 } 137 }
138 138
139 Instance* Catalog::GetInstanceForUserId(const std::string& user_id) { 139 Instance* Catalog::GetInstanceForUserId(const std::string& user_id) {
(...skipping 10 matching lines...) Expand all
150 return instance; 150 return instance;
151 } 151 }
152 152
153 void Catalog::SystemPackageDirScanned() { 153 void Catalog::SystemPackageDirScanned() {
154 loaded_ = true; 154 loaded_ = true;
155 for (auto& instance : instances_) 155 for (auto& instance : instances_)
156 instance.second->CacheReady(&system_cache_); 156 instance.second->CacheReady(&system_cache_);
157 } 157 }
158 158
159 } // namespace catalog 159 } // namespace catalog
OLDNEW
« no previous file with comments | « services/catalog/catalog.h ('k') | services/catalog/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698