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

Side by Side Diff: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp

Issue 2332003002: IndexedDB: Avoid side effects for array key conversion w/ HasOwnProperty (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/storage/indexeddb/bindings-edges.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 if (stack.contains(array)) 207 if (stack.contains(array))
208 return nullptr; 208 return nullptr;
209 if (stack.size() >= maximumDepth) 209 if (stack.size() >= maximumDepth)
210 return nullptr; 210 return nullptr;
211 stack.append(array); 211 stack.append(array);
212 212
213 IDBKey::KeyArray subkeys; 213 IDBKey::KeyArray subkeys;
214 uint32_t length = array->Length(); 214 uint32_t length = array->Length();
215 v8::TryCatch block(isolate); 215 v8::TryCatch block(isolate);
216 v8::Local<v8::Context> context = isolate->GetCurrentContext();
216 for (uint32_t i = 0; i < length; ++i) { 217 for (uint32_t i = 0; i < length; ++i) {
218 if (!v8CallBoolean(array->HasOwnProperty(context, i)))
219 return nullptr;
217 v8::Local<v8::Value> item; 220 v8::Local<v8::Value> item;
218 if (!v8Call(array->Get(isolate->GetCurrentContext(), i), item, block )) { 221 if (!v8Call(array->Get(context, i), item, block)) {
219 exceptionState.rethrowV8Exception(block.Exception()); 222 exceptionState.rethrowV8Exception(block.Exception());
220 return nullptr; 223 return nullptr;
221 } 224 }
222 IDBKey* subkey = createIDBKeyFromValue(isolate, item, stack, excepti onState, allowExperimentalTypes); 225 IDBKey* subkey = createIDBKeyFromValue(isolate, item, stack, excepti onState, allowExperimentalTypes);
223 if (!subkey) 226 if (!subkey)
224 subkeys.append(IDBKey::createInvalid()); 227 subkeys.append(IDBKey::createInvalid());
225 else 228 else
226 subkeys.append(subkey); 229 subkeys.append(subkey);
227 } 230 }
228 231
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 V8NavigatorPartial::installWebBluetooth(scriptState, navigator); 621 V8NavigatorPartial::installWebBluetooth(scriptState, navigator);
619 } 622 }
620 } 623 }
621 } 624 }
622 625
623 void registerInstallOriginTrialsForModules() 626 void registerInstallOriginTrialsForModules()
624 { 627 {
625 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst allOriginTrialsForModules); 628 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst allOriginTrialsForModules);
626 } 629 }
627 } // namespace blink 630 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/storage/indexeddb/bindings-edges.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698