Flutter Engine
platform_message_router.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_ROUTER_H_
6 #define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_ROUTER_H_
7 
8 #include <unordered_map>
9 
10 #include "flutter/fml/memory/weak_ptr.h"
11 #include "flutter/fml/platform/darwin/scoped_block.h"
12 #include "flutter/lib/ui/window/platform_message.h"
13 #import "flutter/shell/platform/darwin/common/framework/Headers/FlutterBinaryMessenger.h"
14 
15 namespace flutter {
16 
18  public:
21 
24 
25  void SetMessageHandler(const std::string& channel,
27 
28  private:
29  std::unordered_map<std::string, fml::ScopedBlock<FlutterBinaryMessageHandler>>
30  message_handlers_;
31 
32  FML_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter);
33 };
34 
35 } // namespace flutter
36 
37 #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_ACCESSIBILITY_BRIDGE_H_
void HandlePlatformMessage(fml::RefPtr< flutter::PlatformMessage > message) const
void(^ FlutterBinaryMessageHandler)(NSData *_Nullable message, FlutterBinaryReply reply)
void SetMessageHandler(const std::string &channel, FlutterBinaryMessageHandler handler)