| 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/syncable/directory_manager.h" | 5 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <iterator> | 9 #include <iterator> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 return FilePath(kSyncDataDatabaseFilename); | 26 return FilePath(kSyncDataDatabaseFilename); |
| 27 } | 27 } |
| 28 | 28 |
| 29 const FilePath DirectoryManager::GetSyncDataDatabasePath() const { | 29 const FilePath DirectoryManager::GetSyncDataDatabasePath() const { |
| 30 return root_path_.Append(GetSyncDataDatabaseFilename()); | 30 return root_path_.Append(GetSyncDataDatabaseFilename()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 DirectoryManager::DirectoryManager(const FilePath& path) | 33 DirectoryManager::DirectoryManager(const FilePath& path) |
| 34 : root_path_(path), | 34 : root_path_(path), |
| 35 managed_directory_(NULL), | 35 managed_directory_(NULL), |
| 36 cryptographer_(new Cryptographer) { | 36 cryptographer_(new Cryptographer()) { |
| 37 } | 37 } |
| 38 | 38 |
| 39 DirectoryManager::~DirectoryManager() { | 39 DirectoryManager::~DirectoryManager() { |
| 40 base::AutoLock lock(lock_); | 40 base::AutoLock lock(lock_); |
| 41 DCHECK_EQ(managed_directory_, static_cast<Directory*>(NULL)) | 41 DCHECK_EQ(managed_directory_, static_cast<Directory*>(NULL)) |
| 42 << "Dir " << managed_directory_->name() << " not closed!"; | 42 << "Dir " << managed_directory_->name() << " not closed!"; |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool DirectoryManager::Open(const std::string& name, | 45 bool DirectoryManager::Open(const std::string& name, |
| 46 DirectoryChangeDelegate* delegate) { | 46 DirectoryChangeDelegate* delegate) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return dir_; | 129 return dir_; |
| 130 } | 130 } |
| 131 | 131 |
| 132 ScopedDirLookup::operator Directory* () const { | 132 ScopedDirLookup::operator Directory* () const { |
| 133 CHECK(good_checked_); | 133 CHECK(good_checked_); |
| 134 DCHECK(good_); | 134 DCHECK(good_); |
| 135 return dir_; | 135 return dir_; |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace syncable | 138 } // namespace syncable |
| OLD | NEW |