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

Side by Side Diff: src/api.cc

Issue 2696133007: ValueSerializer: Add SetTreatArrayBufferViewsAsHostObjects() flag (Closed)
Patch Set: ValueSerializer: Add SetTreatArrayBufferViewsAsHostObjects() flag Created 3 years, 10 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 | « include/v8.h ('k') | src/value-serializer.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 3140 matching lines...) Expand 10 before | Expand all | Expand 10 after
3151 : ValueSerializer(isolate, nullptr) {} 3151 : ValueSerializer(isolate, nullptr) {}
3152 3152
3153 ValueSerializer::ValueSerializer(Isolate* isolate, Delegate* delegate) 3153 ValueSerializer::ValueSerializer(Isolate* isolate, Delegate* delegate)
3154 : private_( 3154 : private_(
3155 new PrivateData(reinterpret_cast<i::Isolate*>(isolate), delegate)) {} 3155 new PrivateData(reinterpret_cast<i::Isolate*>(isolate), delegate)) {}
3156 3156
3157 ValueSerializer::~ValueSerializer() { delete private_; } 3157 ValueSerializer::~ValueSerializer() { delete private_; }
3158 3158
3159 void ValueSerializer::WriteHeader() { private_->serializer.WriteHeader(); } 3159 void ValueSerializer::WriteHeader() { private_->serializer.WriteHeader(); }
3160 3160
3161 void ValueSerializer::SetTreatArrayBufferViewsAsHostObjects(bool mode) {
3162 private_->serializer.SetTreatArrayBufferViewsAsHostObjects(mode);
3163 }
3164
3161 Maybe<bool> ValueSerializer::WriteValue(Local<Context> context, 3165 Maybe<bool> ValueSerializer::WriteValue(Local<Context> context,
3162 Local<Value> value) { 3166 Local<Value> value) {
3163 PREPARE_FOR_EXECUTION_PRIMITIVE(context, ValueSerializer, WriteValue, bool); 3167 PREPARE_FOR_EXECUTION_PRIMITIVE(context, ValueSerializer, WriteValue, bool);
3164 i::Handle<i::Object> object = Utils::OpenHandle(*value); 3168 i::Handle<i::Object> object = Utils::OpenHandle(*value);
3165 Maybe<bool> result = private_->serializer.WriteObject(object); 3169 Maybe<bool> result = private_->serializer.WriteObject(object);
3166 has_pending_exception = result.IsNothing(); 3170 has_pending_exception = result.IsNothing();
3167 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 3171 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3168 return result; 3172 return result;
3169 } 3173 }
3170 3174
(...skipping 7099 matching lines...) Expand 10 before | Expand all | Expand 10 after
10270 Address callback_address = 10274 Address callback_address =
10271 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10275 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10272 VMState<EXTERNAL> state(isolate); 10276 VMState<EXTERNAL> state(isolate);
10273 ExternalCallbackScope call_scope(isolate, callback_address); 10277 ExternalCallbackScope call_scope(isolate, callback_address);
10274 callback(info); 10278 callback(info);
10275 } 10279 }
10276 10280
10277 10281
10278 } // namespace internal 10282 } // namespace internal
10279 } // namespace v8 10283 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/value-serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698