MCPcopy Create free account
hub / github.com/chromium/crashpad / GenerateOrigFile

Method GenerateOrigFile

util/stream/file_encoder_test.cc:52–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 }
51
52 void GenerateOrigFile(size_t size) {
53 ScopedFileHandle write_handle(OpenFileForWrite(
54 orig_, FileWriteMode::kCreateOrFail, FilePermissions::kOwnerOnly));
55 ASSERT_TRUE(write_handle.is_valid());
56 FileOutputStream out(write_handle.get());
57 const uint8_t* buf = BuildDeterministicInput(size);
58 while (size > 0) {
59 size_t m = std::min(kBufferSize, size);
60 ASSERT_TRUE(out.Write(buf, m));
61 size -= m;
62 buf += m;
63 }
64 ASSERT_TRUE(out.Flush());
65 }
66
67 FileEncoder* encoder() const { return encoder_.get(); }
68

Callers

nothing calls this directly

Calls 5

OpenFileForWriteFunction · 0.50
is_validMethod · 0.45
getMethod · 0.45
WriteMethod · 0.45
FlushMethod · 0.45

Tested by

no test coverage detected