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

[DevTools] Add protocol::Binary to protocol_string.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: I9fbb8b980e522c0063f96a8a2a42498903d445a8
Reviewed-on: https://chromium-review.googlesource.com/c/1282208
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600051}
parent 2c50b9cd
...@@ -79,6 +79,20 @@ class StringUtil { ...@@ -79,6 +79,20 @@ class StringUtil {
static std::unique_ptr<protocol::Value> parseJSON(const String&); static std::unique_ptr<protocol::Value> parseJSON(const 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);
};
std::unique_ptr<protocol::Value> toProtocolValue(const base::Value* value, std::unique_ptr<protocol::Value> toProtocolValue(const base::Value* value,
int depth); int depth);
std::unique_ptr<base::Value> toBaseValue(protocol::Value* value, int depth); std::unique_ptr<base::Value> toBaseValue(protocol::Value* value, int depth);
......
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