Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #include "MediaContainerType.h"
8 :
9 : namespace mozilla {
10 :
11 : size_t
12 0 : MediaContainerType::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
13 : {
14 0 : return mExtendedMIMEType.SizeOfExcludingThis(aMallocSizeOf);
15 : }
16 :
17 : Maybe<MediaContainerType>
18 0 : MakeMediaContainerType(const nsAString& aType)
19 : {
20 0 : Maybe<MediaExtendedMIMEType> mime = MakeMediaExtendedMIMEType(aType);
21 0 : if (mime) {
22 0 : return Some(MediaContainerType(Move(*mime)));
23 : }
24 0 : return Nothing();
25 : }
26 :
27 : Maybe<MediaContainerType>
28 0 : MakeMediaContainerType(const nsACString& aType)
29 : {
30 0 : return MakeMediaContainerType(NS_ConvertUTF8toUTF16(aType));
31 : }
32 :
33 : Maybe<MediaContainerType>
34 0 : MakeMediaContainerType(const char* aType)
35 : {
36 0 : if (!aType) {
37 0 : return Nothing();
38 : }
39 0 : return MakeMediaContainerType(nsDependentCString(aType));
40 : }
41 :
42 9 : } // namespace mozilla
|