PM: Add EvaluationContext::DumpContext() method.
This generates a JSON-formatted string with all the variables and the
evaluation start-time.
BUG=chromium:355724
TEST=New unit test + Unit tests pass.
Change-Id: Iaa1439b6589b54536aedd59b8f81a58d5c6663ad
Reviewed-on: https://chromium-review.googlesource.com/197548
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
diff --git a/policy_manager/evaluation_context.h b/policy_manager/evaluation_context.h
index f894a46..059256e 100644
--- a/policy_manager/evaluation_context.h
+++ b/policy_manager/evaluation_context.h
@@ -85,6 +85,11 @@
// reseted, removing all the non-const cached values.
bool RunOnValueChangeOrTimeout(base::Closure callback);
+ // Returns a textual representation of the evaluation context,
+ // including the variables and their values. This is intended only
+ // to help with debugging and the format may change in the future.
+ std::string DumpContext() const;
+
private:
// Removes all the Observers and timeout callbacks scheduled by
// RunOnValueChangeOrTimeout(). This method is idempotent.