Closed Bug 880024 Opened 11 years ago Closed 11 years ago

Create a local version of GeckoContentController

Categories

(Core :: Graphics: Layers, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: ajones, Assigned: kats)

References

Details

Attachments

(1 file, 2 obsolete files)

Currently we have RemoteContentController which talks to TabChild. TabChild contains a bunch of logic that needs to be shared with LocalContentController.
Blocks: apz-fennec
No longer blocks: multi-apzc
If we want the dynamic toolbar to work as described at https://bugzilla.mozilla.org/show_bug.cgi?id=860812#c7 then we will need to have an APZC built for the browser chrome layer, which exists in the root process. See https://bugzilla.mozilla.org/show_bug.cgi?id=898478#c3 for some more backstory/design.

Whether we turn on APZCs for all the layers or just the one layer in the root process, we will need an implementation of GeckoContentController to hand to that APZC, and that lives in the root process (hence it's a "LocalContentController"). I believe this should live in the widget code (probably have a base implementation in widget/xpwidgets and then have a specific subclass in widget/gonk for the dynamic toolbar).

This implementation will need to do all the usual things a GeckoContentController does - that is, pass on detected gestures to content, request content repaints, schedule runnables for later, and so on.
Blocks: 889883
Blocks: 912657
No longer blocks: 889883
Assignee: nobody → bugmail.mozilla
Attached patch WIP (obsolete) — Splinter Review
I decided that the cleanest way to do this was to just extract a class with static helper methods to hold the reusable bits of the code. That way the specific implementations of GeckoContentController aren't bound to a particular class hierarchy.
Attachment #802407 - Flags: feedback?(ajones)
Attachment #802407 - Attachment is patch: true
Attached patch Extract some code from TabChild (obsolete) — Splinter Review
Updated with some documentation and tweaks.
Attachment #802407 - Attachment is obsolete: true
Attachment #802407 - Flags: feedback?(ajones)
Attachment #802408 - Flags: review?(ajones)
Attachment #802408 - Attachment description: WIP → Extract some code from TabChild
Rebased
Attachment #802408 - Attachment is obsolete: true
Attachment #802408 - Flags: review?(ajones)
Attachment #805590 - Flags: review?(ajones)
Comment on attachment 805590 [details] [diff] [review]
Extract some code from TabChild

Review of attachment 805590 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/nsDOMWindowUtils.cpp
@@ +1523,5 @@
> +  } else {
> +    if (aRetVal) {
> +      *aRetVal = false;
> +    }
> +  }

Suggestion: I would probably write outside the if:

if (aRetVal) {
  *RetVal = sf != nullptr;
}

::: widget/xpwidgets/APZCCallbackHelper.cpp
@@ +67,5 @@
> +    nsCOMPtr<nsIDOMElement> element;
> +    if (content) {
> +      element = do_QueryInterface(content);
> +    }
> +    if (element) {

Suggestion: element is only set in one place so we could just move everything inside the 'if (content)' block. However I'd probably use gating:

nsCOMPtr<nsIContent> content = nsLayoutUtils::FindContentFor(aMetrics.mScrollId);
if (!content) {
  return;
}

nsCOMPtr<nsIDOMElement> element = do_QueryInterface(content);
if (!element) {
  return;
}

...
Attachment #805590 - Flags: review?(ajones) → review+
https://hg.mozilla.org/mozilla-central/rev/2b836100c277
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: