Flutter Engine
FlutterChannels.mm File Reference
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterChannels.h"

Go to the source code of this file.

Functions

static void ResizeChannelBuffer (NSObject< FlutterBinaryMessenger > *binaryMessenger, NSString *channel, NSInteger newSize)
 
static FlutterBinaryMessengerConnection SetMessageHandler (NSObject< FlutterBinaryMessenger > *messenger, NSString *name, FlutterBinaryMessageHandler handler, NSObject< FlutterTaskQueue > *taskQueue)
 

Variables

static NSString *const FlutterChannelBuffersChannel = @"@"dev.flutter/channel-buffers"
 
NSString * _name
 
NSObject< FlutterMessageCodec > * _codec
 
FlutterBinaryMessengerConnection _connection
 
NSObject< FlutterTaskQueue > * _taskQueue
 
NSObject const * FlutterMethodNotImplemented = [[NSObject alloc] init]
 
NSObject const * FlutterEndOfEventStream = [[NSObject alloc] init]
 

Function Documentation

◆ ResizeChannelBuffer()

static void ResizeChannelBuffer ( NSObject< FlutterBinaryMessenger > *  binaryMessenger,
NSString *  channel,
NSInteger  newSize 
)
static

Definition at line 11 of file FlutterChannels.mm.

References FlutterChannelBuffersChannel.

Referenced by FlutterBasicMessageChannel::resizeChannelBuffer:, and FlutterMethodChannel::resizeChannelBuffer:.

13  {
14  NSString* messageString = [NSString stringWithFormat:@"resize\r%@\r%@", channel, @(newSize)];
15  NSData* message = [messageString dataUsingEncoding:NSUTF8StringEncoding];
16  [binaryMessenger sendOnChannel:FlutterChannelBuffersChannel message:message];
17 }
static NSString *const FlutterChannelBuffersChannel

◆ SetMessageHandler()

static FlutterBinaryMessengerConnection SetMessageHandler ( NSObject< FlutterBinaryMessenger > *  messenger,
NSString *  name,
FlutterBinaryMessageHandler  handler,
NSObject< FlutterTaskQueue > *  taskQueue 
)
static

Definition at line 19 of file FlutterChannels.mm.

Referenced by FlutterBasicMessageChannel::initWithName:binaryMessenger:codec:, FlutterMethodChannel::initWithName:binaryMessenger:codec:, and FlutterEventChannel::initWithName:binaryMessenger:codec:taskQueue:.

23  {
24  if (taskQueue) {
25  NSCAssert([messenger respondsToSelector:@selector(setMessageHandlerOnChannel:
26  binaryMessageHandler:taskQueue:)],
27  @"");
28  return [messenger setMessageHandlerOnChannel:name
29  binaryMessageHandler:handler
30  taskQueue:taskQueue];
31  } else {
32  return [messenger setMessageHandlerOnChannel:name binaryMessageHandler:handler];
33  }
34 }
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

Variable Documentation

◆ _codec

◆ _connection

◆ _name

◆ _taskQueue

◆ FlutterChannelBuffersChannel

NSString* const FlutterChannelBuffersChannel = @"@"dev.flutter/channel-buffers"
static

Definition at line 9 of file FlutterChannels.mm.

Referenced by ResizeChannelBuffer().

◆ FlutterEndOfEventStream

NSObject const* FlutterEndOfEventStream = [[NSObject alloc] init]

A constant used with FlutterEventChannel to indicate end of stream.

Definition at line 312 of file FlutterChannels.mm.

Referenced by FlutterEventChannel::initWithName:binaryMessenger:codec:taskQueue:.

◆ FlutterMethodNotImplemented