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

Side by Side Diff: src/api.cc

Issue 2804643006: Expose the ValueSerializer data format version as a compile-time constant. (Closed)
Patch Set: . Created 3 years, 8 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-value-serializer-version.h ('k') | src/v8.gyp » ('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 3110 matching lines...) Expand 10 before | Expand all | Expand 10 after
3121 return free(buffer); 3121 return free(buffer);
3122 } 3122 }
3123 3123
3124 struct ValueSerializer::PrivateData { 3124 struct ValueSerializer::PrivateData {
3125 explicit PrivateData(i::Isolate* i, ValueSerializer::Delegate* delegate) 3125 explicit PrivateData(i::Isolate* i, ValueSerializer::Delegate* delegate)
3126 : isolate(i), serializer(i, delegate) {} 3126 : isolate(i), serializer(i, delegate) {}
3127 i::Isolate* isolate; 3127 i::Isolate* isolate;
3128 i::ValueSerializer serializer; 3128 i::ValueSerializer serializer;
3129 }; 3129 };
3130 3130
3131 // static
3132 uint32_t ValueSerializer::GetCurrentDataFormatVersion() {
3133 return i::ValueSerializer::GetCurrentDataFormatVersion();
3134 }
3135
3136 ValueSerializer::ValueSerializer(Isolate* isolate) 3131 ValueSerializer::ValueSerializer(Isolate* isolate)
3137 : ValueSerializer(isolate, nullptr) {} 3132 : ValueSerializer(isolate, nullptr) {}
3138 3133
3139 ValueSerializer::ValueSerializer(Isolate* isolate, Delegate* delegate) 3134 ValueSerializer::ValueSerializer(Isolate* isolate, Delegate* delegate)
3140 : private_( 3135 : private_(
3141 new PrivateData(reinterpret_cast<i::Isolate*>(isolate), delegate)) {} 3136 new PrivateData(reinterpret_cast<i::Isolate*>(isolate), delegate)) {}
3142 3137
3143 ValueSerializer::~ValueSerializer() { delete private_; } 3138 ValueSerializer::~ValueSerializer() { delete private_; }
3144 3139
3145 void ValueSerializer::WriteHeader() { private_->serializer.WriteHeader(); } 3140 void ValueSerializer::WriteHeader() { private_->serializer.WriteHeader(); }
(...skipping 7210 matching lines...) Expand 10 before | Expand all | Expand 10 after
10356 Address callback_address = 10351 Address callback_address =
10357 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10352 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10358 VMState<EXTERNAL> state(isolate); 10353 VMState<EXTERNAL> state(isolate);
10359 ExternalCallbackScope call_scope(isolate, callback_address); 10354 ExternalCallbackScope call_scope(isolate, callback_address);
10360 callback(info); 10355 callback(info);
10361 } 10356 }
10362 10357
10363 10358
10364 } // namespace internal 10359 } // namespace internal
10365 } // namespace v8 10360 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-value-serializer-version.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698