Index: content/renderer/device_orientation_dispatcher.cc |
diff --git a/content/renderer/device_orientation_dispatcher.cc b/content/renderer/device_orientation_dispatcher.cc |
index a0a66a460a6825d58213559995d34186ce117430..023272efaccfb29d4fc28c7caea9d221290f93a1 100644 |
--- a/content/renderer/device_orientation_dispatcher.cc |
+++ b/content/renderer/device_orientation_dispatcher.cc |
@@ -83,14 +83,17 @@ void DeviceOrientationDispatcher::OnDeviceOrientationUpdated( |
if (last_orientation_.get() && OrientationsEqual(p, last_orientation_.get())) |
return; |
- last_orientation_.reset(new WebKit::WebDeviceOrientation(p.can_provide_alpha, |
- p.alpha, |
- p.can_provide_beta, |
- p.beta, |
- p.can_provide_gamma, |
- p.gamma, |
- p.can_provide_absolute, |
- p.absolute)); |
- |
+ WebKit::WebDeviceOrientation *orientation = |
jamesr
2012/06/06 23:09:05
why is the allocated on the heap? it looks like th
|
+ new WebKit::WebDeviceOrientation(); |
+ orientation->setNull(false); |
+ if (p.can_provide_alpha) |
+ orientation->setAlpha(p.alpha); |
+ if (p.can_provide_beta) |
+ orientation->setBeta(p.beta); |
+ if (p.can_provide_gamma) |
+ orientation->setGamma(p.gamma); |
+ if (p.can_provide_absolute) |
+ orientation->setAbsolute(p.absolute); |
+ last_orientation_.reset(orientation); |
controller_->didChangeDeviceOrientation(*last_orientation_); |
} |