Repository navigation
Expand file tree
/
Copy pathhermes_api.h
More file actions
85 lines (64 loc) · 2.91 KB
/
Copy pathhermes_api.h
File metadata and controls
85 lines (64 loc) · 2.91 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#ifndef HERMES_HERMES_API_H
#define HERMES_HERMES_API_H
#include "js_runtime_api.h"
EXTERN_C_START
typedef struct hermes_local_connection_s *hermes_local_connection;
typedef struct hermes_remote_connection_s *hermes_remote_connection;
//=============================================================================
// jsr_runtime
//=============================================================================
JSR_API hermes_dump_crash_data(jsr_runtime runtime, int32_t fd);
JSR_API hermes_sampling_profiler_enable();
JSR_API hermes_sampling_profiler_disable();
JSR_API hermes_sampling_profiler_add(jsr_runtime runtime);
JSR_API hermes_sampling_profiler_remove(jsr_runtime runtime);
JSR_API hermes_sampling_profiler_dump_to_file(const char *filename);
//=============================================================================
// jsr_config
//=============================================================================
JSR_API hermes_config_enable_default_crash_handler(
jsr_config config,
bool value);
//=============================================================================
// Setting inspector singleton
//=============================================================================
typedef int32_t(NAPI_CDECL *hermes_inspector_add_page_cb)(
const char *title,
const char *vm,
void *connectFunc);
typedef void(NAPI_CDECL *hermes_inspector_remove_page_cb)(int32_t page_id);
JSR_API hermes_set_inspector(
hermes_inspector_add_page_cb add_page_cb,
hermes_inspector_remove_page_cb remove_page_cb);
//=============================================================================
// Local and remote inspector connections.
// Local is defined in Hermes VM, Remote is defined by inspector outside of VM.
//=============================================================================
typedef void(NAPI_CDECL *hermes_remote_connection_send_message_cb)(
hermes_remote_connection remote_connection,
const char *message);
typedef void(NAPI_CDECL *hermes_remote_connection_disconnect_cb)(
hermes_remote_connection remote_connection);
JSR_API hermes_create_local_connection(
void *connect_func,
hermes_remote_connection remote_connection,
hermes_remote_connection_send_message_cb on_send_message_cb,
hermes_remote_connection_disconnect_cb on_disconnect_cb,
jsr_data_delete_cb on_delete_cb,
void *deleter_data,
hermes_local_connection *local_connection);
JSR_API hermes_delete_local_connection(
hermes_local_connection local_connection);
JSR_API hermes_local_connection_send_message(
hermes_local_connection local_connection,
const char *message);
JSR_API hermes_local_connection_disconnect(
hermes_local_connection local_connection);
EXTERN_C_END
#endif // !HERMES_HERMES_API_H