Commit fc963e2f authored by Johannes Henkel's avatar Johannes Henkel Committed by Commit Bot

[DevTools] Add protocol::Binary to ui_devtools/string_util.h.

This is in preparation of referencing this type from the code
generated by third_party/inspector_protocol/code_generator.py.

My overall WIP change is in here, and happy to explain more:
https://chromium-review.googlesource.com/c/chromium/src/+/1244719

Bug: chromium:891377
Change-Id: I2e59d49bbe333bb132ea8e16fcac2dace589f163
Reviewed-on: https://chromium-review.googlesource.com/c/1282224
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600052}
parent e39f8a78
...@@ -74,6 +74,19 @@ class StringUtil { ...@@ -74,6 +74,19 @@ class StringUtil {
static std::unique_ptr<Value> parseJSON(const String& string); static std::unique_ptr<Value> parseJSON(const String& string);
}; };
// A read-only sequence of uninterpreted bytes with reference-counted storage.
// Though the templates for generating the protocol bindings reference
// this type, thus far it's not used in the Chrome layer, so we provide no
// implementation here and rely on the linker optimizing it away. If this
// changes, look to content/browser/devtools/protocol_string{.h,.cc} for
// inspiration.
class Binary {
public:
const uint8_t* data() const;
size_t size() const;
String toBase64() const;
static Binary createFromBase64(const String& base64, bool* success);
};
} // namespace protocol } // namespace protocol
} // namespace ui_devtools } // namespace ui_devtools
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment