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

Unified Diff: Source/bindings/core/v8/DictionaryHelperForCore.cpp

Issue 964553003: bindings: Use V8 MaybeLocal<> APIs in Dictionary class (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/core/v8/DictionaryHelperForCore.cpp
diff --git a/Source/bindings/core/v8/DictionaryHelperForCore.cpp b/Source/bindings/core/v8/DictionaryHelperForCore.cpp
index 1dd12c45b8b1104a2d2dae217388af9b990b2617..d23fa441df0c390865f278f6057bef3e9f003c13 100644
--- a/Source/bindings/core/v8/DictionaryHelperForCore.cpp
+++ b/Source/bindings/core/v8/DictionaryHelperForCore.cpp
@@ -66,8 +66,9 @@ bool DictionaryHelper::get(const Dictionary& dictionary, const String& key, bool
if (!dictionary.get(key, v8Value))
return false;
- v8::Local<v8::Boolean> v8Bool = v8Value->ToBoolean(dictionary.isolate());
- if (v8Bool.IsEmpty())
+ v8::MaybeLocal<v8::Boolean> maybeBool = v8Value->ToBoolean(dictionary.context());
+ v8::Local<v8::Boolean> v8Bool;
+ if (!maybeBool.ToLocal(&v8Bool) || v8Bool.IsEmpty())
return false;
value = v8Bool->Value();
return true;
@@ -88,8 +89,9 @@ bool DictionaryHelper::get(const Dictionary& dictionary, const String& key, int3
if (!dictionary.get(key, v8Value))
return false;
- v8::Local<v8::Int32> v8Int32 = v8Value->ToInt32(dictionary.isolate());
- if (v8Int32.IsEmpty())
+ v8::MaybeLocal<v8::Int32> maybeInt32 = v8Value->ToInt32(dictionary.context());
+ v8::Local<v8::Int32> v8Int32;
+ if (!maybeInt32.ToLocal(&v8Int32) || v8Int32.IsEmpty())
return false;
value = v8Int32->Value();
return true;
@@ -204,8 +206,9 @@ bool getNumericType(const Dictionary& dictionary, const String& key, NumericType
if (!dictionary.get(key, v8Value))
return false;
- v8::Local<v8::Int32> v8Int32 = v8Value->ToInt32(dictionary.isolate());
- if (v8Int32.IsEmpty())
+ v8::MaybeLocal<v8::Int32> maybeInt32 = v8Value->ToInt32(dictionary.context());
+ v8::Local<v8::Int32> v8Int32;
+ if (!maybeInt32.ToLocal(&v8Int32) || v8Int32.IsEmpty())
return false;
value = static_cast<NumericType>(v8Int32->Value());
return true;
@@ -236,8 +239,9 @@ bool DictionaryHelper::get(const Dictionary& dictionary, const String& key, unsi
if (!dictionary.get(key, v8Value))
return false;
- v8::Local<v8::Integer> v8Integer = v8Value->ToInteger(dictionary.isolate());
- if (v8Integer.IsEmpty())
+ v8::MaybeLocal<v8::Integer> maybeInteger = v8Value->ToInteger(dictionary.context());
+ v8::Local<v8::Integer> v8Integer;
+ if (!maybeInteger.ToLocal(&v8Integer) || v8Integer.IsEmpty())
return false;
value = static_cast<unsigned long>(v8Integer->Value());
return true;
« Source/bindings/core/v8/Dictionary.cpp ('K') | « Source/bindings/core/v8/Dictionary.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698