Index: chrome/browser/devtools/serialize_dictionary_forest.h |
diff --git a/chrome/browser/devtools/serialize_dictionary_forest.h b/chrome/browser/devtools/serialize_dictionary_forest.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..428a2cacf474884fe7a04833d0cd45f3b6615564 |
--- /dev/null |
+++ b/chrome/browser/devtools/serialize_dictionary_forest.h |
@@ -0,0 +1,27 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_DEVTOOLS_SERIALIZE_DICTIONARY_FOREST_H_ |
+#define CHROME_BROWSER_DEVTOOLS_SERIALIZE_DICTIONARY_FOREST_H_ |
+ |
+#include <vector> |
+ |
+#include "base/strings/string_piece.h" |
+#include "base/values.h" |
+ |
+// One node of a forest to be serialized by SerializeDictionaryForest. |
+struct DictionaryForestNode { |
+ DictionaryForestNode* parent; |
+ base::DictionaryValue representation; |
+}; |
+ |
+// A helper function taking a forest of Nodes and producing a ListValue |
+// representation. The representation contains a list of DictionaryValue for |
+// each root, and has DictionaryValues of children injected into a ListValue |
+// keyed |child_key| in the parent's DictionaryValue. |
+base::ListValue SerializeDictionaryForest( |
+ std::vector<DictionaryForestNode> forest, |
+ base::StringPiece child_key); |
+ |
+#endif // CHROME_BROWSER_DEVTOOLS_SERIALIZE_DICTIONARY_FOREST_H_ |