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

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

Issue 995203002: bindings: Add a macro for V8 Maybe<T> APIs. (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
Index: Source/bindings/modules/v8/custom/V8DeviceOrientationEventCustom.cpp
diff --git a/Source/bindings/modules/v8/custom/V8DeviceOrientationEventCustom.cpp b/Source/bindings/modules/v8/custom/V8DeviceOrientationEventCustom.cpp
index 118d445969c431e17054c7388cb6ea061ec43d8a..cca9de218b5c3e61ab82815249e98819a5833518 100644
--- a/Source/bindings/modules/v8/custom/V8DeviceOrientationEventCustom.cpp
+++ b/Source/bindings/modules/v8/custom/V8DeviceOrientationEventCustom.cpp
@@ -39,8 +39,11 @@ void V8DeviceOrientationEvent::initDeviceOrientationEventMethodCustom(const v8::
V8StringResource<> type(info[0]);
if (!type.prepare())
return;
- bool bubbles = info[1]->BooleanValue();
- bool cancelable = info[2]->BooleanValue();
+ v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
+ bool bubbles;
+ V8_MAYBE(bubbles, info[1], BooleanValue(context), return);
+ bool cancelable;
+ V8_MAYBE(cancelable, info[2], BooleanValue(context), return);
// If alpha, beta, gamma or absolute are null or undefined, mark them as not provided.
// Otherwise, use the standard JavaScript conversion.
bool alphaProvided = !isUndefinedOrNull(info[3]);

Powered by Google App Engine
This is Rietveld 408576698