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

Side by Side Diff: sync/internal_api/syncapi_internal.cc

Issue 10795018: [Sync] Remove unneeded 'using syncer::' lines and 'syncer::' scopings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fiix indent Created 8 years, 5 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
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/internal_api/syncapi_internal.h" 5 #include "sync/internal_api/syncapi_internal.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "sync/protocol/password_specifics.pb.h" 8 #include "sync/protocol/password_specifics.pb.h"
9 #include "sync/protocol/sync.pb.h" 9 #include "sync/protocol/sync.pb.h"
10 #include "sync/util/cryptographer.h" 10 #include "sync/util/cryptographer.h"
11 11
12 using syncer::Cryptographer;
13
14 namespace syncer { 12 namespace syncer {
15 13
16 sync_pb::PasswordSpecificsData* DecryptPasswordSpecifics( 14 sync_pb::PasswordSpecificsData* DecryptPasswordSpecifics(
17 const sync_pb::EntitySpecifics& specifics, Cryptographer* crypto) { 15 const sync_pb::EntitySpecifics& specifics, Cryptographer* crypto) {
18 if (!specifics.has_password()) 16 if (!specifics.has_password())
19 return NULL; 17 return NULL;
20 const sync_pb::PasswordSpecifics& password_specifics = specifics.password(); 18 const sync_pb::PasswordSpecifics& password_specifics = specifics.password();
21 if (!password_specifics.has_encrypted()) 19 if (!password_specifics.has_encrypted())
22 return NULL; 20 return NULL;
23 const sync_pb::EncryptedData& encrypted = password_specifics.encrypted(); 21 const sync_pb::EncryptedData& encrypted = password_specifics.encrypted();
(...skipping 23 matching lines...) Expand all
47 bool IsNameServerIllegalAfterTrimming(const std::string& name) { 45 bool IsNameServerIllegalAfterTrimming(const std::string& name) {
48 size_t untrimmed_count = name.find_last_not_of(' ') + 1; 46 size_t untrimmed_count = name.find_last_not_of(' ') + 1;
49 for (size_t i = 0; i < arraysize(kForbiddenServerNames); ++i) { 47 for (size_t i = 0; i < arraysize(kForbiddenServerNames); ++i) {
50 if (name.compare(0, untrimmed_count, kForbiddenServerNames[i]) == 0) 48 if (name.compare(0, untrimmed_count, kForbiddenServerNames[i]) == 0)
51 return true; 49 return true;
52 } 50 }
53 return false; 51 return false;
54 } 52 }
55 53
56 // Compare the values of two EntitySpecifics, accounting for encryption. 54 // Compare the values of two EntitySpecifics, accounting for encryption.
57 bool AreSpecificsEqual(const syncer::Cryptographer* cryptographer, 55 bool AreSpecificsEqual(const Cryptographer* cryptographer,
58 const sync_pb::EntitySpecifics& left, 56 const sync_pb::EntitySpecifics& left,
59 const sync_pb::EntitySpecifics& right) { 57 const sync_pb::EntitySpecifics& right) {
60 // Note that we can't compare encrypted strings directly as they are seeded 58 // Note that we can't compare encrypted strings directly as they are seeded
61 // with a random value. 59 // with a random value.
62 std::string left_plaintext, right_plaintext; 60 std::string left_plaintext, right_plaintext;
63 if (left.has_encrypted()) { 61 if (left.has_encrypted()) {
64 if (!cryptographer->CanDecrypt(left.encrypted())) { 62 if (!cryptographer->CanDecrypt(left.encrypted())) {
65 NOTREACHED() << "Attempting to compare undecryptable data."; 63 NOTREACHED() << "Attempting to compare undecryptable data.";
66 return false; 64 return false;
67 } 65 }
(...skipping 10 matching lines...) Expand all
78 } else { 76 } else {
79 right_plaintext = right.SerializeAsString(); 77 right_plaintext = right.SerializeAsString();
80 } 78 }
81 if (left_plaintext == right_plaintext) { 79 if (left_plaintext == right_plaintext) {
82 return true; 80 return true;
83 } 81 }
84 return false; 82 return false;
85 } 83 }
86 84
87 } // namespace syncer 85 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/syncapi_internal.h ('k') | sync/internal_api/syncapi_server_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698