Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
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 kReloadAssetFonts
 
static const std::string_view kGetPipelineUsageExtensionName
 

Detailed Description

Definition at line 21 of file service_protocol.h.

Constructor & Destructor Documentation

◆ ServiceProtocol()

flutter::ServiceProtocol::ServiceProtocol ( )

Definition at line 49 of file service_protocol.cc.

50 : endpoints_({
51 // Private
53
54 // Public
65 }) {}
static const std::string_view kGetPipelineUsageExtensionName
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 kFlushUIThreadTasksExtensionName
static constexpr std::string_view kListViewsExtensionName

References kEstimateRasterCacheMemoryExtensionName, kFlushUIThreadTasksExtensionName, kGetDisplayRefreshRateExtensionName, kGetPipelineUsageExtensionName, kGetSkSLsExtensionName, flutter::kListViewsExtensionName, kReloadAssetFonts, kRunInViewExtensionName, kScreenshotExtensionName, kScreenshotSkpExtensionName, and kSetAssetBundlePathExtensionName.

◆ ~ServiceProtocol()

flutter::ServiceProtocol::~ServiceProtocol ( )

Definition at line 67 of file service_protocol.cc.

67 {
68 ToggleHooks(false);
69}

References ToggleHooks().

Member Function Documentation

◆ AddHandler()

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

Definition at line 71 of file service_protocol.cc.

72 {
73 std::unique_lock lock(handlers_mutex_);
74 handlers_.emplace(handler, description);
75}
const gchar FlBinaryMessengerMessageHandler handler

References handler.

◆ RemoveHandler()

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

Definition at line 77 of file service_protocol.cc.

77 {
78 std::unique_lock lock(handlers_mutex_);
79 handlers_.erase(handler);
80}

References handler.

◆ SetHandlerDescription()

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

Definition at line 82 of file service_protocol.cc.

84 {
85 std::shared_lock lock(handlers_mutex_);
86 auto it = handlers_.find(handler);
87 if (it != handlers_.end()) {
88 it->second.Store(description);
89 }
90}

References handler.

◆ ToggleHooks()

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

Definition at line 92 of file service_protocol.cc.

92 {
93 for (const auto& endpoint : endpoints_) {
94 Dart_RegisterIsolateServiceRequestCallback(
95 endpoint.data(), // method
96 &ServiceProtocol::HandleMessage, // callback
97 set ? this : nullptr // user data
98 );
99 }
100}

References flutter::set.

Referenced by ~ServiceProtocol().

Member Data Documentation

◆ kEstimateRasterCacheMemoryExtensionName

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

Definition at line 30 of file service_protocol.h.

Referenced by ServiceProtocol().

◆ kFlushUIThreadTasksExtensionName

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

Definition at line 26 of file service_protocol.h.

Referenced by ServiceProtocol().

◆ kGetDisplayRefreshRateExtensionName

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

Definition at line 28 of file service_protocol.h.

Referenced by ServiceProtocol().

◆ kGetPipelineUsageExtensionName

const std::string_view flutter::ServiceProtocol::kGetPipelineUsageExtensionName
static
Initial value:
=
"_flutter.getPipelineUsage"

Definition at line 32 of file service_protocol.h.

Referenced by ServiceProtocol().

◆ kGetSkSLsExtensionName

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

Definition at line 29 of file service_protocol.h.

Referenced by ServiceProtocol().

◆ kReloadAssetFonts

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

Definition at line 31 of file service_protocol.h.

Referenced by ServiceProtocol().

◆ kRunInViewExtensionName

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

Definition at line 25 of file service_protocol.h.

Referenced by ServiceProtocol().

◆ kScreenshotExtensionName

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

Definition at line 23 of file service_protocol.h.

Referenced by ServiceProtocol().

◆ kScreenshotSkpExtensionName

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

Definition at line 24 of file service_protocol.h.

Referenced by ServiceProtocol().

◆ kSetAssetBundlePathExtensionName

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

Definition at line 27 of file service_protocol.h.

Referenced by ServiceProtocol().


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