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

Side by Side Diff: src/api.cc

Issue 2696133007: ValueSerializer: Add SetTreatArrayBufferViewsAsHostObjects() flag (Closed)
Patch Set: 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
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 3123 matching lines...) Expand 10 before | Expand all | Expand 10 after
3134 : ValueSerializer(isolate, nullptr) {} 3134 : ValueSerializer(isolate, nullptr) {}
3135 3135
3136 ValueSerializer::ValueSerializer(Isolate* isolate, Delegate* delegate) 3136 ValueSerializer::ValueSerializer(Isolate* isolate, Delegate* delegate)
3137 : private_( 3137 : private_(
3138 new PrivateData(reinterpret_cast<i::Isolate*>(isolate), delegate)) {} 3138 new PrivateData(reinterpret_cast<i::Isolate*>(isolate), delegate)) {}
3139 3139
3140 ValueSerializer::~ValueSerializer() { delete private_; } 3140 ValueSerializer::~ValueSerializer() { delete private_; }
3141 3141
3142 void ValueSerializer::WriteHeader() { private_->serializer.WriteHeader(); } 3142 void ValueSerializer::WriteHeader() { private_->serializer.WriteHeader(); }
3143 3143
3144 void ValueSerializer::SetTreatArrayBufferViewsAsHostObjects(bool mode) {
3145 private_->serializer.SetTreatArrayBufferViewsAsHostObjects(mode);
3146 }
3147
3144 Maybe<bool> ValueSerializer::WriteValue(Local<Context> context, 3148 Maybe<bool> ValueSerializer::WriteValue(Local<Context> context,
3145 Local<Value> value) { 3149 Local<Value> value) {
3146 PREPARE_FOR_EXECUTION_PRIMITIVE(context, ValueSerializer, WriteValue, bool); 3150 PREPARE_FOR_EXECUTION_PRIMITIVE(context, ValueSerializer, WriteValue, bool);
3147 i::Handle<i::Object> object = Utils::OpenHandle(*value); 3151 i::Handle<i::Object> object = Utils::OpenHandle(*value);
3148 Maybe<bool> result = private_->serializer.WriteObject(object); 3152 Maybe<bool> result = private_->serializer.WriteObject(object);
3149 has_pending_exception = result.IsNothing(); 3153 has_pending_exception = result.IsNothing();
3150 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 3154 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3151 return result; 3155 return result;
3152 } 3156 }
3153 3157
(...skipping 7062 matching lines...) Expand 10 before | Expand all | Expand 10 after
10216 Address callback_address = 10220 Address callback_address =
10217 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10221 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10218 VMState<EXTERNAL> state(isolate); 10222 VMState<EXTERNAL> state(isolate);
10219 ExternalCallbackScope call_scope(isolate, callback_address); 10223 ExternalCallbackScope call_scope(isolate, callback_address);
10220 callback(info); 10224 callback(info);
10221 } 10225 }
10222 10226
10223 10227
10224 } // namespace internal 10228 } // namespace internal
10225 } // namespace v8 10229 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698