| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/sync/api/sync_change.h" | 9 #include "chrome/browser/sync/api/sync_change.h" |
| 10 #include "chrome/browser/sync/api/sync_error.h" | 10 #include "chrome/browser/sync/api/sync_error.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // children. | 245 // children. |
| 246 *has_nodes = type_root_node.HasChildren(); | 246 *has_nodes = type_root_node.HasChildren(); |
| 247 return true; | 247 return true; |
| 248 } | 248 } |
| 249 | 249 |
| 250 bool GenericChangeProcessor::CryptoReadyIfNecessary(syncable::ModelType type) { | 250 bool GenericChangeProcessor::CryptoReadyIfNecessary(syncable::ModelType type) { |
| 251 DCHECK(CalledOnValidThread()); | 251 DCHECK(CalledOnValidThread()); |
| 252 DCHECK_NE(type, syncable::UNSPECIFIED); | 252 DCHECK_NE(type, syncable::UNSPECIFIED); |
| 253 // We only access the cryptographer while holding a transaction. | 253 // We only access the cryptographer while holding a transaction. |
| 254 sync_api::ReadTransaction trans(FROM_HERE, share_handle()); | 254 sync_api::ReadTransaction trans(FROM_HERE, share_handle()); |
| 255 const syncable::ModelTypeSet& encrypted_types = | 255 const syncable::ModelEnumSet encrypted_types = GetEncryptedTypes(&trans); |
| 256 GetEncryptedTypes(&trans); | 256 return !encrypted_types.Has(type) || |
| 257 return encrypted_types.count(type) == 0 || | |
| 258 trans.GetCryptographer()->is_ready(); | 257 trans.GetCryptographer()->is_ready(); |
| 259 } | 258 } |
| 260 | 259 |
| 261 void GenericChangeProcessor::StartImpl(Profile* profile) { | 260 void GenericChangeProcessor::StartImpl(Profile* profile) { |
| 262 DCHECK(CalledOnValidThread()); | 261 DCHECK(CalledOnValidThread()); |
| 263 } | 262 } |
| 264 | 263 |
| 265 void GenericChangeProcessor::StopImpl() { | 264 void GenericChangeProcessor::StopImpl() { |
| 266 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 265 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 267 } | 266 } |
| 268 | 267 |
| 269 sync_api::UserShare* GenericChangeProcessor::share_handle() const { | 268 sync_api::UserShare* GenericChangeProcessor::share_handle() const { |
| 270 DCHECK(CalledOnValidThread()); | 269 DCHECK(CalledOnValidThread()); |
| 271 return share_handle_; | 270 return share_handle_; |
| 272 } | 271 } |
| 273 | 272 |
| 274 } // namespace browser_sync | 273 } // namespace browser_sync |
| OLD | NEW |