dart-sdk/runtime/vm/message_snapshot.h
Ryan Macnak b3a569ea8d [vm] Prevent Dart_NewSendPort from bypassing the arbitrary object checks.
In particular this affects SendPorts from dart:io's IOService and Flutter's IsolateNameServer.

TEST=ci
Bug: https://github.com/flutter/flutter/issues/109248
Change-Id: I28ed3073a6fe5583729637ae7914d914edc709e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255261
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-08-19 18:10:15 +00:00

35 lines
1.1 KiB
C++

// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef RUNTIME_VM_MESSAGE_SNAPSHOT_H_
#define RUNTIME_VM_MESSAGE_SNAPSHOT_H_
#include <memory>
#include "include/dart_native_api.h"
#include "vm/message.h"
#include "vm/object.h"
namespace dart {
std::unique_ptr<Message> WriteMessage(bool same_group,
const Object& obj,
Dart_Port dest_port,
Message::Priority priority);
std::unique_ptr<Message> WriteApiMessage(Zone* zone,
Dart_CObject* obj,
Dart_Port dest_port,
Message::Priority priority);
ObjectPtr ReadObjectGraphCopyMessage(Thread* thread, PersistentHandle* handle);
ObjectPtr ReadMessage(Thread* thread, Message* message);
Dart_CObject* ReadApiMessage(Zone* zone, Message* message);
} // namespace dart
#endif // RUNTIME_VM_MESSAGE_SNAPSHOT_H_