/src/mozilla-central/dom/media/gmp/GMPCrashHelper.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
3 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | | |
6 | | #include "GMPCrashHelper.h" |
7 | | #include "runnable_utils.h" |
8 | | #include "nsThreadUtils.h" |
9 | | #include "SystemGroup.h" |
10 | | |
11 | | namespace mozilla { |
12 | | |
13 | | NS_IMPL_ADDREF(GMPCrashHelper) |
14 | | NS_IMPL_RELEASE_WITH_DESTROY(GMPCrashHelper, Destroy()) |
15 | | |
16 | | void |
17 | | GMPCrashHelper::Destroy() |
18 | 0 | { |
19 | 0 | if (NS_IsMainThread()) { |
20 | 0 | delete this; |
21 | 0 | } else { |
22 | 0 | // Don't addref, as then we'd end up releasing after the detele runs! |
23 | 0 | SystemGroup::Dispatch(TaskCategory::Other, |
24 | 0 | NewNonOwningRunnableMethod("GMPCrashHelper::Destroy", |
25 | 0 | this, |
26 | 0 | &GMPCrashHelper::Destroy)); |
27 | 0 | } |
28 | 0 | } |
29 | | |
30 | | } // namespace mozilla |