v8_value_serializer.h 929 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (c) 2020 Slack Technologies, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef SHELL_COMMON_V8_VALUE_SERIALIZER_H_
  5. #define SHELL_COMMON_V8_VALUE_SERIALIZER_H_
  6. #include "base/containers/span.h"
  7. namespace v8 {
  8. class Isolate;
  9. template <class T>
  10. class Local;
  11. class Value;
  12. } // namespace v8
  13. namespace blink {
  14. struct CloneableMessage;
  15. }
  16. namespace electron {
  17. bool SerializeV8Value(v8::Isolate* isolate,
  18. v8::Local<v8::Value> value,
  19. blink::CloneableMessage* out);
  20. v8::Local<v8::Value> DeserializeV8Value(v8::Isolate* isolate,
  21. const blink::CloneableMessage& in);
  22. v8::Local<v8::Value> DeserializeV8Value(v8::Isolate* isolate,
  23. base::span<const uint8_t> data);
  24. } // namespace electron
  25. #endif // SHELL_COMMON_V8_VALUE_SERIALIZER_H_