Flutter Engine
flutter_runner Namespace Reference

Namespaces

 testing
 

Classes

class  AccessibilityBridge
 
struct  ActiveComponentV1
 
struct  ActiveComponentV2
 
class  CompatTaskRunner
 
class  ComponentV1
 
class  ComponentV2
 
class  Engine
 
class  FileInNamespaceBuffer
 A mapping to a buffer for a file that has been loaded into a namespace. More...
 
class  FlatlandConnection
 
class  FlatlandExternalViewEmbedder
 
class  FlatlandPlatformView
 
struct  FlutterFrameTimes
 
class  FlutterRunnerProductConfiguration
 
class  FocusDelegate
 
class  GfxExternalViewEmbedder
 
class  GfxPlatformView
 
class  GfxSessionConnection
 
class  IsolateConfigurator
 
struct  IxnHasher
 
class  Keyboard
 
class  PlatformView
 
class  PointerDelegate
 
class  Runner
 
class  Surface
 
class  SurfaceProducer
 
class  SurfaceProducerSurface
 
struct  TransformedClip
 
struct  UniqueFDIONSTraits
 
struct  ViewMutators
 
struct  VsyncInfo
 
class  VsyncWaiter
 
struct  VulkanImage
 
class  VulkanSurface
 
class  VulkanSurfacePool
 
class  VulkanSurfaceProducer
 

Typedefs

using on_frame_presented_event = std::function< void(fuchsia::scenic::scheduling::FramePresentedInfo)>
 
using ViewCallback = std::function< void()>
 
using FlatlandViewCreatedCallback = std::function< void(fuchsia::ui::composition::ContentId, fuchsia::ui::composition::ChildViewWatcherPtr child_view_watcher)>
 
using FlatlandViewIdCallback = std::function< void(fuchsia::ui::composition::ContentId)>
 
using OnCreateFlatlandView = fit::function< void(int64_t, ViewCallback, FlatlandViewCreatedCallback, bool, bool)>
 
using OnDestroyFlatlandView = fit::function< void(int64_t, FlatlandViewIdCallback)>
 
using GfxViewIdCallback = std::function< void(scenic::ResourceId)>
 
using OnCreateGfxView = fit::function< void(int64_t, ViewCallback, GfxViewIdCallback, bool, bool)>
 
using OnDestroyGfxView = fit::function< void(int64_t, GfxViewIdCallback)>
 
using OnEnableWireframe = fit::function< void(bool)>
 
using OnUpdateView = fit::function< void(int64_t, SkRect, bool, bool)>
 
using OnCreateSurface = fit::function< std::unique_ptr< flutter::Surface >()>
 
using OnSemanticsNodeUpdate = fit::function< void(flutter::SemanticsNodeUpdates, float)>
 
using OnRequestAnnounce = fit::function< void(std::string)>
 
using OnShaderWarmup = std::function< void(const std::vector< std::string > &, std::function< void(uint32_t)>, uint64_t, uint64_t)>
 
using fup_EventPhase = fuchsia::ui::pointer::EventPhase
 
using fup_MouseDeviceInfo = fuchsia::ui::pointer::MouseDeviceInfo
 
using fup_MouseEvent = fuchsia::ui::pointer::MouseEvent
 
using fup_TouchEvent = fuchsia::ui::pointer::TouchEvent
 
using fup_TouchIxnStatus = fuchsia::ui::pointer::TouchInteractionStatus
 
using fup_TouchResponse = fuchsia::ui::pointer::TouchResponse
 
using fup_TouchResponseType = fuchsia::ui::pointer::TouchResponseType
 
using fup_ViewParameters = fuchsia::ui::pointer::ViewParameters
 
using ReleaseImageCallback = std::function< void()>
 
using UniqueFDIONS = fml::UniqueObject< fdio_ns_t *, UniqueFDIONSTraits >
 
using FireCallbackCallback = std::function< void(fml::TimePoint, fml::TimePoint)>
 
using AwaitVsyncCallback = std::function< void(FireCallbackCallback)>
 
using AwaitVsyncForSecondaryCallbackCallback = std::function< void(FireCallbackCallback)>
 

Functions

static uint32_t FlutterIdToFuchsiaId (int32_t flutter_node_id)
 
static void PrintNodeSizeError (uint32_t node_id)
 
std::unique_ptr< fml::MappingLoadFile (int namespace_fd, const char *path, bool executable)
 
std::unique_ptr< fml::FileMappingMakeFileMapping (const char *path, bool executable)
 
fml::MallocMapping MakeLocalizationPlatformMessageData (const Profile &intl_profile)
 
fml::MallocMapping MakeLocalizationPlatformMessageData (const fuchsia::intl::Profile &intl_profile)
 
template<class T >
void SetInterfaceErrorHandler (fidl::InterfacePtr< T > &interface, std::string name)
 
template<class T >
void SetInterfaceErrorHandler (fidl::Binding< T > &binding, std::string name)
 
static flutter::PointerData::Change GetChangeFromPointerEventPhase (fuchsia::ui::input::PointerEventPhase phase)
 
static flutter::PointerData::DeviceKind GetKindFromPointerType (fuchsia::ui::input::PointerEventType type)
 
static trace_flow_id_t PointerTraceHACK (float fa, float fb)
 
static void SetProcessName ()
 
static void SetThreadName (const std::string &thread_name)
 
static void RegisterProfilerSymbols (const char *symbols_path, const char *dso_name)
 
 TEST (RunnerTZDataTest, LoadsWithoutTZDataPresent)
 
 TEST (RunnerTest, TZData)
 
fml::RefPtr< fml::TaskRunnerCreateFMLTaskRunner (async_dispatcher_t *dispatcher)
 
UniqueFDIONS UniqueFDIONSCreate ()
 
 TEST (VSyncWaiterFuchsia, FrameScheduledForStartTime)
 
static std::string GetCurrentProcessName ()
 
static zx_koid_t GetCurrentProcessId ()
 

Variables

static constexpr fml::TimeDelta kDefaultFlatlandPresentationInterval
 
constexpr uint32_t kFlatlandDefaultViewportSize = 32
 
static constexpr fml::TimeDelta kDefaultPresentationInterval
 
static constexpr char kFlutterPlatformChannel [] = "flutter/platform"
 
static constexpr char kTextInputChannel [] = "flutter/textinput"
 
static constexpr char kKeyEventChannel [] = "flutter/keyevent"
 
static constexpr char kAccessibilityChannel [] = "flutter/accessibility"
 
static constexpr char kFlutterPlatformViewsChannel [] = "flutter/platform_views"
 
static constexpr char kFuchsiaShaderWarmupChannel [] = "fuchsia/shader_warmup"
 

Typedef Documentation

◆ AwaitVsyncCallback

Definition at line 22 of file vsync_waiter.h.

◆ AwaitVsyncForSecondaryCallbackCallback

◆ FireCallbackCallback

◆ FlatlandViewCreatedCallback

using flutter_runner::FlatlandViewCreatedCallback = typedef std::function<void( fuchsia::ui::composition::ContentId, fuchsia::ui::composition::ChildViewWatcherPtr child_view_watcher)>

Definition at line 37 of file flatland_external_view_embedder.h.

◆ FlatlandViewIdCallback

using flutter_runner::FlatlandViewIdCallback = typedef std::function<void(fuchsia::ui::composition::ContentId)>

Definition at line 39 of file flatland_external_view_embedder.h.

◆ fup_EventPhase

using flutter_runner::fup_EventPhase = typedef fuchsia::ui::pointer::EventPhase

Definition at line 27 of file pointer_delegate.cc.

◆ fup_MouseDeviceInfo

using flutter_runner::fup_MouseDeviceInfo = typedef fuchsia::ui::pointer::MouseDeviceInfo

Definition at line 28 of file pointer_delegate.cc.

◆ fup_MouseEvent

using flutter_runner::fup_MouseEvent = typedef fuchsia::ui::pointer::MouseEvent

Definition at line 29 of file pointer_delegate.cc.

◆ fup_TouchEvent

using flutter_runner::fup_TouchEvent = typedef fuchsia::ui::pointer::TouchEvent

Definition at line 30 of file pointer_delegate.cc.

◆ fup_TouchIxnStatus

using flutter_runner::fup_TouchIxnStatus = typedef fuchsia::ui::pointer::TouchInteractionStatus

Definition at line 31 of file pointer_delegate.cc.

◆ fup_TouchResponse

using flutter_runner::fup_TouchResponse = typedef fuchsia::ui::pointer::TouchResponse

Definition at line 32 of file pointer_delegate.cc.

◆ fup_TouchResponseType

using flutter_runner::fup_TouchResponseType = typedef fuchsia::ui::pointer::TouchResponseType

Definition at line 33 of file pointer_delegate.cc.

◆ fup_ViewParameters

using flutter_runner::fup_ViewParameters = typedef fuchsia::ui::pointer::ViewParameters

Definition at line 34 of file pointer_delegate.cc.

◆ GfxViewIdCallback

using flutter_runner::GfxViewIdCallback = typedef std::function<void(scenic::ResourceId)>

Definition at line 36 of file gfx_external_view_embedder.h.

◆ on_frame_presented_event

typedef std::function< void(fuchsia::scenic::scheduling::FramePresentedInfo)> flutter_runner::on_frame_presented_event

Definition at line 23 of file flatland_connection.h.

◆ OnCreateFlatlandView

Definition at line 18 of file flatland_platform_view.h.

◆ OnCreateGfxView

using flutter_runner::OnCreateGfxView = typedef fit::function<void(int64_t, ViewCallback, GfxViewIdCallback, bool, bool)>

Definition at line 19 of file gfx_platform_view.h.

◆ OnCreateSurface

using flutter_runner::OnCreateSurface = typedef fit::function<std::unique_ptr<flutter::Surface>()>

Definition at line 42 of file platform_view.h.

◆ OnDestroyFlatlandView

Definition at line 20 of file flatland_platform_view.h.

◆ OnDestroyGfxView

Definition at line 20 of file gfx_platform_view.h.

◆ OnEnableWireframe

using flutter_runner::OnEnableWireframe = typedef fit::function<void(bool)>

Definition at line 39 of file platform_view.h.

◆ OnRequestAnnounce

using flutter_runner::OnRequestAnnounce = typedef fit::function<void(std::string)>

Definition at line 45 of file platform_view.h.

◆ OnSemanticsNodeUpdate

Definition at line 44 of file platform_view.h.

◆ OnShaderWarmup

using flutter_runner::OnShaderWarmup = typedef std::function<void(const std::vector<std::string>&, std::function<void(uint32_t)>, uint64_t, uint64_t)>

Definition at line 52 of file platform_view.h.

◆ OnUpdateView

using flutter_runner::OnUpdateView = typedef fit::function<void(int64_t, SkRect, bool, bool)>

Definition at line 41 of file platform_view.h.

◆ ReleaseImageCallback

Definition at line 20 of file surface_producer.h.

◆ UniqueFDIONS

Definition at line 24 of file unique_fdio_ns.h.

◆ ViewCallback

Function Documentation

◆ CreateFMLTaskRunner()

fml::RefPtr< fml::TaskRunner > flutter_runner::CreateFMLTaskRunner ( async_dispatcher_t *  dispatcher)

Definition at line 51 of file task_runner_adapter.cc.

Referenced by flutter_runner::testing::TEST_F().

52  {
53  return fml::MakeRefCounted<CompatTaskRunner>(dispatcher);
54 }

◆ FlutterIdToFuchsiaId()

static uint32_t flutter_runner::FlutterIdToFuchsiaId ( int32_t  flutter_node_id)
static

Definition at line 486 of file accessibility_bridge.cc.

References FML_DCHECK, flutter_runner::AccessibilityBridge::kMaxMessageSize, and flutter_runner::AccessibilityBridge::kNodeIdSize.

Referenced by flutter_runner::AccessibilityBridge::AddSemanticsNodeUpdate().

486  {
487  FML_DCHECK(flutter_node_id >= 0)
488  << "Unexpectedly received a negative semantics node ID.";
489  return static_cast<uint32_t>(flutter_node_id);
490 }
#define FML_DCHECK(condition)
Definition: logging.h:86

◆ GetChangeFromPointerEventPhase()

static flutter::PointerData::Change flutter_runner::GetChangeFromPointerEventPhase ( fuchsia::ui::input::PointerEventPhase  phase)
static

Definition at line 251 of file platform_view.cc.

References flutter::PointerData::kAdd, flutter::PointerData::kCancel, flutter::PointerData::kDown, flutter::PointerData::kHover, flutter::PointerData::kMove, flutter::PointerData::kRemove, and flutter::PointerData::kUp.

Referenced by flutter_runner::PlatformView::OnHandlePointerEvent().

252  {
253  switch (phase) {
254  case fuchsia::ui::input::PointerEventPhase::ADD:
256  case fuchsia::ui::input::PointerEventPhase::HOVER:
258  case fuchsia::ui::input::PointerEventPhase::DOWN:
260  case fuchsia::ui::input::PointerEventPhase::MOVE:
262  case fuchsia::ui::input::PointerEventPhase::UP:
264  case fuchsia::ui::input::PointerEventPhase::REMOVE:
266  case fuchsia::ui::input::PointerEventPhase::CANCEL:
268  default:
270  }
271 }

◆ GetCurrentProcessId()

static zx_koid_t flutter_runner::GetCurrentProcessId ( )
static

Definition at line 25 of file vulkan_surface_pool.cc.

Referenced by flutter_runner::VulkanSurfacePool::VulkanSurfacePool().

25  {
26  zx_info_handle_basic_t info;
27  zx_status_t status = zx::process::self()->get_info(
28  ZX_INFO_HANDLE_BASIC, &info, sizeof(info), nullptr, nullptr);
29  return status == ZX_OK ? info.koid : ZX_KOID_INVALID;
30 }

◆ GetCurrentProcessName()

static std::string flutter_runner::GetCurrentProcessName ( )
static

Definition at line 18 of file vulkan_surface_pool.cc.

References name.

Referenced by flutter_runner::VulkanSurfacePool::VulkanSurfacePool().

18  {
19  char name[ZX_MAX_NAME_LEN];
20  zx_status_t status =
21  zx::process::self()->get_property(ZX_PROP_NAME, name, sizeof(name));
22  return status == ZX_OK ? std::string(name) : std::string();
23 }
Definition: ref_ptr.h:252
const char * name
Definition: fuchsia.cc:50

◆ GetKindFromPointerType()

static flutter::PointerData::DeviceKind flutter_runner::GetKindFromPointerType ( fuchsia::ui::input::PointerEventType  type)
static

Definition at line 273 of file platform_view.cc.

References flutter::PointerData::kMouse, and flutter::PointerData::kTouch.

Referenced by flutter_runner::PlatformView::OnHandlePointerEvent().

274  {
275  switch (type) {
276  case fuchsia::ui::input::PointerEventType::TOUCH:
278  case fuchsia::ui::input::PointerEventType::MOUSE:
280  default:
282  }
283 }
KeyCallType type

◆ LoadFile()

std::unique_ptr< fml::Mapping > flutter_runner::LoadFile ( int  namespace_fd,
const char *  path,
bool  executable 
)

Loads a file from |file_path| into the namespace |namespace_fd|, returning the mapping for that file.

The file will be loaded with the readable permission. If |executable| is true, the file will be also be loaded with the executable permission.

Definition at line 73 of file file_in_namespace_buffer.cc.

References FML_TRACE_EVENT, and flutter::path.

Referenced by flutter_runner::ComponentV1::Create(), and flutter_runner::ComponentV2::Create().

75  {
76  FML_TRACE_EVENT("flutter", "LoadFile", "path", path);
77  return std::make_unique<FileInNamespaceBuffer>(namespace_fd, path,
78  executable);
79 }
DEF_SWITCHES_START snapshot asset path
Definition: switches.h:32
#define FML_TRACE_EVENT(category_group, name,...)
Definition: trace_event.h:86

◆ MakeFileMapping()

std::unique_ptr< fml::FileMapping > flutter_runner::MakeFileMapping ( const char *  path,
bool  executable 
)

Opens the file at |path| and creates a file mapping for the file.

The file will be opened with the readable permission. If |executable| is true, the file will also be opened with the executable permission.

Definition at line 81 of file file_in_namespace_buffer.cc.

References flags.

Referenced by flutter_runner::ComponentV1::Create(), and flutter_runner::ComponentV2::Create().

82  {
83  uint32_t flags = OPEN_RIGHT_READABLE;
84  if (executable) {
85  flags |= OPEN_RIGHT_EXECUTABLE;
86  }
87 
88  // The returned file descriptor is compatible with standard posix operations
89  // such as close, mmap, etc. We only need to treat open/open_at specially.
90  int fd;
91  const zx_status_t status = fdio_open_fd(path, flags, &fd);
92  if (status != ZX_OK) {
93  return nullptr;
94  }
95 
96  using Protection = fml::FileMapping::Protection;
97 
98  std::initializer_list<Protection> protection_execute = {Protection::kRead,
99  Protection::kExecute};
100  std::initializer_list<Protection> protection_read = {Protection::kRead};
101  auto mapping = std::make_unique<fml::FileMapping>(
102  fml::UniqueFD{fd}, executable ? protection_execute : protection_read);
103 
104  if (!mapping->IsValid()) {
105  return nullptr;
106  }
107  return mapping;
108 }
DEF_SWITCHES_START snapshot asset path
Definition: switches.h:32
FlutterSemanticsFlag flags

◆ MakeLocalizationPlatformMessageData() [1/2]

fml::MallocMapping flutter_runner::MakeLocalizationPlatformMessageData ( const fuchsia::intl::Profile &  intl_profile)

◆ MakeLocalizationPlatformMessageData() [2/2]

fml::MallocMapping flutter_runner::MakeLocalizationPlatformMessageData ( const Profile &  intl_profile)

Definition at line 29 of file fuchsia_intl.cc.

References args, buffer, fml::MallocMapping::Copy(), FML_LOG, and flutter::transform.

30  {
31  rapidjson::Document document;
32  auto& allocator = document.GetAllocator();
33  document.SetObject();
34  document.AddMember("method", "setLocale", allocator);
35  rapidjson::Value args(rapidjson::kArrayType);
36 
37  for (const auto& locale_id : intl_profile.locales()) {
38  UErrorCode error_code = U_ZERO_ERROR;
39  icu::Locale locale = icu::Locale::forLanguageTag(locale_id.id, error_code);
40  if (U_FAILURE(error_code)) {
41  FML_LOG(ERROR) << "Error parsing locale ID \"" << locale_id.id << "\"";
42  continue;
43  }
44  args.PushBack(rapidjson::Value().SetString(locale.getLanguage(), allocator),
45  allocator);
46 
47  auto country = locale.getCountry() != nullptr ? locale.getCountry() : "";
48  args.PushBack(rapidjson::Value().SetString(country, allocator), allocator);
49 
50  auto script = locale.getScript() != nullptr ? locale.getScript() : "";
51  args.PushBack(rapidjson::Value().SetString(script, allocator), allocator);
52 
53  std::string variant =
54  locale.getVariant() != nullptr ? locale.getVariant() : "";
55  // ICU4C capitalizes the variant for backward compatibility, even though
56  // the preferred form is lowercase. So we lowercase here.
57  std::transform(begin(variant), end(variant), begin(variant),
58  [](unsigned char c) { return std::tolower(c); });
59  args.PushBack(rapidjson::Value().SetString(variant, allocator), allocator);
60  }
61 
62  document.AddMember("args", args, allocator);
63 
64  rapidjson::StringBuffer buffer;
65  rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
66  document.Accept(writer);
67  auto data = reinterpret_cast<const uint8_t*>(buffer.GetString());
68  return fml::MallocMapping::Copy(data, buffer.GetSize());
69 }
G_BEGIN_DECLS FlValue * args
#define FML_LOG(severity)
Definition: logging.h:65
static MallocMapping Copy(const T *begin, const T *end)
Definition: mapping.h:147
static const uint8_t buffer[]

◆ PointerTraceHACK()

static trace_flow_id_t flutter_runner::PointerTraceHACK ( float  fa,
float  fb 
)
static

Definition at line 287 of file platform_view.cc.

Referenced by flutter_runner::PlatformView::OnHandlePointerEvent().

287  {
288  uint32_t ia, ib;
289  memcpy(&ia, &fa, sizeof(uint32_t));
290  memcpy(&ib, &fb, sizeof(uint32_t));
291  return (((uint64_t)ia) << 32) | ib;
292 }

◆ PrintNodeSizeError()

static void flutter_runner::PrintNodeSizeError ( uint32_t  node_id)
static

Definition at line 518 of file accessibility_bridge.cc.

References FML_LOG.

Referenced by flutter_runner::AccessibilityBridge::AddSemanticsNodeUpdate().

518  {
519  FML_LOG(ERROR) << "Semantics node with ID " << node_id
520  << " exceeded the maximum FIDL message size and may not "
521  "be delivered to the accessibility manager service.";
522 }
#define FML_LOG(severity)
Definition: logging.h:65

◆ RegisterProfilerSymbols()

static void flutter_runner::RegisterProfilerSymbols ( const char *  symbols_path,
const char *  dso_name 
)
static

Definition at line 141 of file runner.cc.

References FML_LOG, and dart_utils::ReadFileToString().

Referenced by flutter_runner::Runner::Runner().

142  {
143  std::string* symbols = new std::string();
144  if (dart_utils::ReadFileToString(symbols_path, symbols)) {
145  Dart_AddSymbols(dso_name, symbols->data(), symbols->size());
146  } else {
147  FML_LOG(ERROR) << "Failed to load " << symbols_path;
148  }
149 }
#define FML_LOG(severity)
Definition: logging.h:65
bool ReadFileToString(const std::string &path, std::string *result)
Definition: files.cc:56

◆ SetInterfaceErrorHandler() [1/2]

template<class T >
void flutter_runner::SetInterfaceErrorHandler ( fidl::InterfacePtr< T > &  interface,
std::string  name 
)

Definition at line 40 of file platform_view.cc.

References FML_LOG.

41  {
42  interface.set_error_handler([name](zx_status_t status) {
43  FML_LOG(ERROR) << "Interface error on: " << name << ", status: " << status;
44  });
45 }
#define FML_LOG(severity)
Definition: logging.h:65
const char * name
Definition: fuchsia.cc:50

◆ SetInterfaceErrorHandler() [2/2]

template<class T >
void flutter_runner::SetInterfaceErrorHandler ( fidl::Binding< T > &  binding,
std::string  name 
)

Definition at line 47 of file platform_view.cc.

References FML_LOG.

47  {
48  binding.set_error_handler([name](zx_status_t status) {
49  FML_LOG(ERROR) << "Binding error on: " << name << ", status: " << status;
50  });
51 }
#define FML_LOG(severity)
Definition: logging.h:65
const char * name
Definition: fuchsia.cc:50

◆ SetProcessName()

static void flutter_runner::SetProcessName ( )
static

Definition at line 118 of file runner.cc.

References flutter::DartVM::IsRunningPrecompiledCode(), and name.

Referenced by flutter_runner::Runner::Runner().

118  {
119  std::stringstream stream;
120 #if defined(DART_PRODUCT)
121  stream << "io.flutter.product_runner.";
122 #else
123  stream << "io.flutter.runner.";
124 #endif
126  stream << "aot";
127  } else {
128  stream << "jit";
129  }
130  const auto name = stream.str();
131  zx::process::self()->set_property(ZX_PROP_NAME, name.c_str(), name.size());
132 }
static bool IsRunningPrecompiledCode()
Checks if VM instances in the process can run precompiled code. This call can be made at any time and...
Definition: dart_vm.cc:202
const char * name
Definition: fuchsia.cc:50

◆ SetThreadName()

static void flutter_runner::SetThreadName ( const std::string &  thread_name)
static

Definition at line 134 of file runner.cc.

Referenced by flutter_runner::Runner::Runner().

134  {
135  zx::thread::self()->set_property(ZX_PROP_NAME, thread_name.c_str(),
136  thread_name.size());
137 }

◆ TEST() [1/3]

flutter_runner::TEST ( RunnerTest  ,
TZData   
)

Definition at line 13 of file runner_unittest.cc.

13  {
14  // TODO(fxbug.dev/69570): Move to cml file if env_vars gains supported for the
15  // gtest_runner.
16  setenv("ICU_TIMEZONE_FILES_DIR", "/pkg/data/tzdata", true);
17 
18  UErrorCode err = U_ZERO_ERROR;
19  const auto version_before = std::string(icu::TimeZone::getTZDataVersion(err));
20  ASSERT_EQ(U_ZERO_ERROR, err) << "unicode error: " << u_errorName(err);
21 
22  // This loads the tzdata. In Fuchsia, we force the data from this package
23  // to be version 2019a, so that we can test the resource load.
24  bool success = Runner::SetupICUInternal();
25  ASSERT_TRUE(success) << "failed to load timezone data";
26 
27  const auto version_after = std::string(icu::TimeZone::getTZDataVersion(err));
28  ASSERT_EQ(U_ZERO_ERROR, err) << "unicode error: " << u_errorName(err);
29 
30  EXPECT_EQ("2019a", version_after);
31 }

◆ TEST() [2/3]

flutter_runner::TEST ( RunnerTZDataTest  ,
LoadsWithoutTZDataPresent   
)

Definition at line 15 of file runner_tzdata_unittest.cc.

15  {
16  bool success = Runner::SetupICUInternal();
17  ASSERT_TRUE(success) << "failed to load set up ICU data";
18 }

◆ TEST() [3/3]

flutter_runner::TEST ( VSyncWaiterFuchsia  ,
FrameScheduledForStartTime   
)

Definition at line 20 of file vsync_waiter_unittest.cc.

References callback, fml::MessageLoop::EnsureInitializedForCurrentThread(), fml::TimeDelta::FromMilliseconds(), fml::MessageLoop::GetCurrent(), fml::MessageLoop::GetTaskRunner(), fml::TimePoint::Now(), flutter::prefix, and fml::AutoResetWaitableEvent::Wait().

20  {
21  using flutter::ThreadHost;
22  std::string prefix = "vsync_waiter_test";
23 
25  auto platform_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner();
26 
27  ThreadHost thread_host =
28  ThreadHost(prefix, flutter::ThreadHost::Type::RASTER |
29  flutter::ThreadHost::Type::UI |
30  flutter::ThreadHost::Type::IO);
31  const flutter::TaskRunners task_runners(
32  prefix, // Dart thread labels
33  platform_task_runner, // platform
34  thread_host.raster_thread->GetTaskRunner(), // raster
35  thread_host.ui_thread->GetTaskRunner(), // ui
36  thread_host.io_thread->GetTaskRunner() // io
37  );
38 
39  // await vsync will invoke the callback right away, but vsync waiter will post
40  // the task for frame_start time.
41  VsyncWaiter vsync_waiter(
43  const auto now = fml::TimePoint::Now();
44  const auto frame_start = now + fml::TimeDelta::FromMilliseconds(20);
45  const auto frame_end = now + fml::TimeDelta::FromMilliseconds(36);
46  callback(frame_start, frame_end);
47  },
48  /*secondary callback*/ nullptr, task_runners);
49 
51  task_runners.GetUITaskRunner()->PostTask([&]() {
52  vsync_waiter.AsyncWaitForVsync(
53  [&](std::unique_ptr<flutter::FrameTimingsRecorder> recorder) {
54  const auto now = fml::TimePoint::Now();
55  EXPECT_GT(now, recorder->GetVsyncStartTime());
56  latch.Signal();
57  });
58  });
59 
60  latch.Wait();
61 }
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol prefix
Definition: switches.h:59
static FML_EMBEDDER_ONLY MessageLoop & GetCurrent()
Definition: message_loop.cc:19
static void EnsureInitializedForCurrentThread()
Definition: message_loop.cc:27
FlKeyEvent FlKeyResponderAsyncCallback callback
fml::RefPtr< fml::TaskRunner > GetTaskRunner() const
Definition: message_loop.cc:56
std::function< void(fml::TimePoint, fml::TimePoint)> FireCallbackCallback
Definition: vsync_waiter.h:20
The collection of all the threads used by the engine.
Definition: thread_host.h:16
static constexpr TimeDelta FromMilliseconds(int64_t millis)
Definition: time_delta.h:46
static TimePoint Now()
Definition: time_point.cc:39

◆ UniqueFDIONSCreate()

UniqueFDIONS flutter_runner::UniqueFDIONSCreate ( )
inline

Definition at line 26 of file unique_fdio_ns.h.

26  {
27  fdio_ns_t* ns = nullptr;
28  if (fdio_ns_create(&ns) == ZX_OK) {
29  return UniqueFDIONS{ns};
30  }
31  return UniqueFDIONS{nullptr};
32 }
fml::UniqueObject< fdio_ns_t *, UniqueFDIONSTraits > UniqueFDIONS

Variable Documentation

◆ kAccessibilityChannel

constexpr char flutter_runner::kAccessibilityChannel[] = "flutter/accessibility"
static

◆ kDefaultFlatlandPresentationInterval

constexpr fml::TimeDelta flutter_runner::kDefaultFlatlandPresentationInterval
static

◆ kDefaultPresentationInterval

constexpr fml::TimeDelta flutter_runner::kDefaultPresentationInterval
static
Initial value:
=
static constexpr TimeDelta FromSecondsF(double seconds)
Definition: time_delta.h:53

Definition at line 40 of file gfx_session_connection.h.

Referenced by flutter_runner::testing::TEST_F(), and flutter_runner::GfxSessionConnection::UpdatePresentationInfo().

◆ kFlatlandDefaultViewportSize

constexpr uint32_t flutter_runner::kFlatlandDefaultViewportSize = 32

◆ kFlutterPlatformChannel

constexpr char flutter_runner::kFlutterPlatformChannel[] = "flutter/platform"
static

◆ kFlutterPlatformViewsChannel

constexpr char flutter_runner::kFlutterPlatformViewsChannel[] = "flutter/platform_views"
static

◆ kFuchsiaShaderWarmupChannel

constexpr char flutter_runner::kFuchsiaShaderWarmupChannel[] = "fuchsia/shader_warmup"
static

◆ kKeyEventChannel

constexpr char flutter_runner::kKeyEventChannel[] = "flutter/keyevent"
static

Definition at line 33 of file platform_view.cc.

◆ kTextInputChannel

constexpr char flutter_runner::kTextInputChannel[] = "flutter/textinput"
static