| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_file_system/drive_backend/metadata_database.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 15 #include "base/message_loop/message_loop_proxy.h" | 15 #include "base/message_loop/message_loop_proxy.h" |
| 16 #include "base/sequenced_task_runner.h" | 16 #include "base/sequenced_task_runner.h" |
| 17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
| 18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
| 19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| 20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
| 21 #include "base/task_runner_util.h" | 21 #include "base/task_runner_util.h" |
| 22 #include "base/threading/thread_restrictions.h" | 22 #include "base/threading/thread_restrictions.h" |
| 23 #include "chrome/browser/drive/drive_api_util.h" | 23 #include "chrome/browser/drive/drive_api_util.h" |
| 24 #include "chrome/browser/google_apis/drive_api_parser.h" | |
| 25 #include "chrome/browser/google_apis/drive_entry_kinds.h" | |
| 26 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.
h" | 24 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.
h" |
| 27 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" | 25 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" |
| 28 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" | 26 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" |
| 29 #include "chrome/browser/sync_file_system/drive_backend/metadata_db_migration_ut
il.h" | 27 #include "chrome/browser/sync_file_system/drive_backend/metadata_db_migration_ut
il.h" |
| 30 #include "chrome/browser/sync_file_system/logger.h" | 28 #include "chrome/browser/sync_file_system/logger.h" |
| 31 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" | 29 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" |
| 30 #include "google_apis/drive/drive_api_parser.h" |
| 31 #include "google_apis/drive/drive_entry_kinds.h" |
| 32 #include "third_party/leveldatabase/src/include/leveldb/db.h" | 32 #include "third_party/leveldatabase/src/include/leveldb/db.h" |
| 33 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" | 33 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" |
| 34 #include "webkit/common/fileapi/file_system_util.h" | 34 #include "webkit/common/fileapi/file_system_util.h" |
| 35 | 35 |
| 36 namespace sync_file_system { | 36 namespace sync_file_system { |
| 37 namespace drive_backend { | 37 namespace drive_backend { |
| 38 | 38 |
| 39 struct DatabaseContents { | 39 struct DatabaseContents { |
| 40 scoped_ptr<ServiceMetadata> service_metadata; | 40 scoped_ptr<ServiceMetadata> service_metadata; |
| 41 ScopedVector<FileMetadata> file_metadata; | 41 ScopedVector<FileMetadata> file_metadata; |
| (...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 int64 change_id) { | 1759 int64 change_id) { |
| 1760 FileByID::const_iterator found = file_by_id_.find(file_id); | 1760 FileByID::const_iterator found = file_by_id_.find(file_id); |
| 1761 if (found == file_by_id_.end()) | 1761 if (found == file_by_id_.end()) |
| 1762 return false; | 1762 return false; |
| 1763 DCHECK(found->second->has_details()); | 1763 DCHECK(found->second->has_details()); |
| 1764 return found->second->details().change_id() >= change_id; | 1764 return found->second->details().change_id() >= change_id; |
| 1765 } | 1765 } |
| 1766 | 1766 |
| 1767 } // namespace drive_backend | 1767 } // namespace drive_backend |
| 1768 } // namespace sync_file_system | 1768 } // namespace sync_file_system |
| OLD | NEW |