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

Side by Side Diff: components/policy/core/common/schema_map.cc

Issue 337053005: Precache policy-for-extensions for device-local accounts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed ios tests Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/policy/core/common/schema_map.h" 5 #include "components/policy/core/common/schema_map.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "components/policy/core/common/policy_bundle.h" 9 #include "components/policy/core/common/policy_bundle.h"
10 #include "components/policy/core/common/policy_map.h" 10 #include "components/policy/core/common/policy_map.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 if (!schema) { 48 if (!schema) {
49 it->second->Clear(); 49 it->second->Clear();
50 continue; 50 continue;
51 } 51 }
52 52
53 // TODO(joaodasilva): if a component is registered but doesn't have a schema 53 // TODO(joaodasilva): if a component is registered but doesn't have a schema
54 // then its policies aren't filtered. This behavior is enabled to allow a 54 // then its policies aren't filtered. This behavior is enabled to allow a
55 // graceful update of the Legacy Browser Support extension; it'll be removed 55 // graceful update of the Legacy Browser Support extension; it'll be removed
56 // in a future release. http://crbug.com/240704 56 // in a future release. http://crbug.com/240704
57 if (!schema->valid()) 57 static const char kLegacyBrowserSupportExtensionId[] =
58 "heildphpnddilhkemkielfhnkaagiabh";
59 if (it->first.domain == POLICY_DOMAIN_EXTENSIONS &&
60 it->first.component_id == kLegacyBrowserSupportExtensionId) {
58 continue; 61 continue;
62 }
63
64 if (!schema->valid()) {
65 // Don't serve unknown policies.
66 it->second->Clear();
67 continue;
68 }
59 69
60 PolicyMap* map = it->second; 70 PolicyMap* map = it->second;
61 for (PolicyMap::const_iterator it_map = map->begin(); 71 for (PolicyMap::const_iterator it_map = map->begin();
62 it_map != map->end();) { 72 it_map != map->end();) {
63 const std::string& policy_name = it_map->first; 73 const std::string& policy_name = it_map->first;
64 const base::Value* policy_value = it_map->second.value; 74 const base::Value* policy_value = it_map->second.value;
65 Schema policy_schema = schema->GetProperty(policy_name); 75 Schema policy_schema = schema->GetProperty(policy_name);
66 ++it_map; 76 ++it_map;
67 std::string error_path; 77 std::string error_path;
68 std::string error; 78 std::string error;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 for (ComponentMap::const_iterator comp = components.begin(); 118 for (ComponentMap::const_iterator comp = components.begin();
109 comp != components.end(); ++comp) { 119 comp != components.end(); ++comp) {
110 PolicyNamespace ns(domain->first, comp->first); 120 PolicyNamespace ns(domain->first, comp->first);
111 if (!other->GetSchema(ns)) 121 if (!other->GetSchema(ns))
112 list->push_back(ns); 122 list->push_back(ns);
113 } 123 }
114 } 124 }
115 } 125 }
116 126
117 } // namespace policy 127 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698