Bug 1119811 - Fold the gonk ParentProcessController into the reusable ChromeProcessController. r=dvander

This commit is contained in:
Kartikaya Gupta 2015-01-09 13:41:23 -05:00
Родитель d15379f7a8
Коммит e10f70887c
6 изменённых файлов: 4 добавлений и 106 удалений

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

@ -17,6 +17,10 @@ ChromeProcessController::RequestContentRepaint(const FrameMetrics& aFrameMetrics
{
MOZ_ASSERT(NS_IsMainThread());
if (aFrameMetrics.GetScrollId() == FrameMetrics::NULL_SCROLL_ID) {
return;
}
nsCOMPtr<nsIContent> targetContent = nsLayoutUtils::FindContentFor(aFrameMetrics.GetScrollId());
if (targetContent) {
FrameMetrics metrics = aFrameMetrics;

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

@ -1,45 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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 "ParentProcessController.h"
#include "nsIContent.h"
#include "nsLayoutUtils.h"
#include "mozilla/layers/APZCCallbackHelper.h"
#include "base/message_loop.h"
namespace mozilla {
namespace widget {
void
ParentProcessController::RequestContentRepaint(const FrameMetrics& aFrameMetrics)
{
MOZ_ASSERT(NS_IsMainThread());
if (aFrameMetrics.GetScrollId() == FrameMetrics::NULL_SCROLL_ID) {
return;
}
nsCOMPtr<nsIContent> content = nsLayoutUtils::FindContentFor(aFrameMetrics.GetScrollId());
if (content) {
FrameMetrics metrics = aFrameMetrics;
mozilla::layers::APZCCallbackHelper::UpdateSubFrame(content, metrics);
}
}
void
ParentProcessController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId,
const uint32_t& aScrollGeneration)
{
mozilla::layers::APZCCallbackHelper::AcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
}
void
ParentProcessController::PostDelayedTask(Task* aTask, int aDelayMs)
{
MessageLoop::current()->PostDelayedTask(FROM_HERE, aTask, aDelayMs);
}
}
}

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

@ -1,48 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#ifndef __mozilla_widget_DynamicToolbarController_h__
#define __mozilla_widget_DynamicToolbarController_h__
#include "mozilla/layers/GeckoContentController.h"
namespace mozilla {
namespace widget {
class ParentProcessController : public mozilla::layers::GeckoContentController
{
typedef mozilla::layers::FrameMetrics FrameMetrics;
typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
public:
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aViewId,
const uint32_t& aScrollGeneration) MOZ_OVERRIDE;
virtual void PostDelayedTask(Task* aTask, int aDelayMs) MOZ_OVERRIDE;
// No-ops
virtual void HandleDoubleTap(const CSSPoint& aPoint,
int32_t aModifiers,
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {}
virtual void HandleSingleTap(const CSSPoint& aPoint,
int32_t aModifiers,
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {}
virtual void HandleLongTap(const CSSPoint& aPoint,
int32_t aModifiers,
const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId) MOZ_OVERRIDE {}
virtual void HandleLongTapUp(const CSSPoint& aPoint,
int32_t aModifiers,
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {}
virtual void SendAsyncScrollDOMEvent(bool aIsRoot,
const CSSRect &aContentRect,
const CSSSize &aScrollableSize) MOZ_OVERRIDE {}
};
}
}
#endif /*__mozilla_widget_DynamicToolbarController_h__ */

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

@ -59,7 +59,6 @@ SOURCES += [
'nsWidgetFactory.cpp',
'nsWindow.cpp',
'OrientationObserver.cpp',
'ParentProcessController.cpp',
'ProcessOrientation.cpp',
'WidgetTraceEvent.cpp'
]

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

@ -47,7 +47,6 @@
#include "mozilla/gfx/2D.h"
#include "mozilla/layers/APZCTreeManager.h"
#include "mozilla/layers/CompositorParent.h"
#include "ParentProcessController.h"
#include "nsThreadUtils.h"
#include "HwcComposer2D.h"
@ -631,13 +630,6 @@ nsWindow::GetLayerManager(PLayerTransactionChild* aShadowManager,
return mLayerManager;
}
already_AddRefed<GeckoContentController>
nsWindow::CreateRootContentController()
{
nsRefPtr<ParentProcessController> controller = new ParentProcessController();
return controller.forget();
}
void
nsWindow::BringToTop()
{

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

@ -121,10 +121,6 @@ public:
virtual Composer2D* GetComposer2D() MOZ_OVERRIDE;
protected:
// nsBaseWidget
already_AddRefed<GeckoContentController> CreateRootContentController() MOZ_OVERRIDE;
protected:
nsWindow* mParent;
bool mVisible;