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

Unified Diff: components/policy/core/browser/android/policy_converter.h

Issue 1902633006: Convert //components/policy from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and use namespace alias Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/policy/core/browser/android/policy_converter.h
diff --git a/components/policy/core/browser/android/policy_converter.h b/components/policy/core/browser/android/policy_converter.h
index b1fd336c96b8544aa6db206241d888327e99f935..57d8cecb1a312578c04877698fddd7045fae0813 100644
--- a/components/policy/core/browser/android/policy_converter.h
+++ b/components/policy/core/browser/android/policy_converter.h
@@ -6,11 +6,12 @@
#define COMPONENTS_POLICY_CORE_BROWSER_ANDROID_POLICY_CONVERTER_H
#include <jni.h>
+
+#include <memory>
#include <string>
#include "base/android/scoped_java_ref.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "components/policy/policy_export.h"
namespace base {
@@ -36,7 +37,7 @@ class POLICY_EXPORT PolicyConverter {
// Returns a policy bundle containing all policies collected since the last
// call to this method.
- scoped_ptr<PolicyBundle> GetPolicyBundle();
+ std::unique_ptr<PolicyBundle> GetPolicyBundle();
base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
@@ -65,12 +66,12 @@ class POLICY_EXPORT PolicyConverter {
// additional restrictions, or the schema for value's items or properties in
// the case of a list or dictionary value.
// Public for testing.
- static scoped_ptr<base::Value> ConvertValueToSchema(
- scoped_ptr<base::Value> value,
+ static std::unique_ptr<base::Value> ConvertValueToSchema(
+ std::unique_ptr<base::Value> value,
const Schema& schema);
// Public for testing.
- static scoped_ptr<base::ListValue> ConvertJavaStringArrayToListValue(
+ static std::unique_ptr<base::ListValue> ConvertJavaStringArrayToListValue(
JNIEnv* env,
const base::android::JavaRef<jobjectArray>& array);
@@ -80,12 +81,12 @@ class POLICY_EXPORT PolicyConverter {
private:
const Schema* const policy_schema_;
- scoped_ptr<PolicyBundle> policy_bundle_;
+ std::unique_ptr<PolicyBundle> policy_bundle_;
base::android::ScopedJavaGlobalRef<jobject> java_obj_;
void SetPolicyValue(const std::string& key,
- scoped_ptr<base::Value> raw_value);
+ std::unique_ptr<base::Value> raw_value);
DISALLOW_COPY_AND_ASSIGN(PolicyConverter);
};

Powered by Google App Engine
This is Rietveld 408576698