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/entry.h" | 5 #include "services/catalog/entry.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "services/catalog/public/cpp/manifest_parsing_util.h" | 11 #include "services/catalog/public/cpp/manifest_parsing_util.h" |
12 #include "services/catalog/store.h" | 12 #include "services/catalog/store.h" |
13 | 13 |
14 namespace catalog { | 14 namespace catalog { |
15 namespace { | 15 namespace { |
16 | 16 |
17 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
18 const char kServiceExecutableExtension[] = ".service.exe"; | 18 const char kServiceExecutableExtension[] = ".service.exe"; |
19 #else | 19 #else |
20 const char kServiceExecutableExtension[] = ".service"; | 20 const char kServiceExecutableExtension[] = ".service"; |
21 #endif | 21 #endif |
22 | 22 |
23 bool ReadStringSet(const base::ListValue& list_value, | 23 bool ReadStringSet(const base::ListValue& list_value, |
24 std::set<std::string>* string_set) { | 24 std::set<std::string>* string_set) { |
25 DCHECK(string_set); | 25 DCHECK(string_set); |
26 for (const auto& value_value : list_value) { | 26 for (const auto& value_value : list_value) { |
27 std::string value; | 27 std::string value; |
28 if (!value_value->GetAsString(&value)) { | 28 if (!value_value.GetAsString(&value)) { |
29 LOG(ERROR) << "Entry::Deserialize: list member must be a string"; | 29 LOG(ERROR) << "Entry::Deserialize: list member must be a string"; |
30 return false; | 30 return false; |
31 } | 31 } |
32 string_set->insert(value); | 32 string_set->insert(value); |
33 } | 33 } |
34 return true; | 34 return true; |
35 } | 35 } |
36 | 36 |
37 bool ReadStringSetFromValue(const base::Value& value, | 37 bool ReadStringSetFromValue(const base::Value& value, |
38 std::set<std::string>* string_set) { | 38 std::set<std::string>* string_set) { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 catalog::mojom::EntryPtr | 250 catalog::mojom::EntryPtr |
251 TypeConverter<catalog::mojom::EntryPtr, catalog::Entry>::Convert( | 251 TypeConverter<catalog::mojom::EntryPtr, catalog::Entry>::Convert( |
252 const catalog::Entry& input) { | 252 const catalog::Entry& input) { |
253 catalog::mojom::EntryPtr result(catalog::mojom::Entry::New()); | 253 catalog::mojom::EntryPtr result(catalog::mojom::Entry::New()); |
254 result->name = input.name(); | 254 result->name = input.name(); |
255 result->display_name = input.display_name(); | 255 result->display_name = input.display_name(); |
256 return result; | 256 return result; |
257 } | 257 } |
258 | 258 |
259 } // namespace mojo | 259 } // namespace mojo |
OLD | NEW |