chromium/content/browser/media/session/media_metadata_sanitizer.cc

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

#include "content/browser/media/session/media_metadata_sanitizer.h"

#include <algorithm>
#include <string>

#include "base/time/time.h"
#include "services/media_session/public/cpp/media_image.h"
#include "services/media_session/public/cpp/media_metadata.h"

namespace content {

namespace {

// Maximum length for all the strings inside the MediaMetadata when it is sent
// over IPC. The renderer process should truncate the strings before sending
// the MediaMetadata and the browser process must do the same when receiving
// it.
const size_t kMaxIPCStringLength =;

// Maximum type length of MediaImage, which conforms to RFC 4288
// (https://tools.ietf.org/html/rfc4288).
const size_t kMaxMediaImageTypeLength =;

// Maximum number of MediaImages inside the MediaMetadata.
const size_t kMaxNumberOfMediaImages =;

// Maximum number of `ChapterInformation` inside the `MediaMetadata`.
const size_t kMaxNumberOfChapters =;

// Maximum of sizes in a MediaImage.
const size_t kMaxNumberOfMediaImageSizes =;

bool CheckMediaImageSrcSanity(const GURL& src) {}

bool CheckMediaImageSanity(const media_session::MediaImage& image) {}

bool CheckChapterInformationSanity(
    const media_session::ChapterInformation& chapter) {}

}  // anonymous namespace

bool MediaMetadataSanitizer::CheckSanity(
    const blink::mojom::SpecMediaMetadataPtr& metadata) {}

}  // namespace content