chromium/third_party/blink/renderer/platform/mojo/drag_mojom_traits.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/platform/mojo/drag_mojom_traits.h"

#include <algorithm>
#include <optional>
#include <string>

#include "base/check.h"
#include "base/containers/span.h"
#include "base/files/file_path.h"
#include "base/functional/overloaded.h"
#include "base/memory/scoped_refptr.h"
#include "base/notreached.h"
#include "mojo/public/cpp/base/big_buffer.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "services/network/public/mojom/referrer_policy.mojom-shared.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
#include "third_party/blink/public/mojom/blob/serialized_blob.mojom.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_data_transfer_token.mojom-blink.h"
#include "third_party/blink/public/platform/file_path_conversion.h"
#include "third_party/blink/public/platform/web_drag_data.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_vector.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

namespace mojo {

// static
WTF::String StructTraits<blink::mojom::DragItemStringDataView,
                         blink::WebDragData::StringItem>::
    string_type(const blink::WebDragData::StringItem& item) {}

// static
WTF::String StructTraits<blink::mojom::DragItemStringDataView,
                         blink::WebDragData::StringItem>::
    string_data(const blink::WebDragData::StringItem& item) {}

// static
WTF::String StructTraits<blink::mojom::DragItemStringDataView,
                         blink::WebDragData::StringItem>::
    title(const blink::WebDragData::StringItem& item) {}

// static
std::optional<blink::KURL> StructTraits<blink::mojom::DragItemStringDataView,
                                        blink::WebDragData::StringItem>::
    base_url(const blink::WebDragData::StringItem& item) {}

// static
bool StructTraits<blink::mojom::DragItemStringDataView,
                  blink::WebDragData::StringItem>::
    Read(blink::mojom::DragItemStringDataView data,
         blink::WebDragData::StringItem* out) {}

// static
base::FilePath StructTraits<blink::mojom::DataTransferFileDataView,
                            blink::WebDragData::FilenameItem>::
    path(const blink::WebDragData::FilenameItem& item) {}

// static
base::FilePath StructTraits<blink::mojom::DataTransferFileDataView,
                            blink::WebDragData::FilenameItem>::
    display_name(const blink::WebDragData::FilenameItem& item) {}

// static
mojo::PendingRemote<blink::mojom::blink::FileSystemAccessDataTransferToken>
StructTraits<blink::mojom::DataTransferFileDataView,
             blink::WebDragData::FilenameItem>::
    file_system_access_token(const blink::WebDragData::FilenameItem& item) {}

// static
bool StructTraits<blink::mojom::DataTransferFileDataView,
                  blink::WebDragData::FilenameItem>::
    Read(blink::mojom::DataTransferFileDataView data,
         blink::WebDragData::FilenameItem* out) {}

// static
mojo_base::BigBuffer StructTraits<blink::mojom::DragItemBinaryDataView,
                                  blink::WebDragData::BinaryDataItem>::
    data(const blink::WebDragData::BinaryDataItem& item) {}

// static
bool StructTraits<blink::mojom::DragItemBinaryDataView,
                  blink::WebDragData::BinaryDataItem>::
    is_image_accessible(const blink::WebDragData::BinaryDataItem& item) {}

// static
blink::KURL StructTraits<blink::mojom::DragItemBinaryDataView,
                         blink::WebDragData::BinaryDataItem>::
    source_url(const blink::WebDragData::BinaryDataItem& item) {}

// static
base::FilePath StructTraits<blink::mojom::DragItemBinaryDataView,
                            blink::WebDragData::BinaryDataItem>::
    filename_extension(const blink::WebDragData::BinaryDataItem& item) {}

// static
WTF::String StructTraits<blink::mojom::DragItemBinaryDataView,
                         blink::WebDragData::BinaryDataItem>::
    content_disposition(const blink::WebDragData::BinaryDataItem& item) {}

// static
bool StructTraits<blink::mojom::DragItemBinaryDataView,
                  blink::WebDragData::BinaryDataItem>::
    Read(blink::mojom::DragItemBinaryDataView data,
         blink::WebDragData::BinaryDataItem* out) {}

//  static
blink::KURL StructTraits<blink::mojom::DragItemFileSystemFileDataView,
                         blink::WebDragData::FileSystemFileItem>::
    url(const blink::WebDragData::FileSystemFileItem& item) {}

//  static
int64_t StructTraits<blink::mojom::DragItemFileSystemFileDataView,
                     blink::WebDragData::FileSystemFileItem>::
    size(const blink::WebDragData::FileSystemFileItem& item) {}

//  static
WTF::String StructTraits<blink::mojom::DragItemFileSystemFileDataView,
                         blink::WebDragData::FileSystemFileItem>::
    file_system_id(const blink::WebDragData::FileSystemFileItem& item) {}

//  static
scoped_refptr<blink::BlobDataHandle>
StructTraits<blink::mojom::DragItemFileSystemFileDataView,
             blink::WebDragData::FileSystemFileItem>::
    serialized_blob(const blink::WebDragData::FileSystemFileItem& item) {}

// static
bool StructTraits<blink::mojom::DragItemFileSystemFileDataView,
                  blink::WebDragData::FileSystemFileItem>::
    Read(blink::mojom::DragItemFileSystemFileDataView data,
         blink::WebDragData::FileSystemFileItem* out) {}

// static
bool UnionTraits<blink::mojom::DragItemDataView, blink::WebDragData::Item>::
    Read(blink::mojom::DragItemDataView data, blink::WebDragData::Item* out) {}

// static
blink::mojom::DragItemDataView::Tag
UnionTraits<blink::mojom::DragItemDataView, blink::WebDragData::Item>::GetTag(
    const blink::WebDragData::Item& item) {}

// static
const blink::WebVector<blink::WebDragData::Item>&
StructTraits<blink::mojom::DragDataDataView, blink::WebDragData>::items(
    const blink::WebDragData& drag_data) {}

// static
WTF::String StructTraits<blink::mojom::DragDataDataView, blink::WebDragData>::
    file_system_id(const blink::WebDragData& drag_data) {}

// static
bool StructTraits<blink::mojom::DragDataDataView, blink::WebDragData>::
    force_default_action(const blink::WebDragData& drag_data) {}

// static
network::mojom::ReferrerPolicy StructTraits<
    blink::mojom::DragDataDataView,
    blink::WebDragData>::referrer_policy(const blink::WebDragData& drag_data) {}

// static
bool StructTraits<blink::mojom::DragDataDataView, blink::WebDragData>::Read(
    blink::mojom::DragDataDataView data,
    blink::WebDragData* out) {}

}  // namespace mojo