OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 return DeviceMotionData::RotationRate::create(canProvideAlpha, alpha, canPro
videBeta, beta, canProvideGamma, gamma); | 98 return DeviceMotionData::RotationRate::create(canProvideAlpha, alpha, canPro
videBeta, beta, canProvideGamma, gamma); |
99 } | 99 } |
100 | 100 |
101 } // namespace | 101 } // namespace |
102 | 102 |
103 void V8DeviceMotionEvent::initDeviceMotionEventMethodCustom(const v8::FunctionCa
llbackInfo<v8::Value>& info) | 103 void V8DeviceMotionEvent::initDeviceMotionEventMethodCustom(const v8::FunctionCa
llbackInfo<v8::Value>& info) |
104 { | 104 { |
105 DeviceMotionEvent* impl = V8DeviceMotionEvent::toNative(info.Holder()); | 105 DeviceMotionEvent* impl = V8DeviceMotionEvent::toNative(info.Holder()); |
106 v8::Isolate* isolate = info.GetIsolate(); | 106 v8::Isolate* isolate = info.GetIsolate(); |
107 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); | 107 V8STRINGRESOURCE_PREPARE_VOID(V8StringResource<>, type, info[0]); |
108 bool bubbles = info[1]->BooleanValue(); | 108 bool bubbles = info[1]->BooleanValue(); |
109 bool cancelable = info[2]->BooleanValue(); | 109 bool cancelable = info[2]->BooleanValue(); |
110 RefPtrWillBeRawPtr<DeviceMotionData::Acceleration> acceleration = readAccele
rationArgument(info[3], isolate); | 110 RefPtrWillBeRawPtr<DeviceMotionData::Acceleration> acceleration = readAccele
rationArgument(info[3], isolate); |
111 RefPtrWillBeRawPtr<DeviceMotionData::Acceleration> accelerationIncludingGrav
ity = readAccelerationArgument(info[4], isolate); | 111 RefPtrWillBeRawPtr<DeviceMotionData::Acceleration> accelerationIncludingGrav
ity = readAccelerationArgument(info[4], isolate); |
112 RefPtrWillBeRawPtr<DeviceMotionData::RotationRate> rotationRate = readRotati
onRateArgument(info[5], isolate); | 112 RefPtrWillBeRawPtr<DeviceMotionData::RotationRate> rotationRate = readRotati
onRateArgument(info[5], isolate); |
113 bool intervalProvided = !isUndefinedOrNull(info[6]); | 113 bool intervalProvided = !isUndefinedOrNull(info[6]); |
114 double interval = info[6]->NumberValue(); | 114 double interval = info[6]->NumberValue(); |
115 RefPtrWillBeRawPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::cr
eate(acceleration.release(), accelerationIncludingGravity.release(), rotationRat
e.release(), intervalProvided, interval); | 115 RefPtrWillBeRawPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::cr
eate(acceleration.release(), accelerationIncludingGravity.release(), rotationRat
e.release(), intervalProvided, interval); |
116 impl->initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.get(
)); | 116 impl->initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.get(
)); |
117 } | 117 } |
118 | 118 |
119 } // namespace WebCore | 119 } // namespace WebCore |
OLD | NEW |