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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp

Issue 2857303003: History API throws when serializing a SharedArrayBuffer (Closed)
Patch Set: use enum class instead of bool Created 3 years, 7 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 return nullptr; 374 return nullptr;
375 } 375 }
376 376
377 v8::Isolate* isolate = script_state->GetIsolate(); 377 v8::Isolate* isolate = script_state->GetIsolate();
378 DCHECK(isolate->InContext()); 378 DCHECK(isolate->InContext());
379 Vector<WebBlobInfo> blob_info; 379 Vector<WebBlobInfo> blob_info;
380 SerializedScriptValue::SerializeOptions options; 380 SerializedScriptValue::SerializeOptions options;
381 options.blob_info = &blob_info; 381 options.blob_info = &blob_info;
382 options.write_wasm_to_stream = 382 options.write_wasm_to_stream =
383 ExecutionContext::From(script_state)->IsSecureContext(); 383 ExecutionContext::From(script_state)->IsSecureContext();
384 options.for_storage = true; 384 options.for_storage = SerializedScriptValue::SerializeForStorage::kYes;
385 RefPtr<SerializedScriptValue> serialized_value = 385 RefPtr<SerializedScriptValue> serialized_value =
386 SerializedScriptValue::Serialize(isolate, value.V8Value(), options, 386 SerializedScriptValue::Serialize(isolate, value.V8Value(), options,
387 exception_state); 387 exception_state);
388 if (exception_state.HadException()) 388 if (exception_state.HadException())
389 return nullptr; 389 return nullptr;
390 390
391 // Keys that need to be extracted must be taken from a clone so that 391 // Keys that need to be extracted must be taken from a clone so that
392 // side effects (i.e. getters) are not triggered. Construct the 392 // side effects (i.e. getters) are not triggered. Construct the
393 // clone lazily since the operation may be expensive. 393 // clone lazily since the operation may be expensive.
394 ScriptValue clone; 394 ScriptValue clone;
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 } 1055 }
1056 } 1056 }
1057 return IDBIndexMetadata::kInvalidId; 1057 return IDBIndexMetadata::kInvalidId;
1058 } 1058 }
1059 1059
1060 WebIDBDatabase* IDBObjectStore::BackendDB() const { 1060 WebIDBDatabase* IDBObjectStore::BackendDB() const {
1061 return transaction_->BackendDB(); 1061 return transaction_->BackendDB();
1062 } 1062 }
1063 1063
1064 } // namespace blink 1064 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698