dom/ipc/CrashReporterChild.cpp
author B2G Bumper Bot <release+b2gbumper@mozilla.com>
Fri, 27 Jun 2014 17:00:29 -0700
changeset 208544 135686e1d4f41d1df1b172238bc8a4f9d534d5d9
parent 106838 b5c4b792f3f2a047e3517472d72842a76afb77cd
child 239363 0f7fd7a22708cddd947c73b1de162eb1206fea7b
permissions -rw-r--r--
Bumping manifests a=b2g-bump

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: set sw=4 ts=8 et tw=80 : 
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/plugins/PluginModuleChild.h"
#include "ContentChild.h"
#include "CrashReporterChild.h"
#include "nsXULAppAPI.h"

using mozilla::plugins::PluginModuleChild;

namespace mozilla {
namespace dom {

/*static*/
PCrashReporterChild*
CrashReporterChild::GetCrashReporter()
{
  const InfallibleTArray<PCrashReporterChild*>* reporters = nullptr;
  switch (XRE_GetProcessType()) {
    case GeckoProcessType_Content: {
      ContentChild* child = ContentChild::GetSingleton();
      reporters = &child->ManagedPCrashReporterChild();
      break;
    }
    case GeckoProcessType_Plugin: {
      PluginModuleChild* child = PluginModuleChild::current();
      reporters = &child->ManagedPCrashReporterChild();
      break;
    }
    default:
      break;
  }
  if (reporters && reporters->Length() > 0) {
    return reporters->ElementAt(0);
  }
  return nullptr;
}

}
}