Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "sync/engine/directory_cryptographer_provider.h" | |
| 6 | |
| 7 #include "sync/syncable/directory.h" | |
| 8 #include "sync/syncable/syncable_read_transaction.h" | |
| 9 | |
| 10 namespace syncer { | |
| 11 | |
| 12 DirectoryCryptographerProvider::DirectoryCryptographerProvider( | |
| 13 syncable::Directory* dir) | |
| 14 : dir_(dir) { | |
| 15 } | |
| 16 | |
| 17 DirectoryCryptographerProvider::~DirectoryCryptographerProvider() { | |
| 18 } | |
| 19 | |
| 20 bool DirectoryCryptographerProvider::InitScopedCryptographer( | |
| 21 ScopedCryptographer* scoped) { | |
| 22 scoped->Initialize(new ScopedDirectoryCryptographerImpl(dir_)); | |
| 23 return scoped->IsValid(); | |
| 24 } | |
| 25 | |
| 26 ScopedDirectoryCryptographerImpl::ScopedDirectoryCryptographerImpl( | |
| 27 syncable::Directory* dir) | |
| 28 : dir_(dir), trans_(FROM_HERE, dir) { | |
| 29 } | |
| 30 | |
| 31 ScopedDirectoryCryptographerImpl::~ScopedDirectoryCryptographerImpl() { | |
| 32 } | |
| 33 | |
| 34 Cryptographer* ScopedDirectoryCryptographerImpl::Get() const { | |
| 35 return dir_->GetCryptographer(&trans_); | |
| 36 } | |
| 37 }; | |
|
Nicolas Zea
2014/07/24 22:16:42
here too
rlarocque
2014/07/24 22:23:13
Done.
| |
| OLD | NEW |