Flutter Engine
flutter::testing::DummyPlatformConfigurationClient Class Reference
Inheritance diagram for flutter::testing::DummyPlatformConfigurationClient:
flutter::PlatformConfigurationClient

Public Member Functions

 DummyPlatformConfigurationClient ()
 
std::string DefaultRouteName () override
 The route or path that the embedder requested when the application was launched. More...
 
void ScheduleFrame () override
 Requests that, at the next appropriate opportunity, a new frame be scheduled for rendering. More...
 
void Render (Scene *scene) override
 Updates the client's rendering on the GPU with the newly provided Scene. More...
 
void UpdateSemantics (SemanticsUpdate *update) override
 Receives a updated semantics tree from the Framework. More...
 
void HandlePlatformMessage (fml::RefPtr< PlatformMessage > message) override
 When the Flutter application has a message to send to the underlying platform, the message needs to be forwarded to the platform on the appropriate thread (via the platform task runner). The PlatformConfiguration delegates this task to the engine via this method. More...
 
FontCollectionGetFontCollection () override
 Returns the current collection of fonts available on the platform. More...
 
void UpdateIsolateDescription (const std::string isolate_name, int64_t isolate_port) override
 Notifies this client of the name of the root isolate and its port when that isolate is launched, restarted (in the cold-restart scenario) or the application itself updates the name of the root isolate (via Window.setIsolateDebugName in window.dart). The name of the isolate is meaningless to the engine but is used in instrumentation and tooling. Currently, this information is to update the service protocol list of available root isolates running in the VM and their names so that the appropriate isolate can be selected in the tools for debugging and instrumentation. More...
 
void SetNeedsReportTimings (bool value) override
 Notifies this client that the application has an opinion about whether its frame timings need to be reported backed to it. Due to the asynchronous nature of rendering in Flutter, it is not possible for the application to determine the total time it took to render a specific frame. While the layer-tree is constructed on the UI thread, it needs to be rendering on the raster thread. Dart code cannot execute on this thread. So any instrumentation about the frame times gathered on this thread needs to be aggregated and sent back to the UI thread for processing in Dart. More...
 
std::shared_ptr< const fml::MappingGetPersistentIsolateData () override
 The embedder can specify data that the isolate can request synchronously on launch. This accessor fetches that data. More...
 
std::unique_ptr< std::vector< std::string > > ComputePlatformResolvedLocale (const std::vector< std::string > &supported_locale_data) override
 Directly invokes platform-specific APIs to compute the locale the platform would have natively resolved to. More...
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::PlatformConfigurationClient
virtual ~PlatformConfigurationClient ()
 

Detailed Description

Definition at line 22 of file platform_configuration_unittests.cc.

Constructor & Destructor Documentation

◆ DummyPlatformConfigurationClient()

flutter::testing::DummyPlatformConfigurationClient::DummyPlatformConfigurationClient ( )
inline

Definition at line 24 of file platform_configuration_unittests.cc.

24  {
25  std::vector<uint8_t> data;
26  isolate_data_.reset(new ::fml::DataMapping(data));
27  }

Member Function Documentation

◆ ComputePlatformResolvedLocale()

std::unique_ptr<std::vector<std::string> > flutter::testing::DummyPlatformConfigurationClient::ComputePlatformResolvedLocale ( const std::vector< std::string > &  supported_locale_data)
inlineoverridevirtual

Directly invokes platform-specific APIs to compute the locale the platform would have natively resolved to.

Parameters
[in]supported_locale_dataThe vector of strings that represents the locales supported by the app. Each locale consists of three strings: languageCode, countryCode, and scriptCode in that order.
Returns
A vector of 3 strings languageCode, countryCode, and scriptCode that represents the locale selected by the platform. Empty strings mean the value was unassigned. Empty vector represents a null locale.

Implements flutter::PlatformConfigurationClient.

Definition at line 40 of file platform_configuration_unittests.cc.

41  {
42  return nullptr;
43  };

◆ DefaultRouteName()

std::string flutter::testing::DummyPlatformConfigurationClient::DefaultRouteName ( )
inlineoverridevirtual

The route or path that the embedder requested when the application was launched.

This will be the string "`/`" if no particular route was requested.

Implements flutter::PlatformConfigurationClient.

Definition at line 28 of file platform_configuration_unittests.cc.

28 { return "TestRoute"; }

◆ GetFontCollection()

FontCollection& flutter::testing::DummyPlatformConfigurationClient::GetFontCollection ( )
inlineoverridevirtual

Returns the current collection of fonts available on the platform.

This function reads an XML file and makes font families and collections of them. MinikinFontForTest is used for FontFamily creation.

Implements flutter::PlatformConfigurationClient.

Definition at line 33 of file platform_configuration_unittests.cc.

33 { return font_collection_; }

◆ GetPersistentIsolateData()

std::shared_ptr<const fml::Mapping> flutter::testing::DummyPlatformConfigurationClient::GetPersistentIsolateData ( )
inlineoverridevirtual

The embedder can specify data that the isolate can request synchronously on launch. This accessor fetches that data.

This data is persistent for the duration of the Flutter application and is available even after isolate restarts. Because of this lifecycle, the size of this data must be kept to a minimum.

For asynchronous communication between the embedder and isolate, a platform channel may be used.

Returns
A map of the isolate data that the framework can request upon launch.

Implements flutter::PlatformConfigurationClient.

Definition at line 37 of file platform_configuration_unittests.cc.

37  {
38  return isolate_data_;
39  }

◆ HandlePlatformMessage()

void flutter::testing::DummyPlatformConfigurationClient::HandlePlatformMessage ( fml::RefPtr< PlatformMessage message)
inlineoverridevirtual

When the Flutter application has a message to send to the underlying platform, the message needs to be forwarded to the platform on the appropriate thread (via the platform task runner). The PlatformConfiguration delegates this task to the engine via this method.

See also
PlatformView::HandlePlatformMessage
Parameters
[in]messageThe message from the Flutter application to send to the underlying platform.

Implements flutter::PlatformConfigurationClient.

Definition at line 32 of file platform_configuration_unittests.cc.

32 {}

◆ Render()

void flutter::testing::DummyPlatformConfigurationClient::Render ( Scene scene)
inlineoverridevirtual

Updates the client's rendering on the GPU with the newly provided Scene.

Implements flutter::PlatformConfigurationClient.

Definition at line 30 of file platform_configuration_unittests.cc.

30 {}

◆ ScheduleFrame()

void flutter::testing::DummyPlatformConfigurationClient::ScheduleFrame ( )
inlineoverridevirtual

Requests that, at the next appropriate opportunity, a new frame be scheduled for rendering.

Implements flutter::PlatformConfigurationClient.

Definition at line 29 of file platform_configuration_unittests.cc.

29 {}

◆ SetNeedsReportTimings()

void flutter::testing::DummyPlatformConfigurationClient::SetNeedsReportTimings ( bool  value)
inlineoverridevirtual

Notifies this client that the application has an opinion about whether its frame timings need to be reported backed to it. Due to the asynchronous nature of rendering in Flutter, it is not possible for the application to determine the total time it took to render a specific frame. While the layer-tree is constructed on the UI thread, it needs to be rendering on the raster thread. Dart code cannot execute on this thread. So any instrumentation about the frame times gathered on this thread needs to be aggregated and sent back to the UI thread for processing in Dart.

When the application indicates that frame times need to be reported, it collects this information till a specified number of data points are gathered. Then this information is sent back to Dart code via Engine::ReportTimings.

This option is engine counterpart of the Window._setNeedsReportTimings in window.dart.

Parameters
[in]needs_reportingIf reporting information should be collected and send back to Dart.

Implements flutter::PlatformConfigurationClient.

Definition at line 36 of file platform_configuration_unittests.cc.

36 {}

◆ UpdateIsolateDescription()

void flutter::testing::DummyPlatformConfigurationClient::UpdateIsolateDescription ( const std::string  isolate_name,
int64_t  isolate_port 
)
inlineoverridevirtual

Notifies this client of the name of the root isolate and its port when that isolate is launched, restarted (in the cold-restart scenario) or the application itself updates the name of the root isolate (via Window.setIsolateDebugName in window.dart). The name of the isolate is meaningless to the engine but is used in instrumentation and tooling. Currently, this information is to update the service protocol list of available root isolates running in the VM and their names so that the appropriate isolate can be selected in the tools for debugging and instrumentation.

Parameters
[in]isolate_nameThe isolate name
[in]isolate_portThe isolate port

Implements flutter::PlatformConfigurationClient.

Definition at line 34 of file platform_configuration_unittests.cc.

35  {}

◆ UpdateSemantics()

void flutter::testing::DummyPlatformConfigurationClient::UpdateSemantics ( SemanticsUpdate update)
inlineoverridevirtual

Receives a updated semantics tree from the Framework.

Parameters
[in]updateThe updated semantic tree to apply.

Implements flutter::PlatformConfigurationClient.

Definition at line 31 of file platform_configuration_unittests.cc.

31 {}

The documentation for this class was generated from the following file: