tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

GMPCrashHelperHolder.cpp (1009B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      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 file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "GMPCrashHelperHolder.h"
      8 
      9 #include "GMPService.h"
     10 #include "mozilla/RefPtr.h"
     11 #include "mozilla/ipc/ProtocolUtils.h"
     12 #include "nsPIDOMWindow.h"
     13 
     14 namespace mozilla {
     15 
     16 void GMPCrashHelperHolder::SetCrashHelper(GMPCrashHelper* aHelper) {
     17  mCrashHelper = aHelper;
     18 }
     19 
     20 GMPCrashHelper* GMPCrashHelperHolder::GetCrashHelper() { return mCrashHelper; }
     21 
     22 void GMPCrashHelperHolder::MaybeDisconnect(bool aAbnormalShutdown) {
     23  if (!aAbnormalShutdown) {
     24    RefPtr<gmp::GeckoMediaPluginService> service(
     25        gmp::GeckoMediaPluginService::GetGeckoMediaPluginService());
     26    if (service) {
     27      service->DisconnectCrashHelper(GetCrashHelper());
     28    }
     29  }
     30 }
     31 
     32 }  // namespace mozilla