Bug 918288 - Add logging for some of the SetTargetAPZ codepaths. r=botond

This commit is contained in:
Kartikaya Gupta 2014-11-21 21:36:26 -05:00
Родитель 0611166ee2
Коммит 3c73404215
3 изменённых файлов: 26 добавлений и 1 удалений

Просмотреть файл

@ -2448,6 +2448,7 @@ public:
return;
}
TABC_LOG("Got refresh, sending target APZCs for input block %" PRIu64 "\n", mInputBlockId);
mTabChild->SendSetTargetAPZC(mInputBlockId, mTargets);
if (!mPresShell->RemovePostRefreshObserver(this)) {
@ -2494,21 +2495,34 @@ TabChild::SendSetTargetAPZCNotification(const WidgetTouchEvent& aEvent,
nsIScrollableFrame* scrollAncestor = GetScrollableAncestorFrame(target);
nsCOMPtr<dom::Element> dpElement = GetDisplayportElementFor(scrollAncestor);
nsAutoString dpElementDesc;
if (dpElement) {
dpElement->Describe(dpElementDesc);
}
TABC_LOG("For input block %" PRIu64 " found scrollable element %p (%s)\n",
aInputBlockId, dpElement.get(),
NS_LossyConvertUTF16toASCII(dpElementDesc).get());
bool guidIsValid = APZCCallbackHelper::GetOrCreateScrollIdentifiers(
dpElement, &(guid.mPresShellId), &(guid.mScrollId));
targets.AppendElement(guid);
if (guidIsValid && !nsLayoutUtils::GetDisplayPort(dpElement, nullptr)) {
TABC_LOG("%p didn't have a displayport, so setting one...\n", dpElement.get());
waitForRefresh |= nsLayoutUtils::CalculateAndSetDisplayPortMargins(
scrollAncestor, nsLayoutUtils::RepaintMode::Repaint);
}
}
if (waitForRefresh) {
TABC_LOG("At least one target got a new displayport, need to wait for refresh\n");
waitForRefresh = shell->AddPostRefreshObserver(
new DisplayportSetListener(this, shell, aInputBlockId, targets));
}
if (!waitForRefresh) {
TABC_LOG("Sending target APZCs for input block %" PRIu64 "\n", aInputBlockId);
SendSetTargetAPZC(aInputBlockId, targets);
} else {
TABC_LOG("Successfully registered post-refresh observer\n");
}
}

Просмотреть файл

@ -37,6 +37,16 @@ InputBlockState::SetConfirmedTargetApzc(const nsRefPtr<AsyncPanZoomController>&
}
mTargetConfirmed = true;
if (mTargetApzc == aTargetApzc) {
// The confirmed target is the same as the tentative one, so we're done.
return true;
}
// Log enabled by default for now, we will put it in a TBS_LOG eventually
// once this code is more baked
printf_stderr("%p replacing unconfirmed target %p with real target %p\n",
this, mTargetApzc.get(), aTargetApzc.get());
// note that aTargetApzc MAY be null here.
mTargetApzc = aTargetApzc;
mOverscrollHandoffChain = (mTargetApzc ? mTargetApzc->BuildOverscrollHandoffChain() : nullptr);

Просмотреть файл

@ -227,7 +227,8 @@ void
InputQueue::SetConfirmedTargetApzc(uint64_t aInputBlockId, const nsRefPtr<AsyncPanZoomController>& aTargetApzc) {
AsyncPanZoomController::AssertOnControllerThread();
INPQ_LOG("got a target apzc; block=%" PRIu64 "\n", aInputBlockId);
INPQ_LOG("got a target apzc; block=%" PRIu64 " guid=%s\n",
aInputBlockId, aTargetApzc ? Stringify(aTargetApzc->GetGuid()).c_str() : "");
bool success = false;
for (size_t i = 0; i < mTouchBlockQueue.Length(); i++) {
if (mTouchBlockQueue[i]->GetBlockId() == aInputBlockId) {