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

Side by Side Diff: extensions/common/manifest_handlers/externally_connectable.cc

Issue 1226353004: Generate all extension schema namespaces as "api" and instead vary the generated bundle names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/common/manifest_handlers/externally_connectable.h" 5 #include "extensions/common/manifest_handlers/externally_connectable.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 19 matching lines...) Expand all
30 "nothing will be able to connect"; 30 "nothing will be able to connect";
31 const char kErrorTopLevelDomainsNotAllowed[] = 31 const char kErrorTopLevelDomainsNotAllowed[] =
32 "\"*\" is an effective top level domain for which wildcard subdomains such " 32 "\"*\" is an effective top level domain for which wildcard subdomains such "
33 "as \"*\" are not allowed"; 33 "as \"*\" are not allowed";
34 const char kErrorWildcardHostsNotAllowed[] = 34 const char kErrorWildcardHostsNotAllowed[] =
35 "Wildcard domain patterns such as \"*\" are not allowed"; 35 "Wildcard domain patterns such as \"*\" are not allowed";
36 } // namespace externally_connectable_errors 36 } // namespace externally_connectable_errors
37 37
38 namespace keys = extensions::manifest_keys; 38 namespace keys = extensions::manifest_keys;
39 namespace errors = externally_connectable_errors; 39 namespace errors = externally_connectable_errors;
40 using core_api::extensions_manifest_types::ExternallyConnectable; 40 using api::extensions_manifest_types::ExternallyConnectable;
41 41
42 namespace { 42 namespace {
43 43
44 const char kAllIds[] = "*"; 44 const char kAllIds[] = "*";
45 45
46 template <typename T> 46 template <typename T>
47 std::vector<T> Sorted(const std::vector<T>& in) { 47 std::vector<T> Sorted(const std::vector<T>& in) {
48 std::vector<T> out = in; 48 std::vector<T> out = in;
49 std::sort(out.begin(), out.end()); 49 std::sort(out.begin(), out.end());
50 return out; 50 return out;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 218 }
219 219
220 bool ExternallyConnectableInfo::IdCanConnect(const std::string& id) { 220 bool ExternallyConnectableInfo::IdCanConnect(const std::string& id) {
221 if (all_ids) 221 if (all_ids)
222 return true; 222 return true;
223 DCHECK(base::STLIsSorted(ids)); 223 DCHECK(base::STLIsSorted(ids));
224 return std::binary_search(ids.begin(), ids.end(), id); 224 return std::binary_search(ids.begin(), ids.end(), id);
225 } 225 }
226 226
227 } // namespace extensions 227 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698