Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Attributes | List of all members
flutter::ServiceProtocol Class Reference

#include <service_protocol.h>

Classes

class  Handler
 

Public Member Functions

 ServiceProtocol ()
 
 ~ServiceProtocol ()
 
void ToggleHooks (bool set)
 
void AddHandler (Handler *handler, const Handler::Description &description)
 
void RemoveHandler (Handler *handler)
 
void SetHandlerDescription (Handler *handler, const Handler::Description &description)
 

Static Public Attributes

static const std::string_view kScreenshotExtensionName
 
static const std::string_view kScreenshotSkpExtensionName
 
static const std::string_view kRunInViewExtensionName
 
static const std::string_view kFlushUIThreadTasksExtensionName
 
static const std::string_view kSetAssetBundlePathExtensionName
 
static const std::string_view kGetDisplayRefreshRateExtensionName
 
static const std::string_view kGetSkSLsExtensionName
 
static const std::string_view kEstimateRasterCacheMemoryExtensionName
 
static const std::string_view kRenderFrameWithRasterStatsExtensionName
 
static const std::string_view kReloadAssetFonts
 

Detailed Description

Definition at line 22 of file service_protocol.h.

Constructor & Destructor Documentation

◆ ServiceProtocol()

flutter::ServiceProtocol::ServiceProtocol ( )

Definition at line 50 of file service_protocol.cc.

51 : endpoints_({
52 // Private
54
55 // Public
66 }),
67 handlers_mutex_(fml::SharedMutex::Create()) {}
static const std::string_view kSetAssetBundlePathExtensionName
static const std::string_view kReloadAssetFonts
static const std::string_view kScreenshotSkpExtensionName
static const std::string_view kScreenshotExtensionName
static const std::string_view kGetDisplayRefreshRateExtensionName
static const std::string_view kRunInViewExtensionName
static const std::string_view kEstimateRasterCacheMemoryExtensionName
static const std::string_view kGetSkSLsExtensionName
static const std::string_view kRenderFrameWithRasterStatsExtensionName
static const std::string_view kFlushUIThreadTasksExtensionName
static SharedMutex * Create()
static constexpr std::string_view kListViewsExtensionName

◆ ~ServiceProtocol()

flutter::ServiceProtocol::~ServiceProtocol ( )

Definition at line 69 of file service_protocol.cc.

69 {
70 ToggleHooks(false);
71}

Member Function Documentation

◆ AddHandler()

void flutter::ServiceProtocol::AddHandler ( Handler handler,
const Handler::Description description 
)

Definition at line 73 of file service_protocol.cc.

74 {
75 fml::UniqueLock lock(*handlers_mutex_);
76 handlers_.emplace(handler, description);
77}

◆ RemoveHandler()

void flutter::ServiceProtocol::RemoveHandler ( Handler handler)

Definition at line 79 of file service_protocol.cc.

79 {
80 fml::UniqueLock lock(*handlers_mutex_);
81 handlers_.erase(handler);
82}

◆ SetHandlerDescription()

void flutter::ServiceProtocol::SetHandlerDescription ( Handler handler,
const Handler::Description description 
)

Definition at line 84 of file service_protocol.cc.

86 {
87 fml::SharedLock lock(*handlers_mutex_);
88 auto it = handlers_.find(handler);
89 if (it != handlers_.end()) {
90 it->second.Store(description);
91 }
92}

◆ ToggleHooks()

void flutter::ServiceProtocol::ToggleHooks ( bool  set)

Definition at line 94 of file service_protocol.cc.

94 {
95 for (const auto& endpoint : endpoints_) {
97 endpoint.data(), // method
98 &ServiceProtocol::HandleMessage, // callback
99 set ? this : nullptr // user data
100 );
101 }
102}
DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback(const char *method, Dart_ServiceRequestCallback callback, void *user_data)
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 to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
Definition: switches.h:76

Member Data Documentation

◆ kEstimateRasterCacheMemoryExtensionName

const std::string_view flutter::ServiceProtocol::kEstimateRasterCacheMemoryExtensionName
static
Initial value:
=
"_flutter.estimateRasterCacheMemory"

Definition at line 31 of file service_protocol.h.

◆ kFlushUIThreadTasksExtensionName

const std::string_view flutter::ServiceProtocol::kFlushUIThreadTasksExtensionName
static
Initial value:
=
"_flutter.flushUIThreadTasks"

Definition at line 27 of file service_protocol.h.

◆ kGetDisplayRefreshRateExtensionName

const std::string_view flutter::ServiceProtocol::kGetDisplayRefreshRateExtensionName
static
Initial value:
=
"_flutter.getDisplayRefreshRate"

Definition at line 29 of file service_protocol.h.

◆ kGetSkSLsExtensionName

const std::string_view flutter::ServiceProtocol::kGetSkSLsExtensionName
static
Initial value:
=
"_flutter.getSkSLs"

Definition at line 30 of file service_protocol.h.

◆ kReloadAssetFonts

const std::string_view flutter::ServiceProtocol::kReloadAssetFonts
static
Initial value:
=
"_flutter.reloadAssetFonts"

Definition at line 33 of file service_protocol.h.

◆ kRenderFrameWithRasterStatsExtensionName

const std::string_view flutter::ServiceProtocol::kRenderFrameWithRasterStatsExtensionName
static
Initial value:
=
"_flutter.renderFrameWithRasterStats"

Definition at line 32 of file service_protocol.h.

◆ kRunInViewExtensionName

const std::string_view flutter::ServiceProtocol::kRunInViewExtensionName
static
Initial value:
=
"_flutter.runInView"

Definition at line 26 of file service_protocol.h.

◆ kScreenshotExtensionName

const std::string_view flutter::ServiceProtocol::kScreenshotExtensionName
static
Initial value:
=
"_flutter.screenshot"

Definition at line 24 of file service_protocol.h.

◆ kScreenshotSkpExtensionName

const std::string_view flutter::ServiceProtocol::kScreenshotSkpExtensionName
static
Initial value:
=
"_flutter.screenshotSkp"

Definition at line 25 of file service_protocol.h.

◆ kSetAssetBundlePathExtensionName

const std::string_view flutter::ServiceProtocol::kSetAssetBundlePathExtensionName
static
Initial value:
=
"_flutter.setAssetBundlePath"

Definition at line 28 of file service_protocol.h.


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