Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

Unified Diff: sync/syncable/directory.cc

Issue 134443004: sync: Remove some WebUI debug functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/syncable/directory.h ('k') | sync/syncable/syncable_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory.cc
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc
index 33b7e15be6cbd41170167848665f776c45dcbc57..d83b1f6e2a2c8438082f43f3d562444c092f88b8 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -271,24 +271,6 @@ bool Directory::GetChildHandlesById(
return true;
}
-bool Directory::GetChildHandlesByHandle(
- BaseTransaction* trans, int64 handle,
- Directory::Metahandles* result) {
- if (!SyncAssert(this == trans->directory(), FROM_HERE,
- "Directories don't match", trans))
- return false;
-
- result->clear();
-
- ScopedKernelLock lock(this);
- EntryKernel* kernel = GetEntryByHandle(handle, &lock);
- if (!kernel)
- return true;
-
- AppendChildHandles(lock, kernel->ref(ID), result);
- return true;
-}
-
int Directory::GetTotalNodeCount(
BaseTransaction* trans,
EntryKernel* kernel) const {
@@ -887,16 +869,6 @@ void Directory::GetAllMetaHandles(BaseTransaction* trans,
}
}
-void Directory::GetAllEntryKernels(BaseTransaction* trans,
- std::vector<const EntryKernel*>* result) {
- result->clear();
- ScopedKernelLock lock(this);
- for (MetahandlesMap::iterator i = kernel_->metahandles_map.begin();
- i != kernel_->metahandles_map.end(); ++i) {
- result->push_back(i->second);
- }
-}
-
void Directory::GetUnsyncedMetaHandles(BaseTransaction* trans,
Metahandles* result) {
result->clear();
@@ -947,6 +919,30 @@ void Directory::CollectMetaHandleCounts(
}
}
+scoped_ptr<base::ListValue> Directory::GetAllNodeDetails(
+ BaseTransaction* trans) {
+ scoped_ptr<base::ListValue> nodes(new base::ListValue());
+
+ ScopedKernelLock lock(this);
+ for (MetahandlesMap::iterator it = kernel_->metahandles_map.begin();
+ it != kernel_->metahandles_map.end(); ++it) {
+ EntryKernel* kernel = it->second;
+ scoped_ptr<base::DictionaryValue> node(
+ kernel->ToValue(GetCryptographer(trans)));
+
+ // Add the position index if appropriate. This must be done here (and not
+ // in EntryKernel) because the EntryKernel does not have access to its
+ // siblings.
+ if (kernel->ShouldMaintainPosition() && !kernel->ref(IS_DEL)) {
+ node->SetInteger("positionIndex", GetPositionIndex(trans, kernel));
+ }
+
+ nodes->Append(node.release());
+ }
+
+ return nodes.Pass();
+}
+
bool Directory::CheckInvariantsOnTransactionClose(
syncable::BaseTransaction* trans,
const MetahandleSet& modified_handles) {
« no previous file with comments | « sync/syncable/directory.h ('k') | sync/syncable/syncable_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698