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

Unified Diff: sync/protocol/proto_value_conversions.cc

Issue 1866243002: Convert //sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: sync/protocol/proto_value_conversions.cc
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc
index f01b8ca6eb31fccc68fe469b8ee4bbd946b88afb..7d7c367e2581d7f67723508823adee7d574b8591 100644
--- a/sync/protocol/proto_value_conversions.cc
+++ b/sync/protocol/proto_value_conversions.cc
@@ -14,6 +14,7 @@
#include "base/base64.h"
#include "base/i18n/time_formatting.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
@@ -51,8 +52,8 @@ namespace {
// Basic Type -> Value functions.
-scoped_ptr<base::StringValue> MakeInt64Value(int64_t x) {
- return make_scoped_ptr(new base::StringValue(base::Int64ToString(x)));
+std::unique_ptr<base::StringValue> MakeInt64Value(int64_t x) {
+ return base::WrapUnique(new base::StringValue(base::Int64ToString(x)));
}
// TODO(akalin): Perhaps make JSONWriter support BinaryValue and use
@@ -63,16 +64,16 @@ std::string Base64EncodeString(const std::string& bytes) {
return bytes_base64;
}
-scoped_ptr<base::StringValue> MakeStringValue(const std::string& str) {
- return make_scoped_ptr(new base::StringValue(str));
+std::unique_ptr<base::StringValue> MakeStringValue(const std::string& str) {
+ return base::WrapUnique(new base::StringValue(str));
}
// T is the field type, F is either RepeatedField or RepeatedPtrField,
// and V is a subclass of Value.
template <class T, class F, class V>
-scoped_ptr<base::ListValue> MakeRepeatedValue(const F& fields,
- V (*converter_fn)(T)) {
- scoped_ptr<base::ListValue> list(new base::ListValue());
+std::unique_ptr<base::ListValue> MakeRepeatedValue(const F& fields,
+ V (*converter_fn)(T)) {
+ std::unique_ptr<base::ListValue> list(new base::ListValue());
for (typename F::const_iterator it = fields.begin(); it != fields.end();
++it) {
list->Append(converter_fn(*it));
@@ -101,13 +102,13 @@ scoped_ptr<base::ListValue> MakeRepeatedValue(const F& fields,
#define SET_INT64_REP(field) SET_REP(field, MakeInt64Value)
#define SET_STR(field) SET_TYPE(field, SetString, )
#define SET_TIME_STR(field) SET_TYPE(field, SetString, TimestampToString)
-#define SET_STR_REP(field) \
- value->Set( \
- #field, \
- MakeRepeatedValue<const std::string&, \
- google::protobuf::RepeatedPtrField<std::string>, \
- scoped_ptr<base::StringValue>>(proto.field(), \
- MakeStringValue))
+#define SET_STR_REP(field) \
+ value->Set( \
+ #field, \
+ MakeRepeatedValue<const std::string&, \
+ google::protobuf::RepeatedPtrField<std::string>, \
+ std::unique_ptr<base::StringValue>>(proto.field(), \
+ MakeStringValue))
#define SET_EXPERIMENT_ENABLED_FIELD(field) \
do { \
if (proto.has_##field() && \
@@ -128,36 +129,36 @@ scoped_ptr<base::ListValue> MakeRepeatedValue(const F& fields,
// If you add another macro, don't forget to add an #undef at the end
// of this file, too.
-scoped_ptr<base::DictionaryValue> EncryptedDataToValue(
+std::unique_ptr<base::DictionaryValue> EncryptedDataToValue(
const sync_pb::EncryptedData& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(key_name);
// TODO(akalin): Shouldn't blob be of type bytes instead of string?
SET_BYTES(blob);
return value;
}
-scoped_ptr<base::DictionaryValue> AppSettingsToValue(
+std::unique_ptr<base::DictionaryValue> AppSettingsToValue(
const sync_pb::AppNotificationSettings& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_BOOL(initial_setup_done);
SET_BOOL(disabled);
SET_STR(oauth_client_id);
return value;
}
-scoped_ptr<base::DictionaryValue> SessionHeaderToValue(
+std::unique_ptr<base::DictionaryValue> SessionHeaderToValue(
const sync_pb::SessionHeader& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_REP(window, SessionWindowToValue);
SET_STR(client_name);
SET_ENUM(device_type, GetDeviceTypeString);
return value;
}
-scoped_ptr<base::DictionaryValue> SessionTabToValue(
+std::unique_ptr<base::DictionaryValue> SessionTabToValue(
const sync_pb::SessionTab& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT32(tab_id);
SET_INT32(window_id);
SET_INT32(tab_visual_index);
@@ -172,9 +173,9 @@ scoped_ptr<base::DictionaryValue> SessionTabToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> SessionWindowToValue(
+std::unique_ptr<base::DictionaryValue> SessionWindowToValue(
const sync_pb::SessionWindow& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT32(window_id);
SET_INT32(selected_tab_index);
SET_INT32_REP(tab);
@@ -182,9 +183,9 @@ scoped_ptr<base::DictionaryValue> SessionWindowToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> TabNavigationToValue(
+std::unique_ptr<base::DictionaryValue> TabNavigationToValue(
const sync_pb::TabNavigation& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(virtual_url);
SET_STR(referrer);
SET_STR(title);
@@ -211,16 +212,16 @@ scoped_ptr<base::DictionaryValue> TabNavigationToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> NavigationRedirectToValue(
+std::unique_ptr<base::DictionaryValue> NavigationRedirectToValue(
const sync_pb::NavigationRedirect& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(url);
return value;
}
-scoped_ptr<base::DictionaryValue> PasswordSpecificsDataToValue(
+std::unique_ptr<base::DictionaryValue> PasswordSpecificsDataToValue(
const sync_pb::PasswordSpecificsData& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT32(scheme);
SET_STR(signon_realm);
SET_STR(origin);
@@ -241,26 +242,26 @@ scoped_ptr<base::DictionaryValue> PasswordSpecificsDataToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> GlobalIdDirectiveToValue(
+std::unique_ptr<base::DictionaryValue> GlobalIdDirectiveToValue(
const sync_pb::GlobalIdDirective& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT64_REP(global_id);
SET_INT64(start_time_usec);
SET_INT64(end_time_usec);
return value;
}
-scoped_ptr<base::DictionaryValue> TimeRangeDirectiveToValue(
+std::unique_ptr<base::DictionaryValue> TimeRangeDirectiveToValue(
const sync_pb::TimeRangeDirective& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT64(start_time_usec);
SET_INT64(end_time_usec);
return value;
}
-scoped_ptr<base::DictionaryValue> AppListSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> AppListSpecificsToValue(
const sync_pb::AppListSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(item_id);
SET_ENUM(item_type, GetAppListItemTypeString);
SET_STR(item_name);
@@ -270,9 +271,9 @@ scoped_ptr<base::DictionaryValue> AppListSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> AppNotificationToValue(
+std::unique_ptr<base::DictionaryValue> AppNotificationToValue(
const sync_pb::AppNotification& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(guid);
SET_STR(app_id);
SET_INT64(creation_timestamp_ms);
@@ -283,24 +284,24 @@ scoped_ptr<base::DictionaryValue> AppNotificationToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> AppSettingSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> AppSettingSpecificsToValue(
const sync_pb::AppSettingSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET(extension_setting, ExtensionSettingSpecificsToValue);
return value;
}
-scoped_ptr<base::DictionaryValue> LinkedAppIconInfoToValue(
+std::unique_ptr<base::DictionaryValue> LinkedAppIconInfoToValue(
const sync_pb::LinkedAppIconInfo& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(url);
SET_INT32(size);
return value;
}
-scoped_ptr<base::DictionaryValue> AppSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> AppSpecificsToValue(
const sync_pb::AppSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET(extension, ExtensionSpecificsToValue);
SET(notification_settings, AppSettingsToValue);
SET_STR(app_launch_ordinal);
@@ -314,9 +315,9 @@ scoped_ptr<base::DictionaryValue> AppSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> AutofillSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> AutofillSpecificsToValue(
const sync_pb::AutofillSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(name);
SET_STR(value);
SET_INT64_REP(usage_timestamp);
@@ -324,9 +325,9 @@ scoped_ptr<base::DictionaryValue> AutofillSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> AutofillProfileSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> AutofillProfileSpecificsToValue(
const sync_pb::AutofillProfileSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(guid);
SET_STR(origin);
SET_INT64(use_count);
@@ -355,9 +356,9 @@ scoped_ptr<base::DictionaryValue> AutofillProfileSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> WalletMetadataSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> WalletMetadataSpecificsToValue(
const sync_pb::WalletMetadataSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_ENUM(type, GetWalletMetadataTypeString);
SET_STR(id);
SET_INT64(use_count);
@@ -365,9 +366,9 @@ scoped_ptr<base::DictionaryValue> WalletMetadataSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> AutofillWalletSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> AutofillWalletSpecificsToValue(
const sync_pb::AutofillWalletSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_ENUM(type, GetWalletInfoTypeString);
if (proto.type() == sync_pb::AutofillWalletSpecifics::MASKED_CREDIT_CARD) {
@@ -380,17 +381,17 @@ scoped_ptr<base::DictionaryValue> AutofillWalletSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> MetaInfoToValue(
+std::unique_ptr<base::DictionaryValue> MetaInfoToValue(
const sync_pb::MetaInfo& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(key);
SET_STR(value);
return value;
}
-scoped_ptr<base::DictionaryValue> BookmarkSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> BookmarkSpecificsToValue(
const sync_pb::BookmarkSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(url);
SET_BYTES(favicon);
SET_STR(title);
@@ -400,9 +401,9 @@ scoped_ptr<base::DictionaryValue> BookmarkSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> DeviceInfoSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> DeviceInfoSpecificsToValue(
const sync_pb::DeviceInfoSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(cache_guid);
SET_STR(client_name);
SET_ENUM(device_type, GetDeviceTypeString);
@@ -412,18 +413,18 @@ scoped_ptr<base::DictionaryValue> DeviceInfoSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> DictionarySpecificsToValue(
+std::unique_ptr<base::DictionaryValue> DictionarySpecificsToValue(
const sync_pb::DictionarySpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(word);
return value;
}
namespace {
-scoped_ptr<base::DictionaryValue> FaviconSyncFlagsToValue(
+std::unique_ptr<base::DictionaryValue> FaviconSyncFlagsToValue(
const sync_pb::FaviconSyncFlags& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_BOOL(enabled);
SET_INT32(favicon_sync_limit);
return value;
@@ -431,9 +432,9 @@ scoped_ptr<base::DictionaryValue> FaviconSyncFlagsToValue(
} // namespace
-scoped_ptr<base::DictionaryValue> ExperimentsSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> ExperimentsSpecificsToValue(
const sync_pb::ExperimentsSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_EXPERIMENT_ENABLED_FIELD(keystore_encryption);
SET_EXPERIMENT_ENABLED_FIELD(history_delete_directives);
SET_EXPERIMENT_ENABLED_FIELD(autofill_culling);
@@ -444,18 +445,18 @@ scoped_ptr<base::DictionaryValue> ExperimentsSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> ExtensionSettingSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> ExtensionSettingSpecificsToValue(
const sync_pb::ExtensionSettingSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(extension_id);
SET_STR(key);
SET_STR(value);
return value;
}
-scoped_ptr<base::DictionaryValue> ExtensionSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> ExtensionSpecificsToValue(
const sync_pb::ExtensionSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(id);
SET_STR(version);
SET_STR(update_url);
@@ -470,9 +471,9 @@ scoped_ptr<base::DictionaryValue> ExtensionSpecificsToValue(
}
namespace {
-scoped_ptr<base::DictionaryValue> FaviconDataToValue(
+std::unique_ptr<base::DictionaryValue> FaviconDataToValue(
const sync_pb::FaviconData& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_BYTES(favicon);
SET_INT32(width);
SET_INT32(height);
@@ -480,9 +481,9 @@ scoped_ptr<base::DictionaryValue> FaviconDataToValue(
}
} // namespace
-scoped_ptr<base::DictionaryValue> FaviconImageSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> FaviconImageSpecificsToValue(
const sync_pb::FaviconImageSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(favicon_url);
SET(favicon_web, FaviconDataToValue);
SET(favicon_web_32, FaviconDataToValue);
@@ -491,34 +492,34 @@ scoped_ptr<base::DictionaryValue> FaviconImageSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> FaviconTrackingSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> FaviconTrackingSpecificsToValue(
const sync_pb::FaviconTrackingSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(favicon_url);
SET_INT64(last_visit_time_ms)
SET_BOOL(is_bookmarked);
return value;
}
-scoped_ptr<base::DictionaryValue> HistoryDeleteDirectiveSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> HistoryDeleteDirectiveSpecificsToValue(
const sync_pb::HistoryDeleteDirectiveSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET(global_id_directive, GlobalIdDirectiveToValue);
SET(time_range_directive, TimeRangeDirectiveToValue);
return value;
}
-scoped_ptr<base::DictionaryValue> ManagedUserSettingSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> ManagedUserSettingSpecificsToValue(
const sync_pb::ManagedUserSettingSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(name);
SET_STR(value);
return value;
}
-scoped_ptr<base::DictionaryValue> ManagedUserSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> ManagedUserSpecificsToValue(
const sync_pb::ManagedUserSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(id);
SET_STR(name);
SET_BOOL(acknowledged);
@@ -528,9 +529,9 @@ scoped_ptr<base::DictionaryValue> ManagedUserSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> ManagedUserSharedSettingSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> ManagedUserSharedSettingSpecificsToValue(
const sync_pb::ManagedUserSharedSettingSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(mu_id);
SET_STR(key);
SET_STR(value);
@@ -538,17 +539,17 @@ scoped_ptr<base::DictionaryValue> ManagedUserSharedSettingSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> ManagedUserWhitelistSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> ManagedUserWhitelistSpecificsToValue(
const sync_pb::ManagedUserWhitelistSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(id);
SET_STR(name);
return value;
}
-scoped_ptr<base::DictionaryValue> NigoriSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> NigoriSpecificsToValue(
const sync_pb::NigoriSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET(encryption_keybag, EncryptedDataToValue);
SET_BOOL(keybag_is_frozen);
SET_BOOL(encrypt_bookmarks);
@@ -576,57 +577,58 @@ scoped_ptr<base::DictionaryValue> NigoriSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> ArticlePageToValue(
+std::unique_ptr<base::DictionaryValue> ArticlePageToValue(
const sync_pb::ArticlePage& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(url);
return value;
}
-scoped_ptr<base::DictionaryValue> ArticleSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> ArticleSpecificsToValue(
const sync_pb::ArticleSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(entry_id);
SET_STR(title);
SET_REP(pages, ArticlePageToValue);
return value;
}
-scoped_ptr<base::DictionaryValue> PasswordSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> PasswordSpecificsToValue(
const sync_pb::PasswordSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET(encrypted, EncryptedDataToValue);
return value;
}
-scoped_ptr<base::DictionaryValue> PreferenceSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> PreferenceSpecificsToValue(
const sync_pb::PreferenceSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(name);
SET_STR(value);
return value;
}
-scoped_ptr<base::DictionaryValue> PriorityPreferenceSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> PriorityPreferenceSpecificsToValue(
const sync_pb::PriorityPreferenceSpecifics& specifics) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_FIELD(preference, PreferenceSpecificsToValue);
return value;
}
-scoped_ptr<base::DictionaryValue> SyncedNotificationAppInfoSpecificsToValue(
+std::unique_ptr<base::DictionaryValue>
+SyncedNotificationAppInfoSpecificsToValue(
const sync_pb::SyncedNotificationAppInfoSpecifics& proto) {
- return make_scoped_ptr(new base::DictionaryValue());
+ return base::WrapUnique(new base::DictionaryValue());
}
-scoped_ptr<base::DictionaryValue> SyncedNotificationSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> SyncedNotificationSpecificsToValue(
const sync_pb::SyncedNotificationSpecifics& proto) {
- return make_scoped_ptr(new base::DictionaryValue());
+ return base::WrapUnique(new base::DictionaryValue());
}
-scoped_ptr<base::DictionaryValue> SearchEngineSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> SearchEngineSpecificsToValue(
const sync_pb::SearchEngineSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(short_name);
SET_STR(keyword);
SET_STR(favicon_url);
@@ -653,9 +655,9 @@ scoped_ptr<base::DictionaryValue> SearchEngineSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> SessionSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> SessionSpecificsToValue(
const sync_pb::SessionSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(session_tag);
SET(header, SessionHeaderToValue);
SET(tab, SessionTabToValue);
@@ -663,9 +665,9 @@ scoped_ptr<base::DictionaryValue> SessionSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> ThemeSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> ThemeSpecificsToValue(
const sync_pb::ThemeSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_BOOL(use_custom_theme);
SET_BOOL(use_system_theme_by_default);
SET_STR(custom_theme_name);
@@ -674,9 +676,9 @@ scoped_ptr<base::DictionaryValue> ThemeSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> TypedUrlSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> TypedUrlSpecificsToValue(
const sync_pb::TypedUrlSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(url);
SET_STR(title);
SET_BOOL(hidden);
@@ -685,9 +687,9 @@ scoped_ptr<base::DictionaryValue> TypedUrlSpecificsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> WalletMaskedCreditCardToValue(
+std::unique_ptr<base::DictionaryValue> WalletMaskedCreditCardToValue(
const sync_pb::WalletMaskedCreditCard& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(id);
SET_ENUM(status, GetWalletCardStatusString);
SET_STR(name_on_card);
@@ -698,9 +700,9 @@ scoped_ptr<base::DictionaryValue> WalletMaskedCreditCardToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> WalletPostalAddressToValue(
+std::unique_ptr<base::DictionaryValue> WalletPostalAddressToValue(
const sync_pb::WalletPostalAddress& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(recipient_name);
SET_STR(company_name);
SET_STR_REP(street_address);
@@ -716,18 +718,18 @@ scoped_ptr<base::DictionaryValue> WalletPostalAddressToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> WifiCredentialSpecificsToValue(
+std::unique_ptr<base::DictionaryValue> WifiCredentialSpecificsToValue(
const sync_pb::WifiCredentialSpecifics& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_BYTES(ssid);
SET_ENUM(security_class, GetWifiCredentialSecurityClassString);
SET_BYTES(passphrase);
return value;
}
-scoped_ptr<base::DictionaryValue> EntitySpecificsToValue(
+std::unique_ptr<base::DictionaryValue> EntitySpecificsToValue(
const sync_pb::EntitySpecifics& specifics) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_FIELD(app, AppSpecificsToValue);
SET_FIELD(app_list, AppListSpecificsToValue);
SET_FIELD(app_notification, AppNotificationToValue);
@@ -776,10 +778,10 @@ base::StringValue* UniquePositionToStringValue(
} // namespace
-scoped_ptr<base::DictionaryValue> SyncEntityToValue(
+std::unique_ptr<base::DictionaryValue> SyncEntityToValue(
const sync_pb::SyncEntity& proto,
bool include_specifics) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(id_string);
SET_STR(parent_id_string);
SET_STR(old_parent_id);
@@ -818,18 +820,18 @@ base::ListValue* SyncEntitiesToValue(
return list;
}
-scoped_ptr<base::DictionaryValue> ChromiumExtensionActivityToValue(
+std::unique_ptr<base::DictionaryValue> ChromiumExtensionActivityToValue(
const sync_pb::ChromiumExtensionsActivity& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(extension_id);
SET_INT32(bookmark_writes_since_last_commit);
return value;
}
-scoped_ptr<base::DictionaryValue> CommitMessageToValue(
+std::unique_ptr<base::DictionaryValue> CommitMessageToValue(
const sync_pb::CommitMessage& proto,
bool include_specifics) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
value->Set("entries",
SyncEntitiesToValue(proto.entries(), include_specifics));
SET_STR(cache_guid);
@@ -838,9 +840,9 @@ scoped_ptr<base::DictionaryValue> CommitMessageToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> GetUpdateTriggersToValue(
+std::unique_ptr<base::DictionaryValue> GetUpdateTriggersToValue(
const sync_pb::GetUpdateTriggers& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR_REP(notification_hint);
SET_BOOL(client_dropped_hints);
SET_BOOL(invalidations_out_of_sync);
@@ -849,9 +851,9 @@ scoped_ptr<base::DictionaryValue> GetUpdateTriggersToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> DataTypeProgressMarkerToValue(
+std::unique_ptr<base::DictionaryValue> DataTypeProgressMarkerToValue(
const sync_pb::DataTypeProgressMarker& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT32(data_type_id);
SET_BYTES(token);
SET_INT64(timestamp_token_for_migration);
@@ -860,26 +862,26 @@ scoped_ptr<base::DictionaryValue> DataTypeProgressMarkerToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> DataTypeContextToValue(
+std::unique_ptr<base::DictionaryValue> DataTypeContextToValue(
const sync_pb::DataTypeContext& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT32(data_type_id);
SET_STR(context);
SET_INT64(version);
return value;
}
-scoped_ptr<base::DictionaryValue> GetUpdatesCallerInfoToValue(
+std::unique_ptr<base::DictionaryValue> GetUpdatesCallerInfoToValue(
const sync_pb::GetUpdatesCallerInfo& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_ENUM(source, GetUpdatesSourceString);
SET_BOOL(notifications_enabled);
return value;
}
-scoped_ptr<base::DictionaryValue> GetUpdatesMessageToValue(
+std::unique_ptr<base::DictionaryValue> GetUpdatesMessageToValue(
const sync_pb::GetUpdatesMessage& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET(caller_info, GetUpdatesCallerInfoToValue);
SET_BOOL(fetch_folders);
SET_INT32(batch_size);
@@ -892,16 +894,16 @@ scoped_ptr<base::DictionaryValue> GetUpdatesMessageToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> ClientStatusToValue(
+std::unique_ptr<base::DictionaryValue> ClientStatusToValue(
const sync_pb::ClientStatus& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_BOOL(hierarchy_conflict_detected);
return value;
}
-scoped_ptr<base::DictionaryValue> EntryResponseToValue(
+std::unique_ptr<base::DictionaryValue> EntryResponseToValue(
const sync_pb::CommitResponse::EntryResponse& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_ENUM(response_type, GetResponseTypeString);
SET_STR(id_string);
SET_STR(parent_id_string);
@@ -913,17 +915,17 @@ scoped_ptr<base::DictionaryValue> EntryResponseToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> CommitResponseToValue(
+std::unique_ptr<base::DictionaryValue> CommitResponseToValue(
const sync_pb::CommitResponse& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_REP(entryresponse, EntryResponseToValue);
return value;
}
-scoped_ptr<base::DictionaryValue> GetUpdatesResponseToValue(
+std::unique_ptr<base::DictionaryValue> GetUpdatesResponseToValue(
const sync_pb::GetUpdatesResponse& proto,
bool include_specifics) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
value->Set("entries",
SyncEntitiesToValue(proto.entries(), include_specifics));
SET_INT64(changes_remaining);
@@ -932,9 +934,9 @@ scoped_ptr<base::DictionaryValue> GetUpdatesResponseToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> ClientCommandToValue(
+std::unique_ptr<base::DictionaryValue> ClientCommandToValue(
const sync_pb::ClientCommand& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT32(set_sync_poll_interval);
SET_INT32(set_sync_long_poll_interval);
SET_INT32(max_commit_batch_size);
@@ -944,9 +946,9 @@ scoped_ptr<base::DictionaryValue> ClientCommandToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> ErrorToValue(
+std::unique_ptr<base::DictionaryValue> ErrorToValue(
const sync_pb::ClientToServerResponse::Error& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_ENUM(error_type, GetErrorTypeString);
SET_STR(error_description);
SET_STR(url);
@@ -956,10 +958,10 @@ scoped_ptr<base::DictionaryValue> ErrorToValue(
} // namespace
-scoped_ptr<base::DictionaryValue> ClientToServerResponseToValue(
+std::unique_ptr<base::DictionaryValue> ClientToServerResponseToValue(
const sync_pb::ClientToServerResponse& proto,
bool include_specifics) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET(commit, CommitResponseToValue);
if (proto.has_get_updates()) {
value->Set("get_updates", GetUpdatesResponseToValue(proto.get_updates(),
@@ -975,10 +977,10 @@ scoped_ptr<base::DictionaryValue> ClientToServerResponseToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> ClientToServerMessageToValue(
+std::unique_ptr<base::DictionaryValue> ClientToServerMessageToValue(
const sync_pb::ClientToServerMessage& proto,
bool include_specifics) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(share);
SET_INT32(protocol_version);
if (proto.has_commit()) {
@@ -994,9 +996,9 @@ scoped_ptr<base::DictionaryValue> ClientToServerMessageToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> DatatypeAssociationStatsToValue(
+std::unique_ptr<base::DictionaryValue> DatatypeAssociationStatsToValue(
const sync_pb::DatatypeAssociationStats& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT32(data_type_id);
SET_INT32(num_local_items_before_association);
SET_INT32(num_sync_items_before_association);
@@ -1018,9 +1020,9 @@ scoped_ptr<base::DictionaryValue> DatatypeAssociationStatsToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> DebugEventInfoToValue(
+std::unique_ptr<base::DictionaryValue> DebugEventInfoToValue(
const sync_pb::DebugEventInfo& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_ENUM(singleton_event, SingletonDebugEventTypeString);
SET(sync_cycle_completed_event_info, SyncCycleCompletedEventInfoToValue);
SET_INT32(nudging_datatype);
@@ -1029,9 +1031,9 @@ scoped_ptr<base::DictionaryValue> DebugEventInfoToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> DebugInfoToValue(
+std::unique_ptr<base::DictionaryValue> DebugInfoToValue(
const sync_pb::DebugInfo& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_REP(events, DebugEventInfoToValue);
SET_BOOL(cryptographer_ready);
SET_BOOL(cryptographer_has_pending_keys);
@@ -1039,9 +1041,9 @@ scoped_ptr<base::DictionaryValue> DebugInfoToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> SyncCycleCompletedEventInfoToValue(
+std::unique_ptr<base::DictionaryValue> SyncCycleCompletedEventInfoToValue(
const sync_pb::SyncCycleCompletedEventInfo& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT32(num_encryption_conflicts);
SET_INT32(num_hierarchy_conflicts);
SET_INT32(num_server_conflicts);
@@ -1051,18 +1053,18 @@ scoped_ptr<base::DictionaryValue> SyncCycleCompletedEventInfoToValue(
return value;
}
-scoped_ptr<base::DictionaryValue> ClientConfigParamsToValue(
+std::unique_ptr<base::DictionaryValue> ClientConfigParamsToValue(
const sync_pb::ClientConfigParams& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_INT32_REP(enabled_type_ids);
SET_BOOL(tabs_datatype_enabled);
SET_BOOL(cookie_jar_mismatch);
return value;
}
-scoped_ptr<base::DictionaryValue> AttachmentIdProtoToValue(
+std::unique_ptr<base::DictionaryValue> AttachmentIdProtoToValue(
const sync_pb::AttachmentIdProto& proto) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
SET_STR(unique_id);
return value;
}

Powered by Google App Engine
This is Rietveld 408576698