Line data Source code
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 :
10 : namespace mozilla {
11 :
12 0 : NS_IMPL_ADDREF(GMPCrashHelper)
13 0 : NS_IMPL_RELEASE_WITH_DESTROY(GMPCrashHelper, Destroy())
14 :
15 : void
16 0 : GMPCrashHelper::Destroy()
17 : {
18 0 : if (NS_IsMainThread()) {
19 0 : delete this;
20 : } else {
21 : // Don't addref, as then we'd end up releasing after the detele runs!
22 0 : SystemGroup::Dispatch("GMPCrashHelper::Destroy",
23 : TaskCategory::Other,
24 0 : NewNonOwningRunnableMethod("GMPCrashHelper::Destroy",
25 : this,
26 0 : &GMPCrashHelper::Destroy));
27 : }
28 0 : }
29 :
30 : } // namespace mozilla
|