Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(995)

Unified Diff: chrome/browser/devtools/serialize_host_descriptions.h

Issue 2825533002: Introduce SerializeDictionaryForest for devtools_target_ui (Closed)
Patch Set: non-pre-ordered test and out params Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/devtools/serialize_host_descriptions.h
diff --git a/chrome/browser/devtools/serialize_host_descriptions.h b/chrome/browser/devtools/serialize_host_descriptions.h
new file mode 100644
index 0000000000000000000000000000000000000000..417790147485d71e0e25729b0bc9c0981a7287e9
--- /dev/null
+++ b/chrome/browser/devtools/serialize_host_descriptions.h
@@ -0,0 +1,29 @@
+// 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_HOST_DESCRIPTIONS_H_
+#define CHROME_BROWSER_DEVTOOLS_SERIALIZE_HOST_DESCRIPTIONS_H_
+
+#include <string>
+#include <vector>
+
+#include "base/strings/string_piece.h"
+#include "base/values.h"
+
+// DevToolsAgentHost description to be serialized by SerializeHostDescriptions.
+struct HostDescriptionNode {
+ std::string name;
+ std::string parent_name;
+ base::DictionaryValue representation;
+};
+
+// A helper function taking a HostDescriptionNode representation of hosts and
+// producing a ListValue representation. The representation contains a list of
+// DictionaryValue for each rooti host, and has DictionaryValues of children
+// injected into a ListValue keyed |child_key| in the parent's DictionaryValue.
+base::ListValue SerializeHostDescriptions(
+ std::vector<HostDescriptionNode> hosts,
+ base::StringPiece child_key);
+
+#endif // CHROME_BROWSER_DEVTOOLS_SERIALIZE_HOST_DESCRIPTIONS_H_
« no previous file with comments | « chrome/browser/devtools/devtools_targets_ui.cc ('k') | chrome/browser/devtools/serialize_host_descriptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698