1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_fuzzing_Nyx_h
8 #define mozilla_fuzzing_Nyx_h
14 #ifndef NYX_DISALLOW_COPY_AND_ASSIGN
15 # define NYX_DISALLOW_COPY_AND_ASSIGN(T) \
17 void operator=(const T&)
22 class MallocAllocPolicy
;
23 template <class T
, size_t MinInlineCapacity
, class AllocPolicy
>
30 static Nyx
& instance();
34 bool is_enabled(const char* identifier
);
36 uint32_t get_data(uint8_t* data
, uint32_t size
);
37 uint32_t get_raw_data(uint8_t* data
, uint32_t size
);
38 void release(uint32_t iterations
= 1);
39 void handle_event(const char* type
, const char* file
, int line
,
41 void dump_file(void* buffer
, size_t len
, const char* filename
);
44 std::atomic
<bool> mInited
;
46 std::atomic
<bool> mReplayMode
;
47 std::list
<Vector
<uint8_t, 0, MallocAllocPolicy
>*> mReplayBuffers
;
48 Vector
<uint8_t, 0, MallocAllocPolicy
>* mRawReplayBuffer
;
51 NYX_DISALLOW_COPY_AND_ASSIGN(Nyx
);
54 } // namespace fuzzing
55 } // namespace mozilla
57 #endif /* mozilla_fuzzing_Nyx_h */