OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_DEVTOOLS_SERIALIZE_DICTIONARY_FOREST_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_SERIALIZE_DICTIONARY_FOREST_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/strings/string_piece.h" |
| 11 #include "base/values.h" |
| 12 |
| 13 // One node of a forest to be serialized by SerializeDictionaryForest. |
| 14 struct DictionaryForestNode { |
| 15 DictionaryForestNode* parent; |
| 16 base::DictionaryValue representation; |
| 17 }; |
| 18 |
| 19 // A helper function taking a forest of Nodes and producing a ListValue |
| 20 // representation. The representation contains a list of DictionaryValue for |
| 21 // each root, and has DictionaryValues of children injected into a ListValue |
| 22 // keyed |child_key| in the parent's DictionaryValue. |
| 23 base::ListValue SerializeDictionaryForest( |
| 24 std::vector<DictionaryForestNode> forest, |
| 25 base::StringPiece child_key); |
| 26 |
| 27 #endif // CHROME_BROWSER_DEVTOOLS_SERIALIZE_DICTIONARY_FOREST_H_ |
OLD | NEW |