OLD | NEW |
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" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "components/filesystem/directory_impl.h" | 14 #include "components/filesystem/directory_impl.h" |
15 #include "components/filesystem/lock_table.h" | 15 #include "components/filesystem/lock_table.h" |
16 #include "components/filesystem/public/interfaces/types.mojom.h" | 16 #include "components/filesystem/public/interfaces/types.mojom.h" |
17 #include "mojo/public/cpp/bindings/strong_binding.h" | 17 #include "mojo/public/cpp/bindings/strong_binding.h" |
18 #include "services/catalog/constants.h" | 18 #include "services/catalog/constants.h" |
19 #include "services/catalog/instance.h" | 19 #include "services/catalog/instance.h" |
20 #include "services/catalog/reader.h" | 20 #include "services/catalog/reader.h" |
21 #include "services/shell/public/cpp/connection.h" | 21 #include "services/service_manager/public/cpp/connection.h" |
22 #include "services/shell/public/cpp/names.h" | 22 #include "services/service_manager/public/cpp/names.h" |
23 #include "services/shell/public/cpp/service_context.h" | 23 #include "services/service_manager/public/cpp/service_context.h" |
24 | 24 |
25 namespace catalog { | 25 namespace catalog { |
26 namespace { | 26 namespace { |
27 | 27 |
28 bool IsPathNameValid(const std::string& name) { | 28 bool IsPathNameValid(const std::string& name) { |
29 if (name.empty() || name == "." || name == "..") | 29 if (name.empty() || name == "." || name == "..") |
30 return false; | 30 return false; |
31 | 31 |
32 for (auto c : name) { | 32 for (auto c : name) { |
33 if (!base::IsAsciiAlpha(c) && !base::IsAsciiDigit(c) && | 33 if (!base::IsAsciiAlpha(c) && !base::IsAsciiDigit(c) && |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 return instance; | 174 return instance; |
175 } | 175 } |
176 | 176 |
177 void Catalog::SystemPackageDirScanned() { | 177 void Catalog::SystemPackageDirScanned() { |
178 loaded_ = true; | 178 loaded_ = true; |
179 for (auto& instance : instances_) | 179 for (auto& instance : instances_) |
180 instance.second->CacheReady(&system_cache_); | 180 instance.second->CacheReady(&system_cache_); |
181 } | 181 } |
182 | 182 |
183 } // namespace catalog | 183 } // namespace catalog |
OLD | NEW |