| 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/syncable.h" | 5 #include "chrome/browser/sync/syncable/syncable.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 #if defined(OS_POSIX) | 10 #if defined(OS_POSIX) |
| 11 #include <sys/time.h> | 11 #include <sys/time.h> |
| 12 #endif | 12 #endif |
| 13 #include <sys/types.h> | 13 #include <sys/types.h> |
| 14 #include <time.h> | 14 #include <time.h> |
| 15 #if defined(OS_MACOSX) | 15 #if defined(OS_MACOSX) |
| 16 #include <CoreFoundation/CoreFoundation.h> | 16 #include <CoreFoundation/CoreFoundation.h> |
| 17 #elif defined(OS_WIN) | 17 #elif defined(OS_WIN) |
| 18 #include <shlwapi.h> // for PathMatchSpec | 18 #include <shlwapi.h> // for PathMatchSpec |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 #include <algorithm> | 21 #include <algorithm> |
| 22 #include <cstring> | 22 #include <cstring> |
| 23 #include <functional> | 23 #include <functional> |
| 24 #include <iomanip> | 24 #include <iomanip> |
| 25 #include <iterator> | 25 #include <iterator> |
| 26 #include <limits> | 26 #include <limits> |
| 27 #include <set> | 27 #include <set> |
| 28 #include <string> | 28 #include <string> |
| 29 | 29 |
| 30 #include "base/file_util.h" |
| 30 #include "base/hash_tables.h" | 31 #include "base/hash_tables.h" |
| 31 #include "base/file_util.h" | |
| 32 #include "base/logging.h" | 32 #include "base/logging.h" |
| 33 #include "base/memory/scoped_ptr.h" | 33 #include "base/memory/scoped_ptr.h" |
| 34 #include "base/perftimer.h" | 34 #include "base/perftimer.h" |
| 35 #include "base/stl_util.h" |
| 35 #include "base/string_number_conversions.h" | 36 #include "base/string_number_conversions.h" |
| 36 #include "base/string_util.h" | 37 #include "base/string_util.h" |
| 37 #include "base/stl_util.h" | |
| 38 #include "base/time.h" | 38 #include "base/time.h" |
| 39 #include "base/tracked.h" | 39 #include "base/tracked.h" |
| 40 #include "base/utf_string_conversions.h" | 40 #include "base/utf_string_conversions.h" |
| 41 #include "base/values.h" | 41 #include "base/values.h" |
| 42 #include "chrome/browser/sync/protocol/proto_value_conversions.h" | 42 #include "chrome/browser/sync/protocol/proto_value_conversions.h" |
| 43 #include "chrome/browser/sync/protocol/service_constants.h" | 43 #include "chrome/browser/sync/protocol/service_constants.h" |
| 44 #include "chrome/browser/sync/syncable/directory_backing_store.h" | 44 #include "chrome/browser/sync/syncable/directory_backing_store.h" |
| 45 #include "chrome/browser/sync/syncable/directory_change_delegate.h" | 45 #include "chrome/browser/sync/syncable/directory_change_delegate.h" |
| 46 #include "chrome/browser/sync/syncable/directory_manager.h" | 46 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 47 #include "chrome/browser/sync/syncable/model_type.h" | 47 #include "chrome/browser/sync/syncable/model_type.h" |
| 48 #include "chrome/browser/sync/syncable/syncable-inl.h" | |
| 49 #include "chrome/browser/sync/syncable/syncable_changes_version.h" | 48 #include "chrome/browser/sync/syncable/syncable_changes_version.h" |
| 50 #include "chrome/browser/sync/syncable/syncable_columns.h" | 49 #include "chrome/browser/sync/syncable/syncable_columns.h" |
| 51 #include "chrome/browser/sync/syncable/syncable_enum_conversions.h" | 50 #include "chrome/browser/sync/syncable/syncable_enum_conversions.h" |
| 51 #include "chrome/browser/sync/syncable/syncable-inl.h" |
| 52 #include "chrome/browser/sync/syncable/transaction_observer.h" | 52 #include "chrome/browser/sync/syncable/transaction_observer.h" |
| 53 #include "chrome/browser/sync/util/logging.h" | 53 #include "chrome/browser/sync/util/logging.h" |
| 54 #include "net/base/escape.h" | 54 #include "net/base/escape.h" |
| 55 | 55 |
| 56 namespace { | 56 namespace { |
| 57 enum InvariantCheckLevel { | 57 enum InvariantCheckLevel { |
| 58 OFF = 0, | 58 OFF = 0, |
| 59 VERIFY_IN_MEMORY = 1, | 59 VERIFY_IN_MEMORY = 1, |
| 60 FULL_DB_VERIFICATION = 2 | 60 FULL_DB_VERIFICATION = 2 |
| 61 }; | 61 }; |
| (...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1940 CHECK(result); | 1940 CHECK(result); |
| 1941 for (iterator i = GetParentChildIndexLowerBound(lock, parent_id), | 1941 for (iterator i = GetParentChildIndexLowerBound(lock, parent_id), |
| 1942 end = GetParentChildIndexUpperBound(lock, parent_id); | 1942 end = GetParentChildIndexUpperBound(lock, parent_id); |
| 1943 i != end; ++i) { | 1943 i != end; ++i) { |
| 1944 DCHECK_EQ(parent_id, (*i)->ref(PARENT_ID)); | 1944 DCHECK_EQ(parent_id, (*i)->ref(PARENT_ID)); |
| 1945 result->push_back((*i)->ref(META_HANDLE)); | 1945 result->push_back((*i)->ref(META_HANDLE)); |
| 1946 } | 1946 } |
| 1947 } | 1947 } |
| 1948 | 1948 |
| 1949 } // namespace syncable | 1949 } // namespace syncable |
| OLD | NEW |