5#ifndef FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_
6#define FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_
10#include <shared_mutex>
17#include "rapidjson/document.h"
41 Description(int64_t p_isolate_port, std::string p_isolate_name)
46 rapidjson::Value& value,
47 rapidjson::MemoryPoolAllocator<>& allocator)
const;
53 std::string_view method)
const = 0;
58 std::string_view method,
60 rapidjson::Document* response) = 0;
77 const std::set<std::string_view> endpoints_;
78 mutable std::shared_mutex handlers_mutex_;
79 std::map<Handler*, fml::AtomicObject<Handler::Description>> handlers_;
81 [[nodiscard]]
static bool HandleMessage(
const char* method,
82 const char** param_keys,
83 const char** param_values,
86 const char** json_object);
87 [[nodiscard]]
static bool HandleMessage(
88 std::string_view method,
91 rapidjson::Document* response);
92 [[nodiscard]]
bool HandleMessage(std::string_view method,
94 rapidjson::Document* response)
const;
96 [[nodiscard]]
bool HandleListViewsMethod(rapidjson::Document* response)
const;
virtual bool HandleServiceProtocolMessage(std::string_view method, const ServiceProtocolMap ¶ms, rapidjson::Document *response)=0
std::map< std::string_view, std::string_view > ServiceProtocolMap
virtual fml::RefPtr< fml::TaskRunner > GetServiceProtocolHandlerTaskRunner(std::string_view method) const =0
virtual Description GetServiceProtocolDescription() const =0
void AddHandler(Handler *handler, const Handler::Description &description)
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
void RemoveHandler(Handler *handler)
void SetHandlerDescription(Handler *handler, const Handler::Description &description)
static const std::string_view kFlushUIThreadTasksExtensionName
void ToggleHooks(bool set)
const EmbeddedViewParams * params
const gchar FlBinaryMessengerMessageHandler handler
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Description(int64_t p_isolate_port, std::string p_isolate_name)