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

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

Issue 1940153002: Use std::unique_ptr to express ownership of base::Value in PolicyMap::Entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixes (partial Windows fix) 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "components/policy/core/common/policy_loader_win.h" 5 #include "components/policy/core/common/policy_loader_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <lm.h> // For limits. 8 #include <lm.h> // For limits.
9 #include <ntdsapi.h> // For Ds[Un]Bind 9 #include <ntdsapi.h> // For Ds[Un]Bind
10 #include <rpc.h> // For struct GUID 10 #include <rpc.h> // For struct GUID
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // Only allow custom update urls in enterprise environments. 159 // Only allow custom update urls in enterprise environments.
160 if (!base::LowerCaseEqualsASCII(entry.substr(pos), 160 if (!base::LowerCaseEqualsASCII(entry.substr(pos),
161 kExpectedWebStoreUrl)) { 161 kExpectedWebStoreUrl)) {
162 entry = kBlockedExtensionPrefix + entry; 162 entry = kBlockedExtensionPrefix + entry;
163 invalid_policies++; 163 invalid_policies++;
164 } 164 }
165 165
166 filtered_values->AppendString(entry); 166 filtered_values->AppendString(entry);
167 } 167 }
168 if (invalid_policies) { 168 if (invalid_policies) {
169 policy->Set(key::kExtensionInstallForcelist, 169 policy->Set(key::kExtensionInstallForcelist, map_entry->level,
170 map_entry->level, map_entry->scope, map_entry->source, 170 map_entry->scope, map_entry->source,
171 filtered_values.release(), 171 std::move(filtered_values),
172 // TODO(dcheng): Ummm... figure out what this is all about
173 // when I'm more awake.
Andrew T Wilson (Slow) 2016/05/03 11:59:03 What's the concern here?
dcheng 2016/05/03 23:40:40 ExternalDataFetcher is now an owned pointer, so it
172 map_entry->external_data_fetcher); 174 map_entry->external_data_fetcher);
173 175
174 const PolicyDetails* details = GetChromePolicyDetails( 176 const PolicyDetails* details = GetChromePolicyDetails(
175 key::kExtensionInstallForcelist); 177 key::kExtensionInstallForcelist);
176 UMA_HISTOGRAM_SPARSE_SLOWLY("EnterpriseCheck.InvalidPolicies", 178 UMA_HISTOGRAM_SPARSE_SLOWLY("EnterpriseCheck.InvalidPolicies",
177 details->id); 179 details->id);
178 } 180 }
179 } 181 }
180 182
181 for (size_t i = 0; i < arraysize(kInsecurePolicies); ++i) { 183 for (size_t i = 0; i < arraysize(kInsecurePolicies); ++i) {
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 685
684 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { 686 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) {
685 DCHECK(object == user_policy_changed_event_.handle() || 687 DCHECK(object == user_policy_changed_event_.handle() ||
686 object == machine_policy_changed_event_.handle()) 688 object == machine_policy_changed_event_.handle())
687 << "unexpected object signaled policy reload, obj = " 689 << "unexpected object signaled policy reload, obj = "
688 << std::showbase << std::hex << object; 690 << std::showbase << std::hex << object;
689 Reload(false); 691 Reload(false);
690 } 692 }
691 693
692 } // namespace policy 694 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698