chromium/third_party/blink/common/manifest/manifest_mojom_traits.cc

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

#include "third_party/blink/public/common/manifest/manifest_mojom_traits.h"

#include <string>
#include <utility>

#include "base/strings/utf_string_conversions.h"
#include "mojo/public/cpp/base/string16_mojom_traits.h"
#include "mojo/public/cpp/bindings/type_converter.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "third_party/blink/public/mojom/manifest/manifest.mojom.h"
#include "ui/gfx/geometry/mojom/geometry_mojom_traits.h"
#include "url/mojom/url_gurl_mojom_traits.h"
#include "url/url_util.h"

namespace mojo {
namespace {

// A wrapper around std::optional<std::u16string> so a custom StructTraits
// specialization can enforce maximum string length.
struct TruncatedString16 {};

std::optional<std::string> ConvertOptionalString16(
    const TruncatedString16& string) {}

}  // namespace

template <>
struct StructTraits<mojo_base::mojom::String16DataView, TruncatedString16> {};

bool StructTraits<blink::mojom::ManifestImageResourceDataView,
                  ::blink::Manifest::ImageResource>::
    Read(blink::mojom::ManifestImageResourceDataView data,
         ::blink::Manifest::ImageResource* out) {}

bool StructTraits<blink::mojom::ManifestShortcutItemDataView,
                  ::blink::Manifest::ShortcutItem>::
    Read(blink::mojom::ManifestShortcutItemDataView data,
         ::blink::Manifest::ShortcutItem* out) {}

bool StructTraits<blink::mojom::ManifestRelatedApplicationDataView,
                  ::blink::Manifest::RelatedApplication>::
    Read(blink::mojom::ManifestRelatedApplicationDataView data,
         ::blink::Manifest::RelatedApplication* out) {}

bool StructTraits<blink::mojom::ManifestFileFilterDataView,
                  ::blink::Manifest::FileFilter>::
    Read(blink::mojom::ManifestFileFilterDataView data,
         ::blink::Manifest::FileFilter* out) {}

bool StructTraits<blink::mojom::ManifestShareTargetParamsDataView,
                  ::blink::Manifest::ShareTargetParams>::
    Read(blink::mojom::ManifestShareTargetParamsDataView data,
         ::blink::Manifest::ShareTargetParams* out) {}

bool StructTraits<blink::mojom::ManifestShareTargetDataView,
                  ::blink::Manifest::ShareTarget>::
    Read(blink::mojom::ManifestShareTargetDataView data,
         ::blink::Manifest::ShareTarget* out) {}

bool StructTraits<blink::mojom::ManifestLaunchHandlerDataView,
                  ::blink::Manifest::LaunchHandler>::
    Read(blink::mojom::ManifestLaunchHandlerDataView data,
         ::blink::Manifest::LaunchHandler* out) {}

bool StructTraits<blink::mojom::ManifestTranslationItemDataView,
                  ::blink::Manifest::TranslationItem>::
    Read(blink::mojom::ManifestTranslationItemDataView data,
         ::blink::Manifest::TranslationItem* out) {}

bool StructTraits<blink::mojom::HomeTabParamsDataView,
                  ::blink::Manifest::HomeTabParams>::
    Read(blink::mojom::HomeTabParamsDataView data,
         ::blink::Manifest::HomeTabParams* out) {}

bool StructTraits<blink::mojom::NewTabButtonParamsDataView,
                  ::blink::Manifest::NewTabButtonParams>::
    Read(blink::mojom::NewTabButtonParamsDataView data,
         ::blink::Manifest::NewTabButtonParams* out) {}

blink::mojom::HomeTabUnionDataView::Tag
UnionTraits<blink::mojom::HomeTabUnionDataView,
            ::blink::Manifest::TabStrip::HomeTab>::
    GetTag(const ::blink::Manifest::TabStrip::HomeTab& value) {}

bool UnionTraits<blink::mojom::HomeTabUnionDataView,
                 ::blink::Manifest::TabStrip::HomeTab>::
    Read(blink::mojom::HomeTabUnionDataView data,
         blink::Manifest::TabStrip::HomeTab* out) {}

bool StructTraits<blink::mojom::ManifestTabStripDataView,
                  ::blink::Manifest::TabStrip>::
    Read(blink::mojom::ManifestTabStripDataView data,
         ::blink::Manifest::TabStrip* out) {}

}  // namespace mojo