nsPIDOMWindow is one of the classes that nsGlobalWindow inherits from.
They're mostly interchangeable in practice.
On 10/08/2013 08:59 PM, [email protected] wrote:
Hi,
In Gaia, we can add an eventlistener for some specific sensors, let's say
"devicelight".
By tracing the call, this will call nsEventListenerManager.cpp in gecko,
however, in gecko, i assume this will then go to nsGlobalWindow.cpp but there
is one code confuses me.
nsCOMPtr<nsPIDOMWindow> window = GetTargetAsInnerWindow();
The context is:
nsCOMPtr<nsPIDOMWindow> window = GetTargetAsInnerWindow();
if (!window) {
return;
}
switch (aType) {
case NS_DEVICE_LIGHT:
window->EnableDeviceSensor(SENSOR_LIGHT);
break;
}
I dont understand the role of "nsCOMPtr<nsPIDOMWindow> window =
GetTargetAsInnerWindow();" here since I expect to see nsGlobalWindow.
Can anyone explain a bit here? Thanks
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g