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

Side by Side Diff: src/api.cc

Issue 2570433005: Disallow passing a SharedArrayBuffer in the transfer list. (Closed)
Patch Set: TransferSharedArrayBuffer -> GetSharedArrayBufferId Created 4 years 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 | « include/v8.h ('k') | src/messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 3015 matching lines...) Expand 10 before | Expand all | Expand 10 after
3026 3026
3027 Maybe<bool> ValueSerializer::Delegate::WriteHostObject(Isolate* v8_isolate, 3027 Maybe<bool> ValueSerializer::Delegate::WriteHostObject(Isolate* v8_isolate,
3028 Local<Object> object) { 3028 Local<Object> object) {
3029 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); 3029 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
3030 isolate->ScheduleThrow(*isolate->factory()->NewError( 3030 isolate->ScheduleThrow(*isolate->factory()->NewError(
3031 isolate->error_function(), i::MessageTemplate::kDataCloneError, 3031 isolate->error_function(), i::MessageTemplate::kDataCloneError,
3032 Utils::OpenHandle(*object))); 3032 Utils::OpenHandle(*object)));
3033 return Nothing<bool>(); 3033 return Nothing<bool>();
3034 } 3034 }
3035 3035
3036 Maybe<uint32_t> ValueSerializer::Delegate::GetSharedArrayBufferId(
3037 Isolate* v8_isolate, Local<SharedArrayBuffer> shared_array_buffer) {
3038 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
3039 isolate->ScheduleThrow(*isolate->factory()->NewError(
3040 isolate->error_function(), i::MessageTemplate::kDataCloneError,
3041 Utils::OpenHandle(*shared_array_buffer)));
3042 return Nothing<uint32_t>();
3043 }
3044
3036 void* ValueSerializer::Delegate::ReallocateBufferMemory(void* old_buffer, 3045 void* ValueSerializer::Delegate::ReallocateBufferMemory(void* old_buffer,
3037 size_t size, 3046 size_t size,
3038 size_t* actual_size) { 3047 size_t* actual_size) {
3039 *actual_size = size; 3048 *actual_size = size;
3040 return realloc(old_buffer, size); 3049 return realloc(old_buffer, size);
3041 } 3050 }
3042 3051
3043 void ValueSerializer::Delegate::FreeBufferMemory(void* buffer) { 3052 void ValueSerializer::Delegate::FreeBufferMemory(void* buffer) {
3044 return free(buffer); 3053 return free(buffer);
3045 } 3054 }
(...skipping 6841 matching lines...) Expand 10 before | Expand all | Expand 10 after
9887 Address callback_address = 9896 Address callback_address =
9888 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9897 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9889 VMState<EXTERNAL> state(isolate); 9898 VMState<EXTERNAL> state(isolate);
9890 ExternalCallbackScope call_scope(isolate, callback_address); 9899 ExternalCallbackScope call_scope(isolate, callback_address);
9891 callback(info); 9900 callback(info);
9892 } 9901 }
9893 9902
9894 9903
9895 } // namespace internal 9904 } // namespace internal
9896 } // namespace v8 9905 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698