[Webkit-unassigned] [Bug 93597] Add DeviceController to support DOMWindow device events

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 6 11:02:44 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=93597





--- Comment #57 from Adam Barth <abarth at webkit.org>  2012-09-06 11:02:56 PST ---
(From update of attachment 162456)
View in context: https://bugs.webkit.org/attachment.cgi?id=162456&action=review

> Source/WebCore/page/DOMWindow.cpp:1682
> +    DeviceController::removeAllDeviceEvnetListener(this, page());

Evnet -> Event

> Source/WebCore/page/DOMWindowDeviceProvider.h:31
> +class DOMWindowDeviceProvider : public Supplement<DOMWindow> {

I don't understand the point of DOMWindowDeviceProvider.  In a previous iteration of this patch, you were storing a bunch of per-DOMWindow state.  I asked you to create a Supplement<DOMWindow> to store that state, but this class doesn't actually store any state.

> Source/WebCore/page/DeviceClient.h:34
> +    virtual PassRefPtr<Event> lastEvent() const = 0;

Does this function transfer ownership of the last event?  I would have expected this to just be an getter.  If so, it should return a raw Event*

> Source/WebCore/page/DeviceController.cpp:63
> +    DOMWindowDeviceProvider* provider = static_cast<DOMWindowDeviceProvider*>(Supplement<DOMWindow>::from(window, supplementName()));
> +    if (!provider) {
> +        provider = new DOMWindowDeviceProvider(window);
> +        Supplement<DOMWindow>::provideTo(window, supplementName(), adoptPtr(provider));
> +    }
> +    m_providers.add(provider);

This work should be done by DOMWindowDeviceProvider in a from() function.

> Source/WebCore/page/DeviceController.cpp:101
> +void DeviceController::dispatchDeivceEvent(PassRefPtr<Event> event)

Deivce -> Device

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list