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

Side by Side Diff: src/api.cc

Issue 2570433005: Disallow passing a SharedArrayBuffer in the transfer list. (Closed)
Patch Set: 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
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::TransferSharedArrayBuffer(
3037 Isolate* v8_isolate, Local<Object> object) {
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(*object)));
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 6843 matching lines...) Expand 10 before | Expand all | Expand 10 after
9889 Address callback_address = 9898 Address callback_address =
9890 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9899 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9891 VMState<EXTERNAL> state(isolate); 9900 VMState<EXTERNAL> state(isolate);
9892 ExternalCallbackScope call_scope(isolate, callback_address); 9901 ExternalCallbackScope call_scope(isolate, callback_address);
9893 callback(info); 9902 callback(info);
9894 } 9903 }
9895 9904
9896 9905
9897 } // namespace internal 9906 } // namespace internal
9898 } // namespace v8 9907 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698