From c071f97430060933c3616ca10bb503be35fa02bb Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Thu, 21 May 2015 09:52:26 +1200 Subject: [PATCH] Bug 1053413 part 6 - Remove fullscreen-related observer notification sending from nsDocument. r=smaug --HG-- extra : source : b9206c448cf0d8715ff0c8eba128c86a11305513 --- dom/base/nsDocument.cpp | 56 ----------------------------------------- 1 file changed, 56 deletions(-) diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index dd6e8f406177..14f25fbecd53 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -11099,35 +11099,6 @@ nsIDocument::ExitFullscreen(nsIDocument* aDoc, bool aRunAsync) nsDocument::ExitFullscreen(aDoc); } -// Returns true if the document is a direct child of a cross process parent -// mozbrowser iframe or TabParent. This is the case when the document has -// a null parent and its DocShell reports that it is a browser frame, or -// we can get a TabChild from it. -static bool -HasCrossProcessParent(nsIDocument* aDocument) -{ - if (XRE_GetProcessType() != GeckoProcessType_Content) { - return false; - } - if (aDocument->GetParentDocument() != nullptr) { - return false; - } - nsPIDOMWindow* win = aDocument->GetWindow(); - if (!win) { - return false; - } - nsCOMPtr docShell = win->GetDocShell(); - if (!docShell) { - return false; - } - TabChild* tabChild(TabChild::GetFrom(docShell)); - if (!tabChild) { - return false; - } - - return true; -} - static bool CountFullscreenSubDocuments(nsIDocument* aDoc, void* aData) { @@ -11167,21 +11138,6 @@ ResetFullScreen(nsIDocument* aDocument, void* aData) NS_ASSERTION(!aDocument->IsFullScreenDoc(), "Should reset full-screen"); nsTArray* changed = reinterpret_cast*>(aData); changed->AppendElement(aDocument); - - if (HasCrossProcessParent(aDocument)) { - // We're at the top of the content-process side doc tree. Ask the parent - // process to exit fullscreen. - nsCOMPtr os = mozilla::services::GetObserverService(); - os->NotifyObservers(aDocument, "ask-parent-to-exit-fullscreen", nullptr); - } - - // Dispatch a notification so that if this document has any - // cross-process subdocuments, they'll be notified to exit fullscreen. - // The BrowserElementParent listens for this event and performs the - // cross process notification if it has a remote child process. - nsCOMPtr os = mozilla::services::GetObserverService(); - os->NotifyObservers(aDocument, "ask-children-to-exit-fullscreen", nullptr); - aDocument->EnumerateSubDocuments(ResetFullScreen, aData); } return true; @@ -11305,12 +11261,6 @@ nsDocument::RestorePreviousFullScreenState() nsCOMPtr fullScreenDoc = GetFullscreenLeaf(this); - // The fullscreen document may contain a