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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp

Issue 2144093002: Adding checks for V8 functions returning Maybe<bool> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding checks for V8 functions returning Maybe<bool> Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 int arrayIndex) { 910 int arrayIndex) {
911 v8::Local<v8::Value> arrayValue = object->GetInternalField(arrayIndex); 911 v8::Local<v8::Value> arrayValue = object->GetInternalField(arrayIndex);
912 if (!arrayValue->IsArray()) 912 if (!arrayValue->IsArray())
913 return; 913 return;
914 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(arrayValue); 914 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(arrayValue);
915 for (int i = array->Length() - 1; i >= 0; --i) { 915 for (int i = array->Length() - 1; i >= 0; --i) {
916 v8::Local<v8::Value> item; 916 v8::Local<v8::Value> item;
917 if (!array->Get(isolate->GetCurrentContext(), i).ToLocal(&item)) 917 if (!array->Get(isolate->GetCurrentContext(), i).ToLocal(&item))
918 return; 918 return;
919 if (item->StrictEquals(value)) { 919 if (item->StrictEquals(value)) {
920 array->Delete(isolate->GetCurrentContext(), i); 920 array->Delete(isolate->GetCurrentContext(), i).ToChecked();
921 return; 921 return;
922 } 922 }
923 } 923 }
924 } 924 }
925 925
926 void moveEventListenerToNewWrapper(v8::Isolate* isolate, 926 void moveEventListenerToNewWrapper(v8::Isolate* isolate,
927 v8::Local<v8::Object> object, 927 v8::Local<v8::Object> object,
928 EventListener* oldValue, 928 EventListener* oldValue,
929 v8::Local<v8::Value> newValue, 929 v8::Local<v8::Value> newValue,
930 int arrayIndex) { 930 int arrayIndex) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 if (!v8Call(v8::JSON::Parse(isolate, v8String(isolate, stringifiedJSON)), 972 if (!v8Call(v8::JSON::Parse(isolate, v8String(isolate, stringifiedJSON)),
973 parsed, tryCatch)) { 973 parsed, tryCatch)) {
974 if (tryCatch.HasCaught()) 974 if (tryCatch.HasCaught())
975 exceptionState.rethrowV8Exception(tryCatch.Exception()); 975 exceptionState.rethrowV8Exception(tryCatch.Exception());
976 } 976 }
977 977
978 return parsed; 978 return parsed;
979 } 979 }
980 980
981 } // namespace blink 981 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698