1 // Copyright 2017 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef MOJO_PUBLIC_TOOLS_FUZZERS_FUZZ_IMPL_H_ 6 #define MOJO_PUBLIC_TOOLS_FUZZERS_FUZZ_IMPL_H_ 7 8 #include "mojo/public/cpp/bindings/associated_binding_set.h" 9 #include "mojo/public/cpp/bindings/binding.h" 10 #include "mojo/public/tools/fuzzers/fuzz.mojom.h" 11 12 class FuzzImpl : public fuzz::mojom::FuzzInterface, 13 public fuzz::mojom::FuzzDummyInterface { 14 public: 15 explicit FuzzImpl(fuzz::mojom::FuzzInterfaceRequest request); 16 ~FuzzImpl() override; 17 18 // fuzz::mojom::FuzzInterface: 19 void FuzzBasic() override; 20 void FuzzBasicResp(FuzzBasicRespCallback callback) override; 21 void FuzzBasicSyncResp(FuzzBasicSyncRespCallback callback) override; 22 void FuzzArgs(fuzz::mojom::FuzzStructPtr a, 23 fuzz::mojom::FuzzStructPtr b) override; 24 25 void FuzzArgsResp(fuzz::mojom::FuzzStructPtr a, 26 fuzz::mojom::FuzzStructPtr b, 27 FuzzArgsRespCallback callback) override; 28 void FuzzArgsSyncResp(fuzz::mojom::FuzzStructPtr a, 29 fuzz::mojom::FuzzStructPtr b, 30 FuzzArgsSyncRespCallback callback) override; 31 32 void FuzzAssociated( 33 fuzz::mojom::FuzzDummyInterfaceAssociatedRequest req) override; 34 35 // fuzz::mojom::FuzzDummyInterface: 36 void Ping() override; 37 38 /* Expose the binding to the fuzz harness. */ 39 mojo::Binding<FuzzInterface> binding_; 40 41 private: 42 mojo::AssociatedBindingSet<FuzzDummyInterface> associated_bindings_; 43 }; 44 45 #endif // MOJO_PUBLIC_TOOLS_FUZZERS_FUZZ_IMPL_H_ 46