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

Unified Diff: content/browser/devtools/protocol_string.h

Issue 2493063005: [DevTools] Use inspector_protocol generator in content/browser/devtools. (Closed)
Patch Set: roll Created 4 years, 1 month 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
« no previous file with comments | « content/browser/devtools/protocol_config.json ('k') | content/browser/devtools/protocol_string.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol_string.h
diff --git a/content/browser/devtools/protocol_string.h b/content/browser/devtools/protocol_string.h
new file mode 100644
index 0000000000000000000000000000000000000000..8541aba1ae746acf9f361f503a3166acdc895014
--- /dev/null
+++ b/content/browser/devtools/protocol_string.h
@@ -0,0 +1,58 @@
+// Copyright 2016 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 CONTENT_BROWSER_DEVTOOLS_PROTOCOL_STRING_H
+#define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_STRING_H
+
+#include <memory>
+#include <string>
+
+#include "base/logging.h"
+#include "base/macros.h"
+#include "base/strings/string_number_conversions.h"
+#include "content/common/content_export.h"
+
+namespace content {
+namespace protocol {
+
+class Value;
+
+using String = std::string;
+
+class CONTENT_EXPORT StringBuilder {
+ public:
+ StringBuilder();
+ ~StringBuilder();
+ void append(const std::string&);
+ void append(char);
+ void append(const char*, size_t);
+ std::string toString();
+ void reserveCapacity(size_t);
+
+ private:
+ std::string string_;
+};
+
+class CONTENT_EXPORT StringUtil {
+ public:
+ static String substring(const String& s, unsigned pos, unsigned len) {
+ return s.substr(pos, len);
+ }
+ static String fromInteger(int number) {
+ return base::IntToString(number);
+ }
+ static String fromDouble(double number) {
+ return base::DoubleToString(number);
+ }
+ static const size_t kNotFound = static_cast<size_t>(-1);
+ static void builderReserve(StringBuilder& builder, unsigned capacity) {
+ builder.reserveCapacity(capacity);
+ }
+ static std::unique_ptr<protocol::Value> parseJSON(const String&);
+};
+
+} // namespace protocol
+} // namespace content
+
+#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_STRING_H
« no previous file with comments | « content/browser/devtools/protocol_config.json ('k') | content/browser/devtools/protocol_string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698