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

Side by Side Diff: src/api.cc

Issue 2594793005: 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
« 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 3028 matching lines...) Expand 10 before | Expand all | Expand 10 after
3039 3039
3040 Maybe<bool> ValueSerializer::Delegate::WriteHostObject(Isolate* v8_isolate, 3040 Maybe<bool> ValueSerializer::Delegate::WriteHostObject(Isolate* v8_isolate,
3041 Local<Object> object) { 3041 Local<Object> object) {
3042 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); 3042 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
3043 isolate->ScheduleThrow(*isolate->factory()->NewError( 3043 isolate->ScheduleThrow(*isolate->factory()->NewError(
3044 isolate->error_function(), i::MessageTemplate::kDataCloneError, 3044 isolate->error_function(), i::MessageTemplate::kDataCloneError,
3045 Utils::OpenHandle(*object))); 3045 Utils::OpenHandle(*object)));
3046 return Nothing<bool>(); 3046 return Nothing<bool>();
3047 } 3047 }
3048 3048
3049 Maybe<uint32_t> ValueSerializer::Delegate::GetSharedArrayBufferId(
3050 Isolate* v8_isolate, Local<SharedArrayBuffer> shared_array_buffer) {
3051 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
3052 isolate->ScheduleThrow(*isolate->factory()->NewError(
3053 isolate->error_function(), i::MessageTemplate::kDataCloneError,
3054 Utils::OpenHandle(*shared_array_buffer)));
3055 return Nothing<uint32_t>();
3056 }
3057
3049 void* ValueSerializer::Delegate::ReallocateBufferMemory(void* old_buffer, 3058 void* ValueSerializer::Delegate::ReallocateBufferMemory(void* old_buffer,
3050 size_t size, 3059 size_t size,
3051 size_t* actual_size) { 3060 size_t* actual_size) {
3052 *actual_size = size; 3061 *actual_size = size;
3053 return realloc(old_buffer, size); 3062 return realloc(old_buffer, size);
3054 } 3063 }
3055 3064
3056 void ValueSerializer::Delegate::FreeBufferMemory(void* buffer) { 3065 void ValueSerializer::Delegate::FreeBufferMemory(void* buffer) {
3057 return free(buffer); 3066 return free(buffer);
3058 } 3067 }
(...skipping 6863 matching lines...) Expand 10 before | Expand all | Expand 10 after
9922 Address callback_address = 9931 Address callback_address =
9923 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9932 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9924 VMState<EXTERNAL> state(isolate); 9933 VMState<EXTERNAL> state(isolate);
9925 ExternalCallbackScope call_scope(isolate, callback_address); 9934 ExternalCallbackScope call_scope(isolate, callback_address);
9926 callback(info); 9935 callback(info);
9927 } 9936 }
9928 9937
9929 9938
9930 } // namespace internal 9939 } // namespace internal
9931 } // namespace v8 9940 } // 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