Bug 1535282 - Add logging of content process-level focus changes. r=nika

Depends on D22468

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Henri Sivonen 2019-03-14 15:55:35 +00:00
parent 83788eac4c
commit b5a365766b
2 changed files with 14 additions and 4 deletions

View File

@ -1635,13 +1635,13 @@ bool nsFocusManager::Blur(nsPIDOMWindowOuter* aWindowToClear,
// content
if (TabParent* remote = TabParent::GetFrom(element)) {
remote->Deactivate();
LOGFOCUS(("Remote browser deactivated"));
LOGFOCUS(("Remote browser deactivated %p", remote));
}
// Same as above but for out-of-process iframes
if (BrowserBridgeChild* bbc = BrowserBridgeChild::GetFrom(element)) {
bbc->Deactivate();
LOGFOCUS(("Out-of-process iframe deactivated"));
LOGFOCUS(("Out-of-process iframe deactivated %p", bbc));
}
}
@ -1856,13 +1856,13 @@ void nsFocusManager::Focus(nsPIDOMWindowOuter* aWindow, Element* aElement,
// content
if (TabParent* remote = TabParent::GetFrom(aElement)) {
remote->Activate();
LOGFOCUS(("Remote browser activated"));
LOGFOCUS(("Remote browser activated %p", remote));
}
// Same as above but for out-of-process iframes
if (BrowserBridgeChild* bbc = BrowserBridgeChild::GetFrom(aElement)) {
bbc->Activate();
LOGFOCUS(("Out-of-process iframe activated"));
LOGFOCUS(("Out-of-process iframe activated %p", bbc));
}
}

View File

@ -131,6 +131,11 @@ using namespace mozilla::gfx;
using mozilla::Unused;
LazyLogModule gBrowserFocusLog("BrowserFocus");
#define LOGBROWSERFOCUS(args) \
MOZ_LOG(gBrowserFocusLog, mozilla::LogLevel::Debug, args)
// The flags passed by the webProgress notifications are 16 bits shifted
// from the ones registered by webProgressListeners.
#define NOTIFY_FLAG_SHIFT 16
@ -482,6 +487,8 @@ void TabParent::ActorDestroy(ActorDestroyReason why) {
mozilla::ipc::IPCResult TabParent::RecvMoveFocus(
const bool& aForward, const bool& aForDocumentNavigation) {
LOGBROWSERFOCUS(("RecvMoveFocus %p, aForward: %d, aForDocumentNavigation: %d",
this, aForward, aForDocumentNavigation));
BrowserBridgeParent* bridgeParent = GetBrowserBridgeParent();
if (bridgeParent) {
mozilla::Unused << bridgeParent->SendMoveFocus(aForward,
@ -826,12 +833,14 @@ void TabParent::HandleAccessKey(const WidgetKeyboardEvent& aEvent,
}
void TabParent::Activate() {
LOGBROWSERFOCUS(("Activate %p", this));
if (!mIsDestroyed) {
Unused << Manager()->SendActivate(this);
}
}
void TabParent::Deactivate() {
LOGBROWSERFOCUS(("Deactivate %p", this));
if (!mIsDestroyed) {
Unused << Manager()->SendDeactivate(this);
}
@ -1902,6 +1911,7 @@ mozilla::ipc::IPCResult TabParent::RecvOnWindowedPluginKeyEvent(
}
mozilla::ipc::IPCResult TabParent::RecvRequestFocus(const bool& aCanRaise) {
LOGBROWSERFOCUS(("RecvRequestFocus %p, aCanRaise: %d", this, aCanRaise));
BrowserBridgeParent* bridgeParent = GetBrowserBridgeParent();
if (bridgeParent) {
mozilla::Unused << bridgeParent->SendRequestFocus(aCanRaise);