Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
flutter::testing::FakePlatformConfigurationClient Class Reference
Inheritance diagram for flutter::testing::FakePlatformConfigurationClient:
flutter::PlatformConfigurationClient

Public Member Functions

std::shared_ptr< PlatformIsolateManagerGetPlatformIsolateManager () override
 
std::string DefaultRouteName () override
 The route or path that the embedder requested when the application was launched.
 
void ScheduleFrame () override
 Requests that, at the next appropriate opportunity, a new frame be scheduled for rendering.
 
void EndWarmUpFrame () override
 Called when a warm up frame has ended.
 
void Render (int64_t view_id, Scene *scene, double width, double height) override
 Updates the client's rendering on the GPU with the newly provided Scene.
 
void UpdateSemantics (SemanticsUpdate *update) override
 Receives an updated semantics tree from the Framework.
 
void HandlePlatformMessage (std::unique_ptr< 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.
 
FontCollectionGetFontCollection () override
 Returns the current collection of fonts available on the platform.
 
std::shared_ptr< AssetManagerGetAssetManager () override
 Returns the current collection of assets available on the platform.
 
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.
 
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.
 
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.
 
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.
 
void RequestDartDeferredLibrary (intptr_t loading_unit_id) override
 Invoked when the Dart VM requests that a deferred library be loaded. Notifies the engine that the deferred library identified by the specified loading unit id should be downloaded and loaded into the Dart VM via LoadDartDeferredLibrary
 
void SendChannelUpdate (std::string name, bool listening) override
 Invoked when a listener is registered on a platform channel.
 
double GetScaledFontSize (double unscaled_font_size, int configuration_id) const override
 Synchronously invokes platform-specific APIs to apply the system text scaling on the given unscaled font size.
 

Public Attributes

std::shared_ptr< PlatformIsolateManagermgr
 

Additional Inherited Members

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

Detailed Description

Definition at line 699 of file dart_isolate_unittests.cc.

Member Function Documentation

◆ ComputePlatformResolvedLocale()

std::unique_ptr< std::vector< std::string > > flutter::testing::FakePlatformConfigurationClient::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 728 of file dart_isolate_unittests.cc.

729 {
730 return nullptr;
731 }

◆ DefaultRouteName()

std::string flutter::testing::FakePlatformConfigurationClient::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 707 of file dart_isolate_unittests.cc.

707{ return ""; }

◆ EndWarmUpFrame()

void flutter::testing::FakePlatformConfigurationClient::EndWarmUpFrame ( )
inlineoverridevirtual

Called when a warm up frame has ended.

      For more introduction, see `Animator::EndWarmUpFrame`.

Implements flutter::PlatformConfigurationClient.

Definition at line 709 of file dart_isolate_unittests.cc.

709{}

◆ GetAssetManager()

std::shared_ptr< AssetManager > flutter::testing::FakePlatformConfigurationClient::GetAssetManager ( )
inlineoverridevirtual

Returns the current collection of assets available on the platform.

Implements flutter::PlatformConfigurationClient.

Definition at line 721 of file dart_isolate_unittests.cc.

721{ return nullptr; }

◆ GetFontCollection()

FontCollection & flutter::testing::FakePlatformConfigurationClient::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 717 of file dart_isolate_unittests.cc.

717 {
719 return *(FontCollection*)(this);
720 }
#define FML_UNREACHABLE()
Definition logging.h:109

◆ GetPersistentIsolateData()

std::shared_ptr< const fml::Mapping > flutter::testing::FakePlatformConfigurationClient::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 725 of file dart_isolate_unittests.cc.

725 {
726 return nullptr;
727 }

◆ GetPlatformIsolateManager()

std::shared_ptr< PlatformIsolateManager > flutter::testing::FakePlatformConfigurationClient::GetPlatformIsolateManager ( )
inlineoverridevirtual

Implements flutter::PlatformConfigurationClient.

Definition at line 703 of file dart_isolate_unittests.cc.

703 {
704 return mgr;
705 }
std::shared_ptr< PlatformIsolateManager > mgr

◆ GetScaledFontSize()

double flutter::testing::FakePlatformConfigurationClient::GetScaledFontSize ( double  unscaled_font_size,
int  configuration_id 
) const
inlineoverridevirtual

Synchronously invokes platform-specific APIs to apply the system text scaling on the given unscaled font size.

Platforms that support this feature (currently it's only implemented for Android SDK level 34+) will send a valid configuration_id to potential callers, before this method can be called.

Parameters
[in]unscaled_font_sizeThe unscaled font size specified by the app developer. The value is in logical pixels, and is guaranteed to be finite and non-negative.
[in]configuration_idThe unique id of the configuration to use for computing the scaled font size.
Returns
The scaled font size in logical pixels, or -1 if the given configuration_id did not match a valid configuration.

Implements flutter::PlatformConfigurationClient.

Definition at line 734 of file dart_isolate_unittests.cc.

735 {
736 return 0;
737 }

◆ HandlePlatformMessage()

void flutter::testing::FakePlatformConfigurationClient::HandlePlatformMessage ( std::unique_ptr< 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 715 of file dart_isolate_unittests.cc.

716 {}

◆ Render()

void flutter::testing::FakePlatformConfigurationClient::Render ( int64_t  view_id,
Scene scene,
double  width,
double  height 
)
inlineoverridevirtual

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

Implements flutter::PlatformConfigurationClient.

Definition at line 710 of file dart_isolate_unittests.cc.

713 {}

◆ RequestDartDeferredLibrary()

void flutter::testing::FakePlatformConfigurationClient::RequestDartDeferredLibrary ( intptr_t  loading_unit_id)
inlineoverridevirtual

Invoked when the Dart VM requests that a deferred library be loaded. Notifies the engine that the deferred library identified by the specified loading unit id should be downloaded and loaded into the Dart VM via LoadDartDeferredLibrary

Upon encountering errors or otherwise failing to load a loading unit with the specified id, the failure should be directly reported to dart by calling LoadDartDeferredLibraryFailure to ensure the waiting dart future completes with an error.

Parameters
[in]loading_unit_idThe unique id of the deferred library's loading unit. This id is to be passed back into LoadDartDeferredLibrary in order to identify which deferred library to load.

Implements flutter::PlatformConfigurationClient.

Definition at line 732 of file dart_isolate_unittests.cc.

732{}

◆ ScheduleFrame()

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

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

Implements flutter::PlatformConfigurationClient.

Definition at line 708 of file dart_isolate_unittests.cc.

708{}

◆ SendChannelUpdate()

void flutter::testing::FakePlatformConfigurationClient::SendChannelUpdate ( std::string  name,
bool  listening 
)
inlineoverridevirtual

Invoked when a listener is registered on a platform channel.

Parameters
[in]nameThe name of the platform channel to which a listener has been registered or cleared.
[in]listeningWhether the listener has been set (true) or cleared (false).

Implements flutter::PlatformConfigurationClient.

Definition at line 733 of file dart_isolate_unittests.cc.

733{}

◆ SetNeedsReportTimings()

void flutter::testing::FakePlatformConfigurationClient::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 724 of file dart_isolate_unittests.cc.

724{}

◆ UpdateIsolateDescription()

void flutter::testing::FakePlatformConfigurationClient::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 722 of file dart_isolate_unittests.cc.

723 {}

◆ UpdateSemantics()

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

Receives an updated semantics tree from the Framework.

Parameters
[in]updateThe updated semantic tree to apply.

Implements flutter::PlatformConfigurationClient.

Definition at line 714 of file dart_isolate_unittests.cc.

714{}

Member Data Documentation

◆ mgr

std::shared_ptr<PlatformIsolateManager> flutter::testing::FakePlatformConfigurationClient::mgr
Initial value:
=
std::shared_ptr<PlatformIsolateManager>(new PlatformIsolateManager())

Definition at line 701 of file dart_isolate_unittests.cc.


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