forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dart_init.h
60 lines (42 loc) · 1.86 KB
/
dart_init.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2015 The Chromium 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_INIT_H_
#define FLUTTER_RUNTIME_DART_INIT_H_
#include "dart/runtime/include/dart_api.h"
#include "lib/ftl/functional/closure.h"
#include "lib/ftl/build_config.h"
#include <memory>
#include <string>
namespace blink {
// Name of the kernel blob asset within the FLX bundle.
extern const char kKernelAssetKey[];
// Name of the snapshot blob asset within the FLX bundle.
extern const char kSnapshotAssetKey[];
// Name of the platform kernel blob asset within the FLX bundle.
extern const char kPlatformKernelAssetKey[];
bool IsRunningPrecompiledCode();
using EmbedderTracingCallback = ftl::Closure;
typedef void (*ServiceIsolateHook)(bool);
typedef void (*RegisterNativeServiceProtocolExtensionHook)(bool);
struct EmbedderTracingCallbacks {
EmbedderTracingCallback start_tracing_callback;
EmbedderTracingCallback stop_tracing_callback;
EmbedderTracingCallbacks(EmbedderTracingCallback start,
EmbedderTracingCallback stop);
};
void InitDartVM(const uint8_t* vm_snapshot_data,
const uint8_t* vm_snapshot_instructions,
const uint8_t* default_isolate_snapshot_data,
const uint8_t* default_isolate_snapshot_instructions);
void SetEmbedderTracingCallbacks(
std::unique_ptr<EmbedderTracingCallbacks> callbacks);
// Provide a function that will be called during initialization of the
// service isolate.
void SetServiceIsolateHook(ServiceIsolateHook hook);
// Provide a function that will be called to register native service protocol
// extensions.
void SetRegisterNativeServiceProtocolExtensionHook(
RegisterNativeServiceProtocolExtensionHook hook);
} // namespace blink
#endif // FLUTTER_RUNTIME_DART_INIT_H_