| 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/typed_url_model_associator.h" | 5 #include "chrome/browser/sync/glue/typed_url_model_associator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 previous_visit_time = visit->visit_time.ToInternalValue(); | 55 previous_visit_time = visit->visit_time.ToInternalValue(); |
| 56 } | 56 } |
| 57 return true; | 57 return true; |
| 58 } | 58 } |
| 59 | 59 |
| 60 TypedUrlModelAssociator::TypedUrlModelAssociator( | 60 TypedUrlModelAssociator::TypedUrlModelAssociator( |
| 61 ProfileSyncService* sync_service, | 61 ProfileSyncService* sync_service, |
| 62 history::HistoryBackend* history_backend, | 62 history::HistoryBackend* history_backend, |
| 63 DataTypeErrorHandler* error_handler) | 63 sync_driver::DataTypeErrorHandler* error_handler) |
| 64 : sync_service_(sync_service), | 64 : sync_service_(sync_service), |
| 65 history_backend_(history_backend), | 65 history_backend_(history_backend), |
| 66 expected_loop_(base::MessageLoop::current()), | 66 expected_loop_(base::MessageLoop::current()), |
| 67 abort_requested_(false), | 67 abort_requested_(false), |
| 68 error_handler_(error_handler), | 68 error_handler_(error_handler), |
| 69 num_db_accesses_(0), | 69 num_db_accesses_(0), |
| 70 num_db_errors_(0) { | 70 num_db_errors_(0) { |
| 71 DCHECK(sync_service_); | 71 DCHECK(sync_service_); |
| 72 // history_backend_ may be null for unit tests (since it's not mockable). | 72 // history_backend_ may be null for unit tests (since it's not mockable). |
| 73 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); | 73 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 | 833 |
| 834 bool TypedUrlModelAssociator::CryptoReadyIfNecessary() { | 834 bool TypedUrlModelAssociator::CryptoReadyIfNecessary() { |
| 835 // We only access the cryptographer while holding a transaction. | 835 // We only access the cryptographer while holding a transaction. |
| 836 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 836 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
| 837 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); | 837 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); |
| 838 return !encrypted_types.Has(syncer::TYPED_URLS) || | 838 return !encrypted_types.Has(syncer::TYPED_URLS) || |
| 839 sync_service_->IsCryptographerReady(&trans); | 839 sync_service_->IsCryptographerReady(&trans); |
| 840 } | 840 } |
| 841 | 841 |
| 842 } // namespace browser_sync | 842 } // namespace browser_sync |
| OLD | NEW |