| OLD | NEW |
| 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 #include "components/sync/protocol/proto_value_conversions.h" | 5 #include "components/sync/protocol/proto_value_conversions.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 return base::MakeUnique<base::StringValue>(base::Int64ToString(value)); | 252 return base::MakeUnique<base::StringValue>(base::Int64ToString(value)); |
| 253 } | 253 } |
| 254 std::unique_ptr<base::Value> ToValue(uint32_t value) const { | 254 std::unique_ptr<base::Value> ToValue(uint32_t value) const { |
| 255 return base::MakeUnique<base::StringValue>(base::Int64ToString(value)); | 255 return base::MakeUnique<base::StringValue>(base::Int64ToString(value)); |
| 256 } | 256 } |
| 257 std::unique_ptr<base::Value> ToValue(int32_t value) const { | 257 std::unique_ptr<base::Value> ToValue(int32_t value) const { |
| 258 return base::MakeUnique<base::StringValue>(base::Int64ToString(value)); | 258 return base::MakeUnique<base::StringValue>(base::Int64ToString(value)); |
| 259 } | 259 } |
| 260 | 260 |
| 261 std::unique_ptr<base::Value> ToValue(bool value) const { | 261 std::unique_ptr<base::Value> ToValue(bool value) const { |
| 262 return base::MakeUnique<base::FundamentalValue>(value); | 262 return base::MakeUnique<base::Value>(value); |
| 263 } | 263 } |
| 264 std::unique_ptr<base::Value> ToValue(float value) const { | 264 std::unique_ptr<base::Value> ToValue(float value) const { |
| 265 return base::MakeUnique<base::FundamentalValue>(value); | 265 return base::MakeUnique<base::Value>(value); |
| 266 } | 266 } |
| 267 std::unique_ptr<base::Value> ToValue(double value) const { | 267 std::unique_ptr<base::Value> ToValue(double value) const { |
| 268 return base::MakeUnique<base::FundamentalValue>(value); | 268 return base::MakeUnique<base::Value>(value); |
| 269 } | 269 } |
| 270 | 270 |
| 271 // Needs to be here to see all ToValue() overloads above. | 271 // Needs to be here to see all ToValue() overloads above. |
| 272 template <class P, class F> | 272 template <class P, class F> |
| 273 void VisitImpl(P&, const char* field_name, const F& field) { | 273 void VisitImpl(P&, const char* field_name, const F& field) { |
| 274 value_->Set(field_name, ToValue(field)); | 274 value_->Set(field_name, ToValue(field)); |
| 275 } | 275 } |
| 276 | 276 |
| 277 base::DictionaryValue* value_; | 277 base::DictionaryValue* value_; |
| 278 bool include_specifics_; | 278 bool include_specifics_; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 IMPLEMENT_PROTO_TO_VALUE(WifiCredentialSpecifics) | 353 IMPLEMENT_PROTO_TO_VALUE(WifiCredentialSpecifics) |
| 354 | 354 |
| 355 IMPLEMENT_PROTO_TO_VALUE_INCLUDE_SPECIFICS(ClientToServerMessage) | 355 IMPLEMENT_PROTO_TO_VALUE_INCLUDE_SPECIFICS(ClientToServerMessage) |
| 356 IMPLEMENT_PROTO_TO_VALUE_INCLUDE_SPECIFICS(ClientToServerResponse) | 356 IMPLEMENT_PROTO_TO_VALUE_INCLUDE_SPECIFICS(ClientToServerResponse) |
| 357 IMPLEMENT_PROTO_TO_VALUE_INCLUDE_SPECIFICS(SyncEntity) | 357 IMPLEMENT_PROTO_TO_VALUE_INCLUDE_SPECIFICS(SyncEntity) |
| 358 | 358 |
| 359 #undef IMPLEMENT_PROTO_TO_VALUE | 359 #undef IMPLEMENT_PROTO_TO_VALUE |
| 360 #undef IMPLEMENT_PROTO_TO_VALUE_INCLUDE_SPECIFICS | 360 #undef IMPLEMENT_PROTO_TO_VALUE_INCLUDE_SPECIFICS |
| 361 | 361 |
| 362 } // namespace syncer | 362 } // namespace syncer |
| OLD | NEW |