michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: set sw=4 ts=8 et tw=80 : michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #include "mozilla/plugins/PluginModuleChild.h" michael@0: #include "ContentChild.h" michael@0: #include "CrashReporterChild.h" michael@0: #include "nsXULAppAPI.h" michael@0: michael@0: using mozilla::plugins::PluginModuleChild; michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: /*static*/ michael@0: PCrashReporterChild* michael@0: CrashReporterChild::GetCrashReporter() michael@0: { michael@0: const InfallibleTArray* reporters = nullptr; michael@0: switch (XRE_GetProcessType()) { michael@0: case GeckoProcessType_Content: { michael@0: ContentChild* child = ContentChild::GetSingleton(); michael@0: reporters = &child->ManagedPCrashReporterChild(); michael@0: break; michael@0: } michael@0: case GeckoProcessType_Plugin: { michael@0: PluginModuleChild* child = PluginModuleChild::current(); michael@0: reporters = &child->ManagedPCrashReporterChild(); michael@0: break; michael@0: } michael@0: default: michael@0: break; michael@0: } michael@0: if (reporters && reporters->Length() > 0) { michael@0: return reporters->ElementAt(0); michael@0: } michael@0: return nullptr; michael@0: } michael@0: michael@0: } michael@0: }