Commit 51f60c81 authored by Mark Brand's avatar Mark Brand Committed by Commit Bot

Core non-generated code for MojoLPM fuzzer.

This adds the standalone code for MojoLPM; it's not functional by
itself but it is a dependency for the generated code.

This is a cherrypick/split from
https://chromium-review.googlesource.com/c/chromium/src/+/2108507

Change-Id: I71deba7182adc31acde2546b42808a959a87b8a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2109698Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Mark Brand <markbrand@google.com>
Cr-Commit-Position: refs/heads/master@{#751984}
parent 94434052
...@@ -61,3 +61,33 @@ fuzzer_test("mojo_parse_message_proto_fuzzer") { ...@@ -61,3 +61,33 @@ fuzzer_test("mojo_parse_message_proto_fuzzer") {
proto_library("mojo_fuzzer_proto") { proto_library("mojo_fuzzer_proto") {
sources = [ "mojo_fuzzer.proto" ] sources = [ "mojo_fuzzer.proto" ]
} }
copy("mojolpm_proto_copy") {
sources = [ "mojolpm.proto" ]
outputs = [ "$root_gen_dir/mojolpm.proto" ]
testonly = true
}
proto_library("mojolpm_proto") {
sources = [ "mojolpm.proto" ]
generate_python = false
# TODO(markbrand): this is kind of a hack, but it works. not sure if it's
# the best way to get this generated in the right place though.
proto_out_dir = "mojo/public/tools/fuzzers/../../../../"
proto_deps = [ ":mojolpm_proto_copy" ]
testonly = true
}
static_library("mojolpm") {
sources = [
"mojolpm.cc",
"mojolpm.h",
]
deps = [
":mojolpm_proto",
"//base",
"//mojo/public/cpp/bindings",
]
testonly = true
}
This diff is collapsed.
This diff is collapsed.
// Copyright 2019 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.
syntax = "proto2";
package mojolpm;
// TODO(markbrand): Is there anything sensible to do to fuzz interfaces that
// use or expect a generic mojo handle?
message Handle {}
message CreateDataPipeOptions {
required uint32 flags = 2;
required uint32 element_num_bytes = 3;
required uint32 capacity_num_bytes = 4;
}
message DataPipeConsumerHandle {
oneof instance {
uint32 old = 1;
CreateDataPipeOptions new = 2;
}
}
message DataPipeProducerHandle {
oneof instance {
uint32 old = 1;
CreateDataPipeOptions new = 2;
}
}
message DataPipeRead {
required DataPipeConsumerHandle handle = 1;
required uint32 size = 2;
}
message DataPipeWrite {
required DataPipeProducerHandle handle = 1;
required bytes data = 2;
}
message DataPipeConsumerClose {
required uint32 id = 1;
}
message DataPipeProducerClose {
required uint32 id = 1;
}
// TODO(markbrand): Implement these last two.
message MessagePipeHandle {}
message SharedBufferHandle {}
message PlatformHandle {}
...@@ -227,6 +227,10 @@ static_library("protobuf_full") { ...@@ -227,6 +227,10 @@ static_library("protobuf_full") {
"//gpu:gl_lpm_fuzzer_proto", "//gpu:gl_lpm_fuzzer_proto",
"//gpu:gl_lpm_fuzzer_proto_gen", "//gpu:gl_lpm_fuzzer_proto_gen",
"//gpu:gl_lpm_shader_to_string_unittest", "//gpu:gl_lpm_shader_to_string_unittest",
# The protobuf-based Mojo LPM fuzzer needs protobuf_full and is not included
# in Chrome.
"//mojo/public/tools/fuzzers:mojolpm",
] ]
sources = protobuf_lite_sources + [ sources = protobuf_lite_sources + [
......
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