Commit ab147e79 authored by Bogdan Tara's avatar Bogdan Tara
Browse files

Backed out changeset b211dc904649 (bug 1540845) for mingw bustages CLOSED TREE

parent c36e993d
Loading
Loading
Loading
Loading
+8 −18
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
#include "mozilla/dom/DataTransfer.h"
#include "mozilla/dom/DataTransferItemList.h"
#include "mozilla/dom/Event.h"
#include "mozilla/dom/FrameCrashedEvent.h"
#include "mozilla/dom/indexedDB/ActorsParent.h"
#include "mozilla/dom/IPCBlobUtils.h"
#include "mozilla/dom/PaymentRequestParent.h"
@@ -468,27 +467,18 @@ void TabParent::ActorDestroy(ActorDestroyReason why) {
        // and created a new frameloader. If so, we don't fire the event,
        // since the frameloader owner has clearly moved on.
        if (currentFrameLoader == frameLoader) {
          nsString eventName;
          MessageChannel* channel = GetIPCChannel();
          if (channel && !channel->DoBuildIDsMatch()) {
            eventName = NS_LITERAL_STRING("oop-browser-buildid-mismatch");
            nsContentUtils::DispatchTrustedEvent(
                frameElement->OwnerDoc(), frameElement,
                NS_LITERAL_STRING("oop-browser-buildid-mismatch"),
                CanBubble::eYes, Cancelable::eYes);
          } else {
            eventName = NS_LITERAL_STRING("oop-browser-crashed");
            nsContentUtils::DispatchTrustedEvent(
                frameElement->OwnerDoc(), frameElement,
                NS_LITERAL_STRING("oop-browser-crashed"), CanBubble::eYes,
                Cancelable::eYes);
          }

          dom::FrameCrashedEventInit init;
          init.mBubbles = true;
          init.mCancelable = true;
          init.mBrowsingContextId = mBrowsingContext->Id();

          RefPtr<dom::FrameCrashedEvent> event =
              dom::FrameCrashedEvent::Constructor(frameElement->OwnerDoc(),
                                                  eventName, init);
          event->SetTrusted(true);
          event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
          event->WidgetEventPtr()->mFlags.mBubbles = true;
          EventDispatcher::DispatchDOMEvent(frameElement, nullptr, event,
                                            nullptr, nullptr);
        }
      }
    }
+17 −31
Original line number Diff line number Diff line
@@ -14,13 +14,7 @@
    const done = window.opener.wrappedJSObject.done;
    const SimpleTest = window.opener.wrappedJSObject.SimpleTest;

    // Allow the browser to get connected before using the messageManager to cause
    // a crash:
    addEventListener("DOMContentLoaded", () => {
      let browser = document.getElementById('thebrowser');

      let observerPromise = new Promise(resolve => {
        let crashObserver = (subject, topic, data) => {
    function crashObserver(subject, topic, data) {
      is(topic, 'ipc:content-shutdown', 'Received correct observer topic.');
      ok(subject instanceof Ci.nsIPropertyBag2,
         'Subject implements nsIPropertyBag2.');
@@ -32,23 +26,15 @@
      }

      Services.obs.removeObserver(crashObserver, 'ipc:content-shutdown');
          resolve();
      done();
    }

    Services.obs.addObserver(crashObserver, 'ipc:content-shutdown');
      });

      let browsingContextId = browser.frameLoader.browsingContext.id;

      let eventFiredPromise = BrowserTestUtils.waitForEvent(browser, "oop-browser-crashed");
      let eventPromise = eventFiredPromise.then(event => {
        is(event.browsingContextId, browsingContextId,
           "Expected the right browsing context id on the oop-browser-crashed event.");
      })

      BrowserTestUtils.crashBrowser(browser, true, false);

      Promise.all([observerPromise, eventPromise]).then(done);
    // Allow the browser to get connected before using the messageManager to cause
    // a crash:
    addEventListener("DOMContentLoaded", () => {
      BrowserTestUtils.crashBrowser(document.getElementById('thebrowser'), true, false);
    });
  ]]></script>

+0 −19
Original line number Diff line number Diff line
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/.
 */

[Constructor(DOMString type, optional FrameCrashedEventInit eventInitDict), ChromeOnly]
interface FrameCrashedEvent : Event
{
  /**
   * The browsingContextId of the frame that crashed.
   */
  readonly attribute unsigned long long browsingContextId;
};

dictionary FrameCrashedEventInit : EventInit
{
  unsigned long long browsingContextId = 0;
};
+0 −1
Original line number Diff line number Diff line
@@ -1040,7 +1040,6 @@ GENERATED_EVENTS_WEBIDL_FILES = [
    'DeviceProximityEvent.webidl',
    'ErrorEvent.webidl',
    'FontFaceSetLoadEvent.webidl',
    'FrameCrashedEvent.webidl',
    'GamepadAxisMoveEvent.webidl',
    'GamepadButtonEvent.webidl',
    'GamepadEvent.webidl',