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

Side by Side Diff: chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h

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: another-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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_H_ 6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "chrome/browser/extensions/policy_handlers.h" 10 #include "chrome/browser/extensions/policy_handlers.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 private: 58 private:
59 explicit NetworkConfigurationPolicyHandler( 59 explicit NetworkConfigurationPolicyHandler(
60 const char* policy_name, 60 const char* policy_name,
61 ::onc::ONCSource onc_source, 61 ::onc::ONCSource onc_source,
62 const char* pref_path); 62 const char* pref_path);
63 63
64 // Takes network policy in Value representation and produces an output Value 64 // Takes network policy in Value representation and produces an output Value
65 // that contains a pretty-printed and sanitized version. In particular, we 65 // that contains a pretty-printed and sanitized version. In particular, we
66 // remove any Passphrases that may be contained in the JSON. Ownership of the 66 // remove any Passphrases that may be contained in the JSON. Ownership of the
67 // return value is transferred to the caller. 67 // return value is transferred to the caller.
68 static base::Value* SanitizeNetworkConfig(const base::Value* config); 68 static std::unique_ptr<base::Value> SanitizeNetworkConfig(
69 const base::Value* config);
69 70
70 // The kind of ONC source that this handler represents. ONCSource 71 // The kind of ONC source that this handler represents. ONCSource
71 // distinguishes between user and device policy. 72 // distinguishes between user and device policy.
72 const ::onc::ONCSource onc_source_; 73 const ::onc::ONCSource onc_source_;
73 74
74 // The name of the pref to apply the policy to. 75 // The name of the pref to apply the policy to.
75 const char* pref_path_; 76 const char* pref_path_;
76 77
77 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationPolicyHandler); 78 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationPolicyHandler);
78 }; 79 };
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 void ApplyPolicySettings(const PolicyMap& policies, 162 void ApplyPolicySettings(const PolicyMap& policies,
162 PrefValueMap* prefs) override; 163 PrefValueMap* prefs) override;
163 164
164 private: 165 private:
165 DISALLOW_COPY_AND_ASSIGN(ScreenLockDelayPolicyHandler); 166 DISALLOW_COPY_AND_ASSIGN(ScreenLockDelayPolicyHandler);
166 }; 167 };
167 168
168 } // namespace policy 169 } // namespace policy
169 170
170 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_ H_ 171 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698