2016-10-07 09:38:44 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2017-01-18 03:59:03 +03:00
|
|
|
#include "MediaContainerType.h"
|
2016-10-07 09:38:44 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2017-01-18 03:59:03 +03:00
|
|
|
size_t MediaContainerType::SizeOfExcludingThis(
|
|
|
|
MallocSizeOf aMallocSizeOf) const {
|
2016-12-22 03:54:56 +03:00
|
|
|
return mExtendedMIMEType.SizeOfExcludingThis(aMallocSizeOf);
|
|
|
|
}
|
|
|
|
|
2017-01-18 03:59:03 +03:00
|
|
|
Maybe<MediaContainerType> MakeMediaContainerType(const nsAString& aType) {
|
2016-12-01 05:05:45 +03:00
|
|
|
Maybe<MediaExtendedMIMEType> mime = MakeMediaExtendedMIMEType(aType);
|
|
|
|
if (mime) {
|
2018-05-30 22:15:35 +03:00
|
|
|
return Some(MediaContainerType(std::move(*mime)));
|
2016-12-01 04:56:11 +03:00
|
|
|
}
|
2016-12-01 05:05:45 +03:00
|
|
|
return Nothing();
|
2016-12-01 04:56:11 +03:00
|
|
|
}
|
|
|
|
|
2017-01-18 03:59:03 +03:00
|
|
|
Maybe<MediaContainerType> MakeMediaContainerType(const nsACString& aType) {
|
|
|
|
return MakeMediaContainerType(NS_ConvertUTF8toUTF16(aType));
|
2016-12-01 04:56:11 +03:00
|
|
|
}
|
|
|
|
|
2017-01-18 03:59:03 +03:00
|
|
|
Maybe<MediaContainerType> MakeMediaContainerType(const char* aType) {
|
2016-12-01 04:56:11 +03:00
|
|
|
if (!aType) {
|
|
|
|
return Nothing();
|
|
|
|
}
|
2017-01-18 03:59:03 +03:00
|
|
|
return MakeMediaContainerType(nsDependentCString(aType));
|
2016-10-07 09:38:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace mozilla
|