Bug 1343479 - Label the tasks for APZ module. r=bevistseng,kats

MozReview-Commit-ID: GkAl4MZorxP

--HG--
extra : rebase_source : 0134d0d69b5d8dba0fb39aa8908fbfa4d6a9d777
This commit is contained in:
Kevin Chen 2017-03-23 06:16:38 +00:00
parent a441709a12
commit bf53d0a60d
3 changed files with 23 additions and 1 deletions

View File

@ -2734,7 +2734,11 @@ TabChild::InitAPZState()
// The ContentProcessController will hold a reference to the tab, and will be destroyed by the compositor or ipdl
// during destruction.
RefPtr<GeckoContentController> contentController = new ContentProcessController(this);
cbc->SendPAPZConstructor(new APZChild(contentController), mLayersId);
APZChild* apzChild = new APZChild(contentController);
cbc->SetEventTargetForActor(
apzChild, TabGroup()->EventTargetFor(TaskCategory::Other));
MOZ_ASSERT(apzChild->GetActorEventTarget());
cbc->SendPAPZConstructor(apzChild, mLayersId);
}
void

View File

@ -10,6 +10,8 @@
#include "gfxPrefs.h"
#include "LayersLogging.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/dom/TabChild.h"
#include "mozilla/dom/TabGroup.h"
#include "mozilla/IntegerPrintfMacros.h"
#include "mozilla/Move.h"
#include "mozilla/Preferences.h"
@ -205,6 +207,12 @@ APZEventState::ProcessSingleTap(const CSSPoint& aPoint,
APZES_LOG("Active element uses style, scheduling timer for click event\n");
nsCOMPtr<nsITimer> timer = do_CreateInstance(NS_TIMER_CONTRACTID);
TabChild* tabChild = widget->GetOwningTabChild();
if (tabChild && XRE_IsContentProcess()) {
timer->SetTarget(
tabChild->TabGroup()->EventTargetFor(TaskCategory::Other));
}
RefPtr<DelayedFireSingleTapEvent> callback =
new DelayedFireSingleTapEvent(mWidget, ldPoint, aModifiers, aClickCount,
timer, touchRollup);

View File

@ -12,6 +12,7 @@
#include "base/message_loop.h" // for MessageLoop
#include "base/task.h" // for NewRunnableMethod, etc
#include "gfxPrefs.h"
#include "mozilla/dom/TabGroup.h"
#include "mozilla/layers/ImageBridgeChild.h"
#include "mozilla/layers/APZChild.h"
#include "mozilla/layers/IAPZCTreeManager.h"
@ -1083,6 +1084,15 @@ CompositorBridgeChild::AllocPAPZCTreeManagerChild(const uint64_t& aLayersId)
{
APZCTreeManagerChild* child = new APZCTreeManagerChild();
child->AddRef();
if (aLayersId != 0) {
TabChild* tabChild = TabChild::GetFrom(aLayersId);
if (tabChild) {
SetEventTargetForActor(
child, tabChild->TabGroup()->EventTargetFor(TaskCategory::Other));
MOZ_ASSERT(child->GetActorEventTarget());
}
}
return child;
}