Bug 1306083 - 3. Remove obsolete code from AndroidBridge; r=snorp

Remove the global layer client object from AndroidBridge, now that it's
no longer used. Also remove other associated calls that are no longer
used.
This commit is contained in:
Jim Chen
2016-10-03 12:26:00 -04:00
parent f3e399a710
commit 7aee9dca9f
3 changed files with 1 additions and 106 deletions

View File

@@ -155,8 +155,7 @@ AndroidBridge::~AndroidBridge()
}
AndroidBridge::AndroidBridge()
: mLayerClient(nullptr)
, mUiTaskQueueLock("UiTaskQueue")
: mUiTaskQueueLock("UiTaskQueue")
{
ALOG_BRIDGE("AndroidBridge::Init");
@@ -521,12 +520,6 @@ AndroidBridge::GetIconForExtension(const nsACString& aFileExt, uint32_t aIconSiz
env->ReleaseByteArrayElements(arr.Get(), elements, 0);
}
void
AndroidBridge::SetLayerClient(GeckoLayerClient::Param jobj)
{
mLayerClient = jobj;
}
bool
AndroidBridge::GetStaticIntField(const char *className, const char *fieldName, int32_t* aInt, JNIEnv* jEnv /* = nullptr */)
{
@@ -1017,84 +1010,6 @@ AndroidBridge::GetGlobalContextRef() {
return sGlobalContext;
}
void
AndroidBridge::SetFirstPaintViewport(const LayerIntPoint& aOffset, const CSSToLayerScale& aZoom, const CSSRect& aCssPageRect)
{
if (!mLayerClient) {
return;
}
mLayerClient->SetFirstPaintViewport(float(aOffset.x), float(aOffset.y), aZoom.scale,
aCssPageRect.x, aCssPageRect.y, aCssPageRect.XMost(), aCssPageRect.YMost());
}
void
AndroidBridge::SetPageRect(const CSSRect& aCssPageRect)
{
if (!mLayerClient) {
return;
}
mLayerClient->SetPageRect(aCssPageRect.x, aCssPageRect.y,
aCssPageRect.XMost(), aCssPageRect.YMost());
}
void
AndroidBridge::SyncViewportInfo(const LayerIntRect& aDisplayPort, const CSSToLayerScale& aDisplayResolution,
bool aLayersUpdated, int32_t aPaintSyncId, ParentLayerRect& aScrollRect, CSSToParentLayerScale& aScale,
ScreenMargin& aFixedLayerMargins)
{
if (!mLayerClient) {
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
return;
}
ViewTransform::LocalRef viewTransform = mLayerClient->SyncViewportInfo(
aDisplayPort.x, aDisplayPort.y,
aDisplayPort.width, aDisplayPort.height,
aDisplayResolution.scale, aLayersUpdated, aPaintSyncId);
MOZ_ASSERT(viewTransform, "No view transform object!");
aScrollRect = ParentLayerRect(viewTransform->X(), viewTransform->Y(),
viewTransform->Width(), viewTransform->Height());
aScale.scale = viewTransform->Scale();
aFixedLayerMargins.top = viewTransform->FixedLayerMarginTop();
aFixedLayerMargins.right = viewTransform->FixedLayerMarginRight();
aFixedLayerMargins.bottom = viewTransform->FixedLayerMarginBottom();
aFixedLayerMargins.left = viewTransform->FixedLayerMarginLeft();
}
void AndroidBridge::SyncFrameMetrics(const ParentLayerPoint& aScrollOffset,
const CSSToParentLayerScale& aZoom,
const CSSRect& aCssPageRect,
const CSSRect& aDisplayPort,
const CSSToLayerScale& aPaintedResolution,
bool aLayersUpdated, int32_t aPaintSyncId,
ScreenMargin& aFixedLayerMargins)
{
if (!mLayerClient) {
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
return;
}
// convert the displayport rect from document-relative CSS pixels to
// document-relative device pixels
LayerIntRect dp = gfx::RoundedToInt(aDisplayPort * aPaintedResolution);
ViewTransform::LocalRef viewTransform = mLayerClient->SyncFrameMetrics(
aScrollOffset.x, aScrollOffset.y, aZoom.scale,
aCssPageRect.x, aCssPageRect.y, aCssPageRect.XMost(), aCssPageRect.YMost(),
dp.x, dp.y, dp.width, dp.height, aPaintedResolution.scale,
aLayersUpdated, aPaintSyncId);
MOZ_ASSERT(viewTransform, "No view transform object!");
aFixedLayerMargins.top = viewTransform->FixedLayerMarginTop();
aFixedLayerMargins.right = viewTransform->FixedLayerMarginRight();
aFixedLayerMargins.bottom = viewTransform->FixedLayerMarginBottom();
aFixedLayerMargins.left = viewTransform->FixedLayerMarginLeft();
}
/* Implementation file */
NS_IMPL_ISUPPORTS(nsAndroidBridge, nsIAndroidBridge)

View File

@@ -147,9 +147,6 @@ public:
void ContentDocumentChanged(mozIDOMWindowProxy* aDOMWindow);
bool IsContentDocumentDisplayed(mozIDOMWindowProxy* aDOMWindow);
void SetLayerClient(java::GeckoLayerClient::Param jobj);
const java::GeckoLayerClient::Ref& GetLayerClient() { return mLayerClient; }
bool GetHandlersForURL(const nsAString& aURL,
nsIMutableArray* handlersArray = nullptr,
nsIHandlerApp **aDefaultApp = nullptr,
@@ -222,19 +219,6 @@ public:
void GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo);
void SetFirstPaintViewport(const LayerIntPoint& aOffset, const CSSToLayerScale& aZoom, const CSSRect& aCssPageRect);
void SetPageRect(const CSSRect& aCssPageRect);
void SyncViewportInfo(const LayerIntRect& aDisplayPort, const CSSToLayerScale& aDisplayResolution,
bool aLayersUpdated, int32_t aPaintSyncId, ParentLayerRect& aScrollRect, CSSToParentLayerScale& aScale,
ScreenMargin& aFixedLayerMargins);
void SyncFrameMetrics(const ParentLayerPoint& aScrollOffset,
const CSSToParentLayerScale& aZoom,
const CSSRect& aCssPageRect,
const CSSRect& aDisplayPort,
const CSSToLayerScale& aPaintedResolution,
bool aLayersUpdated, int32_t aPaintSyncId,
ScreenMargin& aFixedLayerMargins);
// These methods don't use a ScreenOrientation because it's an
// enum and that would require including the header which requires
// include IPC headers which requires including basictypes.h which
@@ -283,8 +267,6 @@ protected:
nsTArray<nsCOMPtr<nsIMobileMessageCallback>> mSmsRequests;
nsTArray<nsCOMPtr<nsIMobileMessageCursorCallback>> mSmsCursorRequests;
java::GeckoLayerClient::GlobalRef mLayerClient;
// the android.telephony.SmsMessage class
jclass mAndroidSmsMessageClass;

View File

@@ -1063,8 +1063,6 @@ public:
const auto& layerClient = GeckoLayerClient::Ref::From(aClient);
AndroidBridge::Bridge()->SetLayerClient(layerClient);
// If resetting is true, Android destroyed our GeckoApp activity and we
// had to recreate it, but all the Gecko-side things were not
// destroyed. We therefore need to link up the new java objects to