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

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

Issue 1943993005: Remove wildcard usage in interface lists (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/data/wildcard_interfaces ('k') | services/catalog/entry_unittest.cc » ('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/entry.h" 5 #include "services/catalog/entry.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "services/catalog/store.h" 8 #include "services/catalog/store.h"
9 #include "services/shell/public/cpp/names.h" 9 #include "services/shell/public/cpp/names.h"
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 LOG(ERROR) << "Entry::Deserialize: " << Store::kCapabilities_RequiredKey 91 LOG(ERROR) << "Entry::Deserialize: " << Store::kCapabilities_RequiredKey
92 << " must be a dictionary."; 92 << " must be a dictionary.";
93 return false; 93 return false;
94 } 94 }
95 if (!ReadStringSetFromDictionary( 95 if (!ReadStringSetFromDictionary(
96 *entry_value, Store::kCapabilities_ClassesKey, &spec.classes)) { 96 *entry_value, Store::kCapabilities_ClassesKey, &spec.classes)) {
97 LOG(ERROR) << "Entry::Deserialize: Invalid classes list in required " 97 LOG(ERROR) << "Entry::Deserialize: Invalid classes list in required "
98 << "capabilities dictionary."; 98 << "capabilities dictionary.";
99 return false; 99 return false;
100 } 100 }
101 shell::Interfaces interfaces;
101 if (!ReadStringSetFromDictionary(*entry_value, 102 if (!ReadStringSetFromDictionary(*entry_value,
102 Store::kCapabilities_InterfacesKey, 103 Store::kCapabilities_InterfacesKey,
103 &spec.interfaces)) { 104 &interfaces)) {
104 LOG(ERROR) << "Entry::Deserialize: Invalid interfaces list in required " 105 LOG(ERROR) << "Entry::Deserialize: Invalid interfaces list in required "
105 << "capabilities dictionary."; 106 << "capabilities dictionary.";
106 return false; 107 return false;
107 } 108 }
109 if (interfaces.count("*") > 0) {
110 LOG(ERROR) << "Entry::Deserializer: Wildcard not valid in interfaces "
111 << "list.";
112 return false;
113 }
114 spec.interfaces = interfaces;
115
108 capabilities->required[it.key()] = spec; 116 capabilities->required[it.key()] = spec;
109 } 117 }
110 } 118 }
111 return true; 119 return true;
112 } 120 }
113 121
114 } // namespace 122 } // namespace
115 123
116 Entry::Entry() {} 124 Entry::Entry() {}
117 Entry::Entry(const std::string& name) 125 Entry::Entry(const std::string& name)
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 catalog::mojom::EntryPtr 289 catalog::mojom::EntryPtr
282 TypeConverter<catalog::mojom::EntryPtr, catalog::Entry>::Convert( 290 TypeConverter<catalog::mojom::EntryPtr, catalog::Entry>::Convert(
283 const catalog::Entry& input) { 291 const catalog::Entry& input) {
284 catalog::mojom::EntryPtr result(catalog::mojom::Entry::New()); 292 catalog::mojom::EntryPtr result(catalog::mojom::Entry::New());
285 result->name = input.name(); 293 result->name = input.name();
286 result->display_name = input.display_name(); 294 result->display_name = input.display_name();
287 return result; 295 return result;
288 } 296 }
289 297
290 } // namespace mojo 298 } // namespace mojo
OLDNEW
« no previous file with comments | « services/catalog/data/wildcard_interfaces ('k') | services/catalog/entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698