DDMediaLog.cpp (982B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim:set ts=2 sw=2 sts=2 et cindent: */ 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 "DDMediaLog.h" 8 9 namespace mozilla { 10 11 size_t DDMediaLog::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const { 12 size_t size = mMessages.ShallowSizeOfExcludingThis(aMallocSizeOf); 13 for (const DDLogMessage& message : mMessages) { 14 if (message.mValue.is<const nsCString>()) { 15 size += 16 message.mValue.as<const nsCString>().SizeOfExcludingThisIfUnshared( 17 aMallocSizeOf); 18 } else if (message.mValue.is<MediaResult>()) { 19 size += message.mValue.as<MediaResult>() 20 .Message() 21 .SizeOfExcludingThisIfUnshared(aMallocSizeOf); 22 } 23 } 24 return size; 25 } 26 27 } // namespace mozilla