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

Side by Side Diff: trunk/src/sync/protocol/proto_value_conversions.cc

Issue 101113004: Revert 239759 "The comment in base64.h implies that base::Base64..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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 | Annotate | Revision Log
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 // Keep this file in sync with the .proto files in this directory. 5 // Keep this file in sync with the .proto files in this directory.
6 6
7 #include "sync/protocol/proto_value_conversions.h" 7 #include "sync/protocol/proto_value_conversions.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // Basic Type -> Value functions. 47 // Basic Type -> Value functions.
48 48
49 base::StringValue* MakeInt64Value(int64 x) { 49 base::StringValue* MakeInt64Value(int64 x) {
50 return new base::StringValue(base::Int64ToString(x)); 50 return new base::StringValue(base::Int64ToString(x));
51 } 51 }
52 52
53 // TODO(akalin): Perhaps make JSONWriter support BinaryValue and use 53 // TODO(akalin): Perhaps make JSONWriter support BinaryValue and use
54 // that instead of a StringValue. 54 // that instead of a StringValue.
55 base::StringValue* MakeBytesValue(const std::string& bytes) { 55 base::StringValue* MakeBytesValue(const std::string& bytes) {
56 std::string bytes_base64; 56 std::string bytes_base64;
57 base::Base64Encode(bytes, &bytes_base64); 57 if (!base::Base64Encode(bytes, &bytes_base64)) {
58 NOTREACHED();
59 }
58 return new base::StringValue(bytes_base64); 60 return new base::StringValue(bytes_base64);
59 } 61 }
60 62
61 base::StringValue* MakeStringValue(const std::string& str) { 63 base::StringValue* MakeStringValue(const std::string& str) {
62 return new base::StringValue(str); 64 return new base::StringValue(str);
63 } 65 }
64 66
65 // T is the enum type. 67 // T is the enum type.
66 template <class T> 68 template <class T>
67 base::StringValue* MakeEnumValue(T t, const char* (*converter_fn)(T)) { 69 base::StringValue* MakeEnumValue(T t, const char* (*converter_fn)(T)) {
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 #undef SET_BYTES 1005 #undef SET_BYTES
1004 #undef SET_INT32 1006 #undef SET_INT32
1005 #undef SET_INT64 1007 #undef SET_INT64
1006 #undef SET_INT64_REP 1008 #undef SET_INT64_REP
1007 #undef SET_STR 1009 #undef SET_STR
1008 #undef SET_STR_REP 1010 #undef SET_STR_REP
1009 1011
1010 #undef SET_FIELD 1012 #undef SET_FIELD
1011 1013
1012 } // namespace syncer 1014 } // namespace syncer
OLDNEW
« no previous file with comments | « trunk/src/sync/internal_api/sync_encryption_handler_impl.cc ('k') | trunk/src/sync/syncable/syncable_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698