mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1321644 - part 1, Remove android specific message loop code from APZThreadUtils.cpp r=botond
This commit is contained in:
parent
e5f409853d
commit
1101ff0a36
@ -6,9 +6,6 @@
|
||||
#include "mozilla/layers/APZThreadUtils.h"
|
||||
|
||||
#include "mozilla/layers/Compositor.h"
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "AndroidBridge.h"
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
@ -57,15 +54,6 @@ APZThreadUtils::RunOnControllerThread(already_AddRefed<Runnable> aTask)
|
||||
{
|
||||
RefPtr<Runnable> task = aTask;
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
// This is needed while nsWindow::ConfigureAPZControllerThread is not propper
|
||||
// implemented.
|
||||
if (AndroidBridge::IsJavaUiThread()) {
|
||||
task->Run();
|
||||
} else {
|
||||
AndroidBridge::Bridge()->PostTaskToUiThread(task.forget(), 0);
|
||||
}
|
||||
#else
|
||||
if (!sControllerThread) {
|
||||
// Could happen on startup
|
||||
NS_WARNING("Dropping task posted to controller thread");
|
||||
@ -77,17 +65,12 @@ APZThreadUtils::RunOnControllerThread(already_AddRefed<Runnable> aTask)
|
||||
} else {
|
||||
sControllerThread->PostTask(task.forget());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*static*/ bool
|
||||
APZThreadUtils::IsControllerThread()
|
||||
{
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
return AndroidBridge::IsJavaUiThread();
|
||||
#else
|
||||
return sControllerThread == MessageLoop::current();
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(GenericTimerCallbackBase, nsITimerCallback)
|
||||
|
@ -25,24 +25,6 @@ AndroidContentController::Destroy()
|
||||
ChromeProcessController::Destroy();
|
||||
}
|
||||
|
||||
void
|
||||
AndroidContentController::NotifyDefaultPrevented(IAPZCTreeManager* aManager,
|
||||
uint64_t aInputBlockId,
|
||||
bool aDefaultPrevented)
|
||||
{
|
||||
if (!AndroidBridge::IsJavaUiThread()) {
|
||||
// The notification must reach the APZ on the Java UI thread (aka the
|
||||
// APZ "controller" thread) but we get it from the Gecko thread, so we
|
||||
// have to throw it onto the other thread.
|
||||
AndroidBridge::Bridge()->PostTaskToUiThread(NewRunnableMethod<uint64_t, bool>(
|
||||
aManager, &IAPZCTreeManager::ContentReceivedInputBlock,
|
||||
aInputBlockId, aDefaultPrevented), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
aManager->ContentReceivedInputBlock(aInputBlockId, aDefaultPrevented);
|
||||
}
|
||||
|
||||
void
|
||||
AndroidContentController::DispatchSingleTapToObservers(const LayoutDevicePoint& aPoint,
|
||||
const ScrollableLayerGuid& aGuid) const
|
||||
@ -101,11 +83,6 @@ AndroidContentController::HandleTap(TapType aType, const LayoutDevicePoint& aPoi
|
||||
ChromeProcessController::HandleTap(aType, aPoint, aModifiers, aGuid, aInputBlockId);
|
||||
}
|
||||
|
||||
void
|
||||
AndroidContentController::PostDelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs)
|
||||
{
|
||||
AndroidBridge::Bridge()->PostTaskToUiThread(Move(aTask), aDelayMs);
|
||||
}
|
||||
void
|
||||
AndroidContentController::UpdateOverscrollVelocity(const float aX, const float aY, const bool aIsRootContent)
|
||||
{
|
||||
|
@ -36,16 +36,12 @@ public:
|
||||
virtual void Destroy() override;
|
||||
void HandleTap(TapType aType, const LayoutDevicePoint& aPoint, Modifiers aModifiers,
|
||||
const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) override;
|
||||
void PostDelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs) override;
|
||||
void UpdateOverscrollVelocity(const float aX, const float aY, const bool aIsRootContent) override;
|
||||
void UpdateOverscrollOffset(const float aX, const float aY, const bool aIsRootContent) override;
|
||||
void SetScrollingRootContent(const bool isRootContent) override;
|
||||
void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
|
||||
APZStateChange aChange,
|
||||
int aArg) override;
|
||||
|
||||
static void NotifyDefaultPrevented(mozilla::layers::IAPZCTreeManager* aManager,
|
||||
uint64_t aInputBlockId, bool aDefaultPrevented);
|
||||
private:
|
||||
nsWindow* mAndroidWindow;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user