message_file.h 812 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2013 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. #ifndef TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_FILE_H_
  5. #define TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_FILE_H_
  6. #include <memory>
  7. #include <vector>
  8. #include "base/files/file_path.h"
  9. #include "base/macros.h"
  10. #include "ipc/ipc_message.h"
  11. namespace ipc_fuzzer {
  12. using MessageVector = std::vector<std::unique_ptr<IPC::Message>>;
  13. class MessageFile {
  14. public:
  15. static bool Read(const base::FilePath& path, MessageVector* messages);
  16. static bool Write(const base::FilePath& path, const MessageVector& messages);
  17. private:
  18. DISALLOW_COPY_AND_ASSIGN(MessageFile);
  19. };
  20. } // namespace ipc_fuzzer
  21. #endif // TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_FILE_H_