Commit ed07da86 authored by Gurzau Raul's avatar Gurzau Raul
Browse files

Backed out 4 changesets (bug 1525427) for failing at...

Backed out 4 changesets (bug 1525427) for failing at /browser_browsingContext-embedder.js on a CLOSED TREE.

Backed out changeset 0227a59eba8e (bug 1525427)
Backed out changeset 18fba79d8671 (bug 1525427)
Backed out changeset f7c82615ea05 (bug 1525427)
Backed out changeset 4a210c9266ed (bug 1525427)
parent 29c843ab
Loading
Loading
Loading
Loading
+2 −28
Original line number Diff line number Diff line
@@ -13,12 +13,9 @@
#include "mozilla/dom/BrowsingContextBinding.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/Location.h"
#include "mozilla/dom/LocationBinding.h"
#include "mozilla/dom/WindowBinding.h"
#include "mozilla/dom/WindowGlobalChild.h"
#include "mozilla/dom/WindowGlobalParent.h"
#include "mozilla/dom/WindowProxyHolder.h"
#include "mozilla/Assertions.h"
#include "mozilla/ClearOnShutdown.h"
@@ -206,27 +203,6 @@ void BrowsingContext::SetDocShell(nsIDocShell* aDocShell) {
  mIsInProcess = true;
}

void BrowsingContext::SetEmbedderElement(Element* aEmbedder) {
  mEmbedderElement = aEmbedder;

  // Notify the parent process of the embedding status. We don't need to do
  // this when clearing our embedder, as we're being destroyed either way.
  if (mEmbedderElement) {
    nsCOMPtr<nsPIDOMWindowInner> embedderGlobal =
        do_QueryInterface(mEmbedderElement->GetOwnerGlobal());
    RefPtr<WindowGlobalChild> wgc = embedderGlobal->GetWindowGlobalChild();

    // If we're in-process, synchronously perform the update to ensure we don't
    // get out of sync.
    // XXX(nika): This is super gross, and I don't like it one bit.
    if (RefPtr<WindowGlobalParent> wgp = wgc->GetParentActor()) {
      Canonical()->SetEmbedderWindowGlobal(wgp);
    } else {
      wgc->SendDidEmbedBrowsingContext(this);
    }
  }
}

void BrowsingContext::Attach(bool aFromIPC) {
  MOZ_LOG(GetLog(), LogLevel::Debug,
          ("%s: %s 0x%08" PRIx64 " to 0x%08" PRIx64,
@@ -529,8 +505,7 @@ bool BrowsingContext::GetUserGestureActivation() {
NS_IMPL_CYCLE_COLLECTION_CLASS(BrowsingContext)

NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(BrowsingContext)
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell, mChildren, mParent, mGroup,
                                  mEmbedderElement)
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell, mChildren, mParent, mGroup)
  if (XRE_IsParentProcess()) {
    CanonicalBrowsingContext::Cast(tmp)->Unlink();
  }
@@ -538,8 +513,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(BrowsingContext)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END

NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(BrowsingContext)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocShell, mChildren, mParent, mGroup,
                                    mEmbedderElement)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocShell, mChildren, mParent, mGroup)
  if (XRE_IsParentProcess()) {
    CanonicalBrowsingContext::Cast(tmp)->Traverse(cb);
  }
+0 −8
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ class BrowsingContent;
class BrowsingContextGroup;
class CanonicalBrowsingContext;
class ContentParent;
class Element;
template <typename>
struct Nullable;
template <typename T>
@@ -123,11 +122,6 @@ class BrowsingContext : public nsWrapperCache,
  nsIDocShell* GetDocShell() { return mDocShell; }
  void SetDocShell(nsIDocShell* aDocShell);

  // Get the embedder element for this BrowsingContext if the embedder is
  // in-process, or null if it's not.
  Element* GetEmbedderElement() const { return mEmbedderElement; }
  void SetEmbedderElement(Element* aEmbedder);

  // Get the outer window object for this BrowsingContext if it is in-process
  // and still has a docshell, or null otherwise.
  nsPIDOMWindowOuter* GetDOMWindow() const {
@@ -442,8 +436,6 @@ class BrowsingContext : public nsWrapperCache,
  Children mChildren;
  nsCOMPtr<nsIDocShell> mDocShell;

  RefPtr<Element> mEmbedderElement;

  // This is not a strong reference, but using a JS::Heap for that should be
  // fine. The JSObject stored in here should be a proxy with a
  // nsOuterWindowProxy handler, which will update the pointer from its
+2 −18
Original line number Diff line number Diff line
@@ -99,20 +99,6 @@ void CanonicalBrowsingContext::SetCurrentWindowGlobal(
  mCurrentWindowGlobal = aGlobal;
}

void CanonicalBrowsingContext::SetEmbedderWindowGlobal(
    WindowGlobalParent* aGlobal) {
  MOZ_RELEASE_ASSERT(aGlobal, "null embedder");
  if (RefPtr<BrowsingContext> parent = GetParent()) {
    MOZ_RELEASE_ASSERT(aGlobal->BrowsingContext() == parent,
                       "Embedder has incorrect browsing context");
  } else {
    MOZ_RELEASE_ASSERT(aGlobal->IsInProcess(),
                       "Toplevel must have a parent-process embedder");
  }

  mEmbedderWindowGlobal = aGlobal;
}

bool CanonicalBrowsingContext::ValidateTransaction(
    const Transaction& aTransaction, ContentParent* aProcess) {
  // Check that the correct process is performing sets for transactions with
@@ -134,14 +120,12 @@ JSObject* CanonicalBrowsingContext::WrapObject(
void CanonicalBrowsingContext::Traverse(
    nsCycleCollectionTraversalCallback& cb) {
  CanonicalBrowsingContext* tmp = this;
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindowGlobals, mCurrentWindowGlobal,
                                    mEmbedderWindowGlobal);
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindowGlobals);
}

void CanonicalBrowsingContext::Unlink() {
  CanonicalBrowsingContext* tmp = this;
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindowGlobals, mCurrentWindowGlobal,
                                  mEmbedderWindowGlobal);
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindowGlobals);
}

void CanonicalBrowsingContext::NotifyStartDelayedAutoplayMedia() {
+0 −6
Original line number Diff line number Diff line
@@ -50,11 +50,6 @@ class CanonicalBrowsingContext final : public BrowsingContext {
  }
  void SetCurrentWindowGlobal(WindowGlobalParent* aGlobal);

  WindowGlobalParent* GetEmbedderWindowGlobal() const {
    return mEmbedderWindowGlobal;
  }
  void SetEmbedderWindowGlobal(WindowGlobalParent* aGlobal);

  JSObject* WrapObject(JSContext* aCx,
                       JS::Handle<JSObject*> aGivenProto) override;

@@ -100,7 +95,6 @@ class CanonicalBrowsingContext final : public BrowsingContext {
  // All live window globals within this browsing context.
  nsTHashtable<nsRefPtrHashKey<WindowGlobalParent>> mWindowGlobals;
  RefPtr<WindowGlobalParent> mCurrentWindowGlobal;
  RefPtr<WindowGlobalParent> mEmbedderWindowGlobal;

  // Generation information for each content process which has interacted with
  // this CanonicalBrowsingContext, by ChildID.
+0 −1
Original line number Diff line number Diff line
@@ -119,4 +119,3 @@ skip-if = true # Bug 1220415
[browser_browsingContext-01.js]
[browser_browsingContext-02.js]
[browser_browsingContext-03.js]
[browser_browsingContext-embedder.js]
Loading