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

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

Issue 2279343002: 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 V8ServiceWorkerGlobalScope::installForeignFetch(scriptState, global) ; 629 V8ServiceWorkerGlobalScope::installForeignFetch(scriptState, global) ;
627 } 630 }
628 } 631 }
629 } 632 }
630 633
631 void registerInstallOriginTrialsForModules() 634 void registerInstallOriginTrialsForModules()
632 { 635 {
633 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst allOriginTrialsForModules); 636 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst allOriginTrialsForModules);
634 } 637 }
635 } // namespace blink 638 } // 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