Commit 3ef5743a authored by Johannes Henkel's avatar Johannes Henkel Committed by Commit Bot

Add protocol::Binary type to string-util.h.

This is in preparation of referencing this type from the code
generated by third_party/inspector_protocol/code_generator.py.
v8 will not use protocol::Binary, that is, the .pdl file for
v8 won't have binary fields. Therefore, we need not provide
an implementation for this type.

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

Bug: chromium:891377
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I7336be5f6a60e6ad143290eca09dea59ff4b56a8
Reviewed-on: https://chromium-review.googlesource.com/c/1277714Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56658}
parent d34cbcd7
......@@ -32,7 +32,7 @@ action("protocol_compatibility") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
script = "$_inspector_protocol/CheckProtocolCompatibility.py"
inputs = [
"js_protocol.json",
"js_protocol.pdl",
]
_stamp = "$target_gen_dir/js_protocol.stamp"
outputs = [
......@@ -41,7 +41,7 @@ action("protocol_compatibility") {
args = [
"--stamp",
rebase_path(_stamp, root_build_dir),
rebase_path("js_protocol.json", root_build_dir),
rebase_path("js_protocol.pdl", root_build_dir),
]
}
......@@ -55,7 +55,7 @@ inspector_protocol_generate("protocol_generated_sources") {
out_dir = target_gen_dir
config_file = "inspector_protocol_config.json"
inputs = [
"js_protocol.json",
"js_protocol.pdl",
"inspector_protocol_config.json",
]
outputs = _protocol_generated
......
......@@ -5,6 +5,7 @@
#ifndef V8_INSPECTOR_STRING_UTIL_H_
#define V8_INSPECTOR_STRING_UTIL_H_
#include <stdint.h>
#include <memory>
#include "src/base/logging.h"
......@@ -60,6 +61,19 @@ class StringUtil {
static std::unique_ptr<protocol::Value> parseJSON(const StringView& json);
};
// A read-only sequence of uninterpreted bytes with reference-counted storage.
// Though the templates for generating the protocol bindings reference
// this type, js_protocol.pdl doesn't have a field of type 'binary', so
// therefore it's unnecessary to provide an implementation here.
class Binary {
public:
const uint8_t* data() const { UNIMPLEMENTED(); }
size_t size() const { UNIMPLEMENTED(); }
String toBase64() const { UNIMPLEMENTED(); }
static Binary createFromBase64(const String& base64, bool* success) {
UNIMPLEMENTED();
}
};
} // namespace protocol
v8::Local<v8::String> toV8String(v8::Isolate*, const String16&);
......
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