Skip to content

Commit

Permalink
Bug 1534395 - Rename TabParent to BrowserParent. r=nika
Browse files Browse the repository at this point in the history
This commit renames TabParent to BrowserParent.

Differential Revision: https://phabricator.services.mozilla.com/D28133

--HG--
rename : dom/ipc/TabParent.cpp => dom/ipc/BrowserParent.cpp
rename : dom/ipc/TabParent.h => dom/ipc/BrowserParent.h
extra : rebase_source : d2706b9f42177d8de16068b7b1d088a44b8720a4
extra : histedit_source : a617ddac45c58050ef799116a67d2d983f2a8f6d%2C1d1dabd8761a32d548a6fbf1027be960698f6a5e
  • Loading branch information
eqrion committed Apr 9, 2019
1 parent 3675f24 commit 0eeced8
Show file tree
Hide file tree
Showing 127 changed files with 1,216 additions and 1,162 deletions.
5 changes: 3 additions & 2 deletions accessible/android/SessionAccessibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "nsIPersistentProperties2.h"

#include "mozilla/PresShell.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "mozilla/a11y/DocAccessibleParent.h"
#include "mozilla/a11y/DocManager.h"

Expand Down Expand Up @@ -120,7 +120,8 @@ void SessionAccessibility::Click(int32_t aID) {

SessionAccessibility* SessionAccessibility::GetInstanceFor(
ProxyAccessible* aAccessible) {
auto tab = static_cast<dom::TabParent*>(aAccessible->Document()->Manager());
auto tab =
static_cast<dom::BrowserParent*>(aAccessible->Document()->Manager());
dom::Element* frame = tab->GetOwnerElement();
MOZ_ASSERT(frame);
if (!frame) {
Expand Down
4 changes: 2 additions & 2 deletions accessible/base/FocusManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "mozilla/a11y/DocManager.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"

namespace mozilla {
namespace a11y {
Expand Down Expand Up @@ -176,7 +176,7 @@ void FocusManager::ActiveItemChanged(Accessible* aItem, bool aCheckIfActive) {
if (domfm) {
nsIContent* focusedElm = domfm->GetFocusedElement();
if (EventStateManager::IsRemoteTarget(focusedElm)) {
dom::TabParent* tab = dom::TabParent::GetFrom(focusedElm);
dom::BrowserParent* tab = dom::BrowserParent::GetFrom(focusedElm);
if (tab) {
a11y::DocAccessibleParent* dap = tab->GetTopLevelDocAccessible();
if (dap) {
Expand Down
4 changes: 2 additions & 2 deletions accessible/generic/OuterDocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "nsAccUtils.h"
#include "DocAccessible-inl.h"
#include "mozilla/a11y/DocAccessibleParent.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "Role.h"
#include "States.h"

Expand Down Expand Up @@ -185,7 +185,7 @@ Accessible* OuterDocAccessible::GetChildAt(uint32_t aIndex) const {
#endif // defined(XP_WIN)

DocAccessibleParent* OuterDocAccessible::RemoteChildDoc() const {
dom::TabParent* tab = dom::TabParent::GetFrom(GetContent());
dom::BrowserParent* tab = dom::BrowserParent::GetFrom(GetContent());
if (!tab) return nullptr;

return tab->GetTopLevelDocAccessible();
Expand Down
8 changes: 4 additions & 4 deletions accessible/generic/RootAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,12 @@ ProxyAccessible* RootAccessible::GetPrimaryRemoteTopLevelContentDoc() const {
mDocumentNode->GetDocShell()->GetTreeOwner(getter_AddRefs(owner));
NS_ENSURE_TRUE(owner, nullptr);

nsCOMPtr<nsIRemoteTab> tabParent;
owner->GetPrimaryRemoteTab(getter_AddRefs(tabParent));
if (!tabParent) {
nsCOMPtr<nsIRemoteTab> browserParent;
owner->GetPrimaryRemoteTab(getter_AddRefs(browserParent));
if (!browserParent) {
return nullptr;
}

auto tab = static_cast<dom::TabParent*>(tabParent.get());
auto tab = static_cast<dom::BrowserParent*>(browserParent.get());
return tab->GetTopLevelDocAccessible();
}
10 changes: 5 additions & 5 deletions accessible/ipc/DocAccessibleParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "DocAccessibleParent.h"
#include "mozilla/a11y/Platform.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "xpcAccessibleDocument.h"
#include "xpcAccEvents.h"
#include "nsAccUtils.h"
Expand Down Expand Up @@ -541,7 +541,7 @@ ipc::IPCResult DocAccessibleParent::AddChildDoc(DocAccessibleParent* aChildDoc,
mozilla::ipc::IPCResult DocAccessibleParent::RecvShutdown() {
Destroy();

auto mgr = static_cast<dom::TabParent*>(Manager());
auto mgr = static_cast<dom::BrowserParent*>(Manager());
if (!mgr->IsDestroyed()) {
if (!PDocAccessibleParent::Send__delete__(this)) {
return IPC_FAIL_NO_REASON(mgr);
Expand Down Expand Up @@ -654,7 +654,7 @@ void DocAccessibleParent::MaybeInitWindowEmulation() {
return;
}

// XXX get the bounds from the tabParent instead of poking at accessibles
// XXX get the bounds from the browserParent instead of poking at accessibles
// which might not exist yet.
Accessible* outerDoc = OuterDocOfRemoteBrowser();
if (!outerDoc) {
Expand All @@ -672,7 +672,7 @@ void DocAccessibleParent::MaybeInitWindowEmulation() {
rect.MoveToX(rootRect.X() - rect.X());
rect.MoveToY(rect.Y() - rootRect.Y());

auto tab = static_cast<dom::TabParent*>(Manager());
auto tab = static_cast<dom::BrowserParent*>(Manager());
tab->GetDocShellIsActive(&isActive);
}

Expand Down Expand Up @@ -708,7 +708,7 @@ void DocAccessibleParent::MaybeInitWindowEmulation() {
*/
void DocAccessibleParent::SendParentCOMProxy() {
// Make sure that we're not racing with a tab shutdown
auto tab = static_cast<dom::TabParent*>(Manager());
auto tab = static_cast<dom::BrowserParent*>(Manager());
MOZ_ASSERT(tab);
if (tab->IsDestroyed()) {
return;
Expand Down
4 changes: 2 additions & 2 deletions accessible/ipc/ProxyAccessibleBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "mozilla/a11y/ProxyAccessible.h"
#include "mozilla/a11y/Role.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "mozilla/Unused.h"
#include "RelationType.h"
#include "xpcAccessibleDocument.h"
Expand Down Expand Up @@ -116,7 +116,7 @@ Derived* ProxyAccessibleBase<Derived>::EmbeddedChildAt(size_t aChildIdx) {

template <class Derived>
Accessible* ProxyAccessibleBase<Derived>::OuterDocOfRemoteBrowser() const {
auto tab = static_cast<dom::TabParent*>(mDoc->Manager());
auto tab = static_cast<dom::BrowserParent*>(mDoc->Manager());
dom::Element* frame = tab->GetOwnerElement();
NS_ASSERTION(frame, "why isn't the tab in a frame!");
if (!frame) return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion accessible/ipc/other/ProxyAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "DocAccessible.h"
#include "mozilla/a11y/DocManager.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "mozilla/Unused.h"
#include "mozilla/a11y/Platform.h"
#include "RelationType.h"
Expand Down
2 changes: 1 addition & 1 deletion accessible/ipc/win/ProxyAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "DocAccessible.h"
#include "mozilla/a11y/DocManager.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "mozilla/Unused.h"
#include "mozilla/a11y/Platform.h"
#include "RelationType.h"
Expand Down
4 changes: 2 additions & 2 deletions accessible/windows/msaa/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "nsIScrollableFrame.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/NodeInfo.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "nsIServiceManager.h"
#include "nsNameSpaceManager.h"
#include "nsTextFormatter.h"
Expand Down Expand Up @@ -1310,7 +1310,7 @@ static already_AddRefed<IDispatch> GetProxiedAccessibleInSubtree(
if (aDoc->IsTopLevel()) {
wrapper->GetNativeInterface(getter_AddRefs(comProxy));
} else {
auto tab = static_cast<dom::TabParent*>(aDoc->Manager());
auto tab = static_cast<dom::BrowserParent*>(aDoc->Manager());
MOZ_ASSERT(tab);
DocAccessibleParent* topLevelDoc = tab->GetTopLevelDocAccessible();
MOZ_ASSERT(topLevelDoc && topLevelDoc->IsTopLevel());
Expand Down
6 changes: 3 additions & 3 deletions docshell/shistory/ParentSHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "mozilla/dom/ParentSHistory.h"
#include "mozilla/dom/ParentSHistoryBinding.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "nsDocShell.h"
#include "nsFrameLoader.h"
#include "nsXULAppAPI.h"
Expand All @@ -25,8 +25,8 @@ nsDocShell* ParentSHistory::GetDocShell() {
return nsDocShell::Cast(mFrameLoader->GetExistingDocShell());
}

TabParent* ParentSHistory::GetTabParent() {
return static_cast<TabParent*>(mFrameLoader->GetRemoteBrowser());
BrowserParent* ParentSHistory::GetBrowserParent() {
return static_cast<BrowserParent*>(mFrameLoader->GetRemoteBrowser());
}

already_AddRefed<ChildSHistory> ParentSHistory::GetChildIfSameProcess() {
Expand Down
4 changes: 2 additions & 2 deletions docshell/shistory/ParentSHistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class nsDocShell;
namespace mozilla {
namespace dom {

class TabParent;
class BrowserParent;
class ChildSHistory;

class ParentSHistory : public nsISupports, public nsWrapperCache {
Expand All @@ -50,7 +50,7 @@ class ParentSHistory : public nsISupports, public nsWrapperCache {

private:
nsDocShell* GetDocShell();
TabParent* GetTabParent();
BrowserParent* GetBrowserParent();

already_AddRefed<ChildSHistory> GetChildIfSameProcess();

Expand Down
2 changes: 1 addition & 1 deletion dom/base/TextInputProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ nsresult TextInputProcessor::PrepareKeyboardEventToDispatch(

// When this emulates real input only in content process, we need to
// initialize edit commands with the main process's widget via PuppetWidget
// because they are initialized by TabParent before content process treats
// because they are initialized by BrowserParent before content process treats
// them.
if (aKeyboardEvent.mIsSynthesizedByTIP && !XRE_IsParentProcess()) {
// Note that retrieving edit commands from content process is expensive.
Expand Down
8 changes: 4 additions & 4 deletions dom/base/nsContentAreaDragDrop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "mozilla/dom/DataTransfer.h"
#include "nsIMIMEInfo.h"
#include "nsRange.h"
#include "TabParent.h"
#include "BrowserParent.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLAreaElement.h"
#include "mozilla/dom/HTMLAnchorElement.h"
Expand Down Expand Up @@ -552,10 +552,10 @@ nsresult DragDataProducer::Produce(DataTransfer* aDataTransfer, bool* aCanDrag,
if (flo) {
RefPtr<nsFrameLoader> fl = flo->GetFrameLoader();
if (fl) {
TabParent* tp = static_cast<TabParent*>(fl->GetRemoteBrowser());
BrowserParent* tp = static_cast<BrowserParent*>(fl->GetRemoteBrowser());
if (tp) {
// We have a TabParent, so it may have data for dnd in case the child
// process started a dnd session.
// We have a BrowserParent, so it may have data for dnd in case the
// child process started a dnd session.
tp->AddInitialDnDDataTo(aDataTransfer, aPrincipal);
}
}
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsContentPermissionHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "mozilla/dom/PContentPermissionRequestParent.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/TabChild.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "mozilla/Attributes.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/Preferences.h"
Expand Down
6 changes: 3 additions & 3 deletions dom/base/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/BrowserBridgeChild.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "mozilla/dom/Text.h"
#include "mozilla/dom/TouchEvent.h"
#include "mozilla/dom/ShadowRoot.h"
Expand Down Expand Up @@ -7248,7 +7248,7 @@ bool nsContentUtils::CallOnAllRemoteChildren(
mozilla::dom::ipc::MessageManagerCallback* cb = childMM->GetCallback();
if (cb) {
nsFrameLoader* fl = static_cast<nsFrameLoader*>(cb);
TabParent* remote = TabParent::GetFrom(fl);
BrowserParent* remote = BrowserParent::GetFrom(fl);
if (remote && aCallback) {
if (aCallback(remote, aArg)) {
return true;
Expand Down Expand Up @@ -7282,7 +7282,7 @@ struct UIStateChangeInfo {
mShowFocusRings(aShowFocusRings) {}
};

bool SetKeyboardIndicatorsChild(TabParent* aParent, void* aArg) {
bool SetKeyboardIndicatorsChild(BrowserParent* aParent, void* aArg) {
UIStateChangeInfo* stateInfo = static_cast<UIStateChangeInfo*>(aArg);
Unused << aParent->SendSetKeyboardIndicators(stateInfo->mShowAccelerators,
stateInfo->mShowFocusRings);
Expand Down
10 changes: 5 additions & 5 deletions dom/base/nsContentUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ContentChild;
class ContentParent;
class TabChild;
class Selection;
class TabParent;
class BrowserParent;
} // namespace dom

namespace ipc {
Expand Down Expand Up @@ -202,8 +202,8 @@ struct EventNameMapping {
bool mMaybeSpecialSVGorSMILEvent;
};

typedef bool (*CallOnRemoteChildFunction)(mozilla::dom::TabParent* aTabParent,
void* aArg);
typedef bool (*CallOnRemoteChildFunction)(
mozilla::dom::BrowserParent* aBrowserParent, void* aArg);

class nsContentUtils {
friend class nsAutoScriptBlockerSuppressNodeRemoved;
Expand Down Expand Up @@ -2805,8 +2805,8 @@ class nsContentUtils {

/*
* Call nsPIDOMWindow::SetKeyboardIndicators all all remote children. This is
* in here rather than nsGlobalWindow because TabParent indirectly includes
* Windows headers which aren't allowed there.
* in here rather than nsGlobalWindow because BrowserParent indirectly
* includes Windows headers which aren't allowed there.
*/
static void SetKeyboardIndicatorsOnRemoteChildren(
nsPIDOMWindowOuter* aWindow, UIStateChangeType aShowAccelerators,
Expand Down
10 changes: 5 additions & 5 deletions dom/base/nsFocusManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 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/dom/TabParent.h"
#include "mozilla/dom/BrowserParent.h"

#include "nsFocusManager.h"

Expand Down Expand Up @@ -1089,7 +1089,7 @@ void nsFocusManager::EnsureCurrentWidgetFocused() {
}
}

bool ActivateOrDeactivateChild(TabParent* aParent, void* aArg) {
bool ActivateOrDeactivateChild(BrowserParent* aParent, void* aArg) {
bool active = static_cast<bool>(aArg);
Unused << aParent->SendParentActivated(active);
return false;
Expand Down Expand Up @@ -1637,7 +1637,7 @@ bool nsFocusManager::Blur(nsPIDOMWindowOuter* aWindowToClear,

// if the object being blurred is a remote browser, deactivate remote
// content
if (TabParent* remote = TabParent::GetFrom(element)) {
if (BrowserParent* remote = BrowserParent::GetFrom(element)) {
remote->Deactivate();
LOGFOCUS(("Remote browser deactivated %p", remote));
}
Expand Down Expand Up @@ -1862,7 +1862,7 @@ void nsFocusManager::Focus(nsPIDOMWindowOuter* aWindow, Element* aElement,

// if the object being focused is a remote browser, activate remote
// content
if (TabParent* remote = TabParent::GetFrom(aElement)) {
if (BrowserParent* remote = BrowserParent::GetFrom(aElement)) {
remote->Activate();
LOGFOCUS(("Remote browser activated %p", remote));
}
Expand Down Expand Up @@ -3492,7 +3492,7 @@ nsresult nsFocusManager::GetNextTabbableContent(
// code to have the caller return early. If the child ends up not
// being focusable in some way, the child process will call back
// into document navigation again by calling MoveFocus.
TabParent* remote = TabParent::GetFrom(currentContent);
BrowserParent* remote = BrowserParent::GetFrom(currentContent);
if (remote) {
remote->NavigateByKey(aForward, aForDocumentNavigation);
return NS_SUCCESS_DOM_NO_OPERATION;
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsFocusManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PresShell;
namespace dom {
class Element;
struct FocusOptions;
class TabParent;
class BrowserParent;
} // namespace dom
} // namespace mozilla

Expand Down
Loading

0 comments on commit 0eeced8

Please sign in to comment.