chromium/third_party/blink/renderer/core/fileapi/file_reader_data.h

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FILEAPI_FILE_READER_DATA_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_FILEAPI_FILE_READER_DATA_H_

#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/fileapi/file_read_type.h"
#include "third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"

namespace WTF {
class String;
}  // namespace WTF

namespace blink {

// FileReaderData is a convenience class to help users convert the data
// received from FileReaderLoader to the different FileReadType types. This
// object works with move semantics, which means it must not be converted
// multiple times to the desired type.
// Example usage:
// DidFinishLoading(FileReaderData contents) {
//   DOMArrayBuffer* buffer = std::move(contents).AsDOMArrayBuffer();
//   ...
// }
class CORE_EXPORT FileReaderData {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_FILEAPI_FILE_READER_DATA_H_