Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp

Issue 970403003: bindings: Use V8 MaybeLocal APIs in V8DeviceMotionEventCustom (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp
diff --git a/Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp b/Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp
index be8d12d3809aa2d30125558c971a5792ca2eb8dc..32b87fdbc44418b76bcb53d73507272493dbd801 100644
--- a/Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp
+++ b/Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp
@@ -39,8 +39,9 @@ DeviceMotionData::Acceleration* readAccelerationArgument(v8::Local<v8::Value> va
if (isUndefinedOrNull(value))
return nullptr;
- // Given the test above, this will always yield an object.
- v8::Local<v8::Object> object = value->ToObject(isolate);
+ v8::Local<v8::Object> object;
+ if (!value->ToObject(isolate->GetCurrentContext()).ToLocal(&object))
+ return nullptr;
v8::Local<v8::Value> xValue = object->Get(v8AtomicString(isolate, "x"));
if (xValue.IsEmpty())
@@ -71,8 +72,9 @@ DeviceMotionData::RotationRate* readRotationRateArgument(v8::Local<v8::Value> va
if (isUndefinedOrNull(value))
return nullptr;
- // Given the test above, this will always yield an object.
- v8::Local<v8::Object> object = value->ToObject(isolate);
+ v8::Local<v8::Object> object;
+ if (!value->ToObject(isolate->GetCurrentContext()).ToLocal(&object))
+ return nullptr;
v8::Local<v8::Value> alphaValue = object->Get(v8AtomicString(isolate, "alpha"));
if (alphaValue.IsEmpty())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698