summaryrefslogtreecommitdiffstats
path: root/sync/internal_api
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-13 01:17:04 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-13 01:17:04 +0000
commitc073853dace7063f754be14f6750a3bf747597f0 (patch)
tree98e8893073e65aed9a77645fda906491afd6981d /sync/internal_api
parent68e81a4a69fcfd394e4e5e86e59c9b5db17c4370 (diff)
downloadchromium_src-c073853dace7063f754be14f6750a3bf747597f0.zip
chromium_src-c073853dace7063f754be14f6750a3bf747597f0.tar.gz
chromium_src-c073853dace7063f754be14f6750a3bf747597f0.tar.bz2
[Sync] Display encrypted data in about:sync
For ease in debugging, we automatically decrypt encrypted specifics if we are able when creating their string representations. This allows us to display decrypted data in the sync node browser and data dumps. Note that passwords don't use the normal encryption scheme, and hence are not decrypted. This is intentional. BUG=96225 Review URL: https://chromiumcodereview.appspot.com/11557006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172755 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api')
-rw-r--r--sync/internal_api/base_node.cc3
-rw-r--r--sync/internal_api/sync_manager_impl.cc2
-rw-r--r--sync/internal_api/sync_manager_impl_unittest.cc3
3 files changed, 5 insertions, 3 deletions
diff --git a/sync/internal_api/base_node.cc b/sync/internal_api/base_node.cc
index 990a986..19de572 100644
--- a/sync/internal_api/base_node.cc
+++ b/sync/internal_api/base_node.cc
@@ -291,7 +291,8 @@ DictionaryValue* BaseNode::GetDetailsAsValue() const {
base::Int64ToString(GetSuccessorId()));
node_info->SetString("firstChildId",
base::Int64ToString(GetFirstChildId()));
- node_info->Set("entry", GetEntry()->ToValue());
+ node_info->Set("entry",
+ GetEntry()->ToValue(GetTransaction()->GetCryptographer()));
return node_info;
}
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index fe5e33b..874444b 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -1179,7 +1179,7 @@ JsArgList SyncManagerImpl::GetAllNodes(const JsArgList& args) {
for (std::vector<const syncable::EntryKernel*>::const_iterator it =
entry_kernels.begin(); it != entry_kernels.end(); ++it) {
- result->Append((*it)->ToValue());
+ result->Append((*it)->ToValue(trans.GetCryptographer()));
}
return JsArgList(&return_args);
diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc
index edacea0..7e4ef7d 100644
--- a/sync/internal_api/sync_manager_impl_unittest.cc
+++ b/sync/internal_api/sync_manager_impl_unittest.cc
@@ -584,7 +584,8 @@ void CheckNodeValue(const BaseNode& node, const DictionaryValue& value,
ExpectInt64Value(node.GetSuccessorId(), value, "successorId");
ExpectInt64Value(node.GetFirstChildId(), value, "firstChildId");
{
- scoped_ptr<DictionaryValue> expected_entry(node.GetEntry()->ToValue());
+ scoped_ptr<DictionaryValue> expected_entry(
+ node.GetEntry()->ToValue(NULL));
const Value* entry = NULL;
EXPECT_TRUE(value.Get("entry", &entry));
EXPECT_TRUE(Value::Equals(entry, expected_entry.get()));