summaryrefslogtreecommitdiff
path: root/src/activity_replay.cc
diff options
context:
space:
mode:
authorKuanYu Chu <chuwfuny@chromium.org>2012-08-14 11:14:23 +0800
committerGerrit <chrome-bot@google.com>2012-08-16 20:31:35 -0700
commit99ea2d690d65ba0808a84ef49482470392cbe8dd (patch)
treea8ac4cb1b0766a8eac454fea9c5e9b96c6b0098a /src/activity_replay.cc
parent6043c335a660c00a13ac292ee31cb93527d19b91 (diff)
downloadlibchrome-gestures-99ea2d690d65ba0808a84ef49482470392cbe8dd.tar.gz
Make replay_log can read the old logging file
The old logging file doesn't record log at the first layer. The first layer only record some Properties, LoggingNotify, ... , and the logs are actually put at the next layer. We can access it by using nextLayer.entries. This patch will automatically choose which log to use when doing replay_log. BUG=chromium-os:33481 TEST=Run replay_log Change-Id: I291578542ca88280ccd42c0114a1ef57f1f3f011 Reviewed-on: https://gerrit.chromium.org/gerrit/30129 Commit-Ready: KuanYu Chu <chuwfuny@chromium.org> Reviewed-by: KuanYu Chu <chuwfuny@chromium.org> Tested-by: KuanYu Chu <chuwfuny@chromium.org>
Diffstat (limited to 'src/activity_replay.cc')
-rw-r--r--src/activity_replay.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/activity_replay.cc b/src/activity_replay.cc
index 7f4addb..941225f 100644
--- a/src/activity_replay.cc
+++ b/src/activity_replay.cc
@@ -65,10 +65,18 @@ bool ActivityReplay::Parse(const string& data,
return false;
log_.SetHardwareProperties(hwprops_);
ListValue* entries = NULL;
+ ListValue* next_layer_entries = NULL;
+ char next_layer_path[PATH_MAX];
+ snprintf(next_layer_path, sizeof(next_layer_path), "%s.%s",
+ ActivityLog::kKeyNext, ActivityLog::kKeyRoot);
if (!dict->GetList(ActivityLog::kKeyRoot, &entries)) {
Err("Unable to get list of entries from root.");
return false;
}
+ if (dict->GetList(next_layer_path, &next_layer_entries) &&
+ (entries->GetSize() < next_layer_entries->GetSize()))
+ entries = next_layer_entries;
+
for (size_t i = 0; i < entries->GetSize(); ++i) {
DictionaryValue* entry = NULL;
if (!entries->GetDictionary(i, &entry)) {