| 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 "chrome/browser/sync/glue/generic_change_processor.h" | 5 #include "chrome/browser/sync/glue/generic_change_processor.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 "Failed to load deleted entry for " + type_str + ".", | 361 "Failed to load deleted entry for " + type_str + ".", |
| 362 type); | 362 type); |
| 363 error_handler()->OnSingleDatatypeUnrecoverableError( | 363 error_handler()->OnSingleDatatypeUnrecoverableError( |
| 364 FROM_HERE, error.message()); | 364 FROM_HERE, error.message()); |
| 365 LOG(ERROR) << "Update: deleted entry."; | 365 LOG(ERROR) << "Update: deleted entry."; |
| 366 return error; | 366 return error; |
| 367 } else { | 367 } else { |
| 368 syncer::Cryptographer* crypto = trans.GetCryptographer(); | 368 syncer::Cryptographer* crypto = trans.GetCryptographer(); |
| 369 syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); | 369 syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); |
| 370 const sync_pb::EntitySpecifics& specifics = | 370 const sync_pb::EntitySpecifics& specifics = |
| 371 sync_node.GetEntry()->Get(syncable::SPECIFICS); | 371 sync_node.GetEntry()->Get(syncer::syncable::SPECIFICS); |
| 372 CHECK(specifics.has_encrypted()); | 372 CHECK(specifics.has_encrypted()); |
| 373 const bool can_decrypt = crypto->CanDecrypt(specifics.encrypted()); | 373 const bool can_decrypt = crypto->CanDecrypt(specifics.encrypted()); |
| 374 const bool agreement = encrypted_types.Has(type); | 374 const bool agreement = encrypted_types.Has(type); |
| 375 if (!agreement && !can_decrypt) { | 375 if (!agreement && !can_decrypt) { |
| 376 syncer::SyncError error; | 376 syncer::SyncError error; |
| 377 error.Reset(FROM_HERE, | 377 error.Reset(FROM_HERE, |
| 378 "Failed to load encrypted entry, missing key and " | 378 "Failed to load encrypted entry, missing key and " |
| 379 "nigori mismatch for " + type_str + ".", | 379 "nigori mismatch for " + type_str + ".", |
| 380 type); | 380 type); |
| 381 error_handler()->OnSingleDatatypeUnrecoverableError( | 381 error_handler()->OnSingleDatatypeUnrecoverableError( |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 void GenericChangeProcessor::StopImpl() { | 476 void GenericChangeProcessor::StopImpl() { |
| 477 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 477 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 478 } | 478 } |
| 479 | 479 |
| 480 syncer::UserShare* GenericChangeProcessor::share_handle() const { | 480 syncer::UserShare* GenericChangeProcessor::share_handle() const { |
| 481 DCHECK(CalledOnValidThread()); | 481 DCHECK(CalledOnValidThread()); |
| 482 return share_handle_; | 482 return share_handle_; |
| 483 } | 483 } |
| 484 | 484 |
| 485 } // namespace browser_sync | 485 } // namespace browser_sync |
| OLD | NEW |