#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/modules/clipboard/clipboard_writer.h"
#include "base/task/single_thread_task_runner.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/clipboard/clipboard.mojom-blink.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/core/clipboard/clipboard_mime_types.h"
#include "third_party/blink/renderer/core/clipboard/system_clipboard.h"
#include "third_party/blink/renderer/core/dom/document_fragment.h"
#include "third_party/blink/renderer/core/editing/serializers/serialization.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/fileapi/file_reader_loader.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/imagebitmap/image_bitmap.h"
#include "third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h"
#include "third_party/blink/renderer/core/xml/dom_parser.h"
#include "third_party/blink/renderer/modules/clipboard/clipboard.h"
#include "third_party/blink/renderer/platform/heap/cross_thread_handle.h"
#include "third_party/blink/renderer/platform/image-decoders/image_decoder.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/scheduler/public/worker_pool.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_skia.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/wtf/wtf.h"
#include "ui/base/clipboard/clipboard_constants.h"
namespace blink {
namespace {
class ClipboardImageWriter final : public ClipboardWriter { … };
class ClipboardTextWriter final : public ClipboardWriter { … };
class ClipboardHtmlWriter final : public ClipboardWriter { … };
class ClipboardSvgWriter final : public ClipboardWriter { … };
class ClipboardCustomFormatWriter final : public ClipboardWriter { … };
}
ClipboardWriter* ClipboardWriter::Create(SystemClipboard* system_clipboard,
const String& mime_type,
ClipboardPromise* promise) { … }
ClipboardWriter::ClipboardWriter(SystemClipboard* system_clipboard,
ClipboardPromise* promise)
: … { … }
ClipboardWriter::~ClipboardWriter() = default;
void ClipboardWriter::WriteToSystem(Blob* blob) { … }
void ClipboardWriter::DidFinishLoading(FileReaderData contents) { … }
void ClipboardWriter::DidFail(FileErrorCode error_code) { … }
void ClipboardWriter::Trace(Visitor* visitor) const { … }
}