flutter_flutter/engine/src/flutter/runtime/dart_vm_initializer.h
Jason Simmons 5c4a3d6a92 Avoid calling Dart timeline APIs during Dart_Cleanup (flutter/engine#24007)
The Dart timeline is not thread safe if an engine thread that is not
controlled by Dart calls Dart_TimelineEvent while another thread is
calling Dart_Cleanup.

Fixes https://github.com/flutter/flutter/issues/74134
2021-02-02 09:12:55 -08:00

27 lines
991 B
C++

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_RUNTIME_DART_VM_INITIALIZER_H_
#define FLUTTER_RUNTIME_DART_VM_INITIALIZER_H_
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/dart/runtime/include/dart_tools_api.h"
class DartVMInitializer {
public:
static void Initialize(Dart_InitializeParams* params);
static void Cleanup();
private:
static void LogDartTimelineEvent(const char* label,
int64_t timestamp0,
int64_t timestamp1_or_async_id,
Dart_Timeline_Event_Type type,
intptr_t argument_count,
const char** argument_names,
const char** argument_values);
};
#endif // FLUTTER_RUNTIME_DART_VM_INITIALIZER_H_