Closed Bug 996677 Opened 6 years ago Closed 6 years ago

Incorrect call DeviceRotationRate() ctor from another one

Categories

(Core :: DOM: Events, defect)

x86_64
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: maksqwe1, Assigned: smaug)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0 (Beta/Release)
Build ID: 20140314220517

Steps to reproduce:

./dom/events/DeviceMotionEvent.h 26 & 63

DeviceRotationRate(double aAlpha, double aBeta, double aGamma)
{
   DeviceRotationRate(nullptr, Nullable<double>(aAlpha), Nullable<double>(aBeta), Nullable<double>(aGamma));
}

...
DeviceAcceleration(double aX, double aY, double aZ)
{
  DeviceAcceleration(nullptr, Nullable<double>(aX), Nullable<double>(aY), Nullable<double>(aZ));
}



Expected results:

Created temp DeviceAcceleration obj and then this obj is deleted.
Possible solutions:
1. add some "init()" method
2. for C++11 call one ctor from another:
DeviceAcceleration(double aX, double aY, double aZ)
 : DeviceAcceleration(nullptr, Nullable<double>(aX), Nullable<double>(aY), Nullable<double>(aZ))
{
}


3.
DeviceAcceleration(double aX, double aY, double aZ)
{
  this->DeviceAcceleration(nullptr, Nullable<double>(aX), Nullable<double>(aY), Nullable<double>(aZ))
}
It is dangerous because "DeviceAcceleration" not base class
Component: DOM → DOM: Events
/me slaps himself
Blocks: 876238
I think we can just remove those problematic ctors.
Assignee: nobody → bugs
Attached patch patchSplinter Review
Builds at least on linux, and mxr didn't find any use of those ctors.
https://tbpl.mozilla.org/?tree=Try&rev=927fa6349968
Attachment #8406994 - Flags: review?(VYV03354)
Comment on attachment 8406994 [details] [diff] [review]
patch

The wreckage of the XPCOM interface...
Attachment #8406994 - Flags: review?(VYV03354) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/2c4a02a5c169
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.