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

Side by Side Diff: sync/syncable/entry_kernel.cc

Issue 12258039: enable -Wstring-conversion when compiling with clang (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: enable on mac, better fix in web_data_service Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « skia/skia.gyp ('k') | third_party/libjingle/libjingle.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "sync/syncable/entry_kernel.h" 5 #include "sync/syncable/entry_kernel.h"
6 6
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "sync/protocol/proto_value_conversions.h" 8 #include "sync/protocol/proto_value_conversions.h"
9 #include "sync/syncable/syncable_enum_conversions.h" 9 #include "sync/syncable/syncable_enum_conversions.h"
10 #include "sync/util/cryptographer.h" 10 #include "sync/util/cryptographer.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const std::string& key = GetProtoFieldString(field); 67 const std::string& key = GetProtoFieldString(field);
68 68
69 base::DictionaryValue* value = NULL; 69 base::DictionaryValue* value = NULL;
70 sync_pb::EntitySpecifics decrypted; 70 sync_pb::EntitySpecifics decrypted;
71 const sync_pb::EncryptedData& encrypted = kernel.ref(field).encrypted(); 71 const sync_pb::EncryptedData& encrypted = kernel.ref(field).encrypted();
72 if (cryptographer && 72 if (cryptographer &&
73 kernel.ref(field).has_encrypted() && 73 kernel.ref(field).has_encrypted() &&
74 cryptographer->CanDecrypt(encrypted) && 74 cryptographer->CanDecrypt(encrypted) &&
75 cryptographer->Decrypt(encrypted, &decrypted)) { 75 cryptographer->Decrypt(encrypted, &decrypted)) {
76 value = EntitySpecificsToValue(decrypted); 76 value = EntitySpecificsToValue(decrypted);
77 value->SetBoolean("encrypted", "true"); 77 value->SetBoolean("encrypted", true);
78 } else { 78 } else {
79 value = EntitySpecificsToValue(kernel.ref(field)); 79 value = EntitySpecificsToValue(kernel.ref(field));
80 } 80 }
81 dictionary_value->Set(key, value); 81 dictionary_value->Set(key, value);
82 } 82 }
83 } 83 }
84 84
85 // Helper functions for SetFieldValues(). 85 // Helper functions for SetFieldValues().
86 86
87 base::StringValue* Int64ToValue(int64 i) { 87 base::StringValue* Int64ToValue(int64 i) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 base::DictionaryValue* EntryKernelMutationToValue( 186 base::DictionaryValue* EntryKernelMutationToValue(
187 const EntryKernelMutation& mutation) { 187 const EntryKernelMutation& mutation) {
188 base::DictionaryValue* dict = new base::DictionaryValue(); 188 base::DictionaryValue* dict = new base::DictionaryValue();
189 dict->Set("original", mutation.original.ToValue(NULL)); 189 dict->Set("original", mutation.original.ToValue(NULL));
190 dict->Set("mutated", mutation.mutated.ToValue(NULL)); 190 dict->Set("mutated", mutation.mutated.ToValue(NULL));
191 return dict; 191 return dict;
192 } 192 }
193 193
194 } // namespace syncer 194 } // namespace syncer
195 } // namespace syncable 195 } // namespace syncable
OLDNEW
« no previous file with comments | « skia/skia.gyp ('k') | third_party/libjingle/libjingle.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698