Flutter Engine
The Flutter Engine
system.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_PKG_ZIRCON_SDK_EXT_SYSTEM_H_
6#define FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_PKG_ZIRCON_SDK_EXT_SYSTEM_H_
7
8#include <zircon/syscalls.h>
9
10#include "handle.h"
11#include "handle_disposition.h"
12#include "third_party/dart/runtime/include/dart_api.h"
16
17namespace zircon {
18namespace dart {
19
20class System : public fml::RefCountedThreadSafe<System>,
22 DEFINE_WRAPPERTYPEINFO();
23 FML_FRIEND_REF_COUNTED_THREAD_SAFE(System);
24 FML_FRIEND_MAKE_REF_COUNTED(System);
25
26 public:
27 static Dart_Handle ChannelCreate(uint32_t options);
28 static Dart_Handle ChannelFromFile(std::string path);
29 static zx_status_t ChannelWrite(fml::RefPtr<Handle> channel,
31 std::vector<Handle*> handles);
32 static zx_status_t ChannelWriteEtc(
33 fml::RefPtr<Handle> channel,
35 std::vector<HandleDisposition*> handle_dispositions);
36 // TODO(ianloic): Add ChannelRead
39
40 static Dart_Handle EventpairCreate(uint32_t options);
41
42 static Dart_Handle SocketCreate(uint32_t options);
45 int options);
46 static Dart_Handle SocketRead(fml::RefPtr<Handle> socket, size_t size);
47
48 static Dart_Handle VmoCreate(uint64_t size, uint32_t options);
49 static Dart_Handle VmoFromFile(std::string path);
51 static zx_status_t VmoSetSize(fml::RefPtr<Handle> vmo, uint64_t size);
52 static zx_status_t VmoWrite(fml::RefPtr<Handle> vmo,
53 uint64_t offset,
56 uint64_t offset,
57 size_t size);
58
60
61 static uint64_t ClockGetMonotonic();
62
63 static void RegisterNatives(tonic::DartLibraryNatives* natives);
64
65 static zx_status_t ConnectToService(std::string path,
66 fml::RefPtr<Handle> channel);
67
68 private:
69 static void VmoMapFinalizer(void* isolate_callback_data, void* peer);
70};
71
72} // namespace dart
73} // namespace zircon
74
75#endif // FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_PKG_ZIRCON_SDK_EXT_SYSTEM_H_
const char * options
static Dart_Handle ChannelCreate(uint32_t options)
Definition: system.cc:201
static Dart_Handle SocketCreate(uint32_t options)
Definition: system.cc:399
static Dart_Handle VmoCreate(uint64_t size, uint32_t options)
Definition: system.cc:445
static Dart_Handle VmoMap(fml::RefPtr< Handle > vmo)
Definition: system.cc:543
static zx_status_t VmoWrite(fml::RefPtr< Handle > vmo, uint64_t offset, const tonic::DartByteData &data)
Definition: system.cc:497
static Dart_Handle SocketWrite(fml::RefPtr< Handle > socket, const tonic::DartByteData &data, int options)
Definition: system.cc:411
static Dart_Handle VmoRead(fml::RefPtr< Handle > vmo, uint64_t offset, size_t size)
Definition: system.cc:512
static void RegisterNatives(tonic::DartLibraryNatives *natives)
Definition: system.cc:606
static uint64_t ClockGetMonotonic()
Definition: system.cc:571
static Dart_Handle VmoFromFile(std::string path)
Definition: system.cc:456
static zx_status_t ChannelWriteEtc(fml::RefPtr< Handle > channel, const tonic::DartByteData &data, std::vector< HandleDisposition * > handle_dispositions)
Definition: system.cc:270
static zx_status_t ConnectToService(std::string path, fml::RefPtr< Handle > channel)
Definition: system.cc:213
static Dart_Handle ChannelQueryAndReadEtc(fml::RefPtr< Handle > channel)
Definition: system.cc:346
static Dart_Handle EventpairCreate(uint32_t options)
Definition: system.cc:387
static Dart_Handle ChannelFromFile(std::string path)
Definition: system.cc:219
static zx_status_t ChannelWrite(fml::RefPtr< Handle > channel, const tonic::DartByteData &data, std::vector< Handle * > handles)
Definition: system.cc:245
static Dart_Handle VmoGetSize(fml::RefPtr< Handle > vmo)
Definition: system.cc:479
static Dart_Handle ChannelQueryAndRead(fml::RefPtr< Handle > channel)
Definition: system.cc:306
static zx_status_t VmoSetSize(fml::RefPtr< Handle > vmo, uint64_t size)
Definition: system.cc:490
static Dart_Handle SocketRead(fml::RefPtr< Handle > socket, size_t size)
Definition: system.cc:426
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
Definition: dart_vm.cc:33
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
Definition: handle.cc:14
SeparatedVector2 offset
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63