Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
ef26c460
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ef26c460
编写于
9月 04, 2019
作者:
F
Francisco Magdaleno
提交者:
GitHub
9月 04, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Finish plumbing message responses on method channels (#11877)
上级
48dd7b93
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
10 deletion
+13
-10
shell/platform/common/cpp/client_wrapper/include/flutter/method_channel.h
...ommon/cpp/client_wrapper/include/flutter/method_channel.h
+10
-3
shell/platform/common/cpp/client_wrapper/plugin_registrar.cc
shell/platform/common/cpp/client_wrapper/plugin_registrar.cc
+2
-2
shell/platform/darwin/common/framework/Headers/FlutterChannels.h
...latform/darwin/common/framework/Headers/FlutterChannels.h
+1
-5
未找到文件。
shell/platform/common/cpp/client_wrapper/include/flutter/method_channel.h
浏览文件 @
ef26c460
...
...
@@ -48,11 +48,18 @@ class MethodChannel {
MethodCall
<
T
>
method_call
(
method
,
std
::
move
(
arguments
));
std
::
unique_ptr
<
std
::
vector
<
uint8_t
>>
message
=
codec_
->
EncodeMethodCall
(
method_call
);
messenger_
->
Send
(
name_
,
message
->
data
(),
message
->
size
());
messenger_
->
Send
(
name_
,
message
->
data
(),
message
->
size
()
,
nullptr
);
}
// TODO: Add support for a version of InvokeMethod expecting a reply once
// https://github.com/flutter/flutter/issues/18852 is fixed.
// Sends a message to the Flutter engine on this channel expecting a reply.
void
InvokeMethod
(
const
std
::
string
&
method
,
std
::
unique_ptr
<
T
>
arguments
,
flutter
::
BinaryReply
reply
)
{
MethodCall
<
T
>
method_call
(
method
,
std
::
move
(
arguments
));
std
::
unique_ptr
<
std
::
vector
<
uint8_t
>>
message
=
codec_
->
EncodeMethodCall
(
method_call
);
messenger_
->
Send
(
name_
,
message
->
data
(),
message
->
size
(),
reply
);
}
// Registers a handler that should be called any time a method call is
// received on this channel.
...
...
shell/platform/common/cpp/client_wrapper/plugin_registrar.cc
浏览文件 @
ef26c460
...
...
@@ -98,8 +98,8 @@ void BinaryMessengerImpl::Send(const std::string& channel,
const
size_t
message_size
,
BinaryReply
reply
)
const
{
if
(
reply
==
nullptr
)
{
std
::
cerr
<<
"Calling BinaryMessengerImpl::Send expecting a reply, but the "
"callback is null.
\n
"
;
FlutterDesktopMessengerSend
(
messenger_
,
channel
.
c_str
(),
message
,
message_size
)
;
return
;
}
struct
Captures
{
...
...
shell/platform/darwin/common/framework/Headers/FlutterChannels.h
浏览文件 @
ef26c460
...
...
@@ -234,11 +234,7 @@ FLUTTER_EXPORT
*/
-
(
void
)
invokeMethod
:(
NSString
*
)
method
arguments
:(
id
_Nullable
)
arguments
result
:(
FlutterResult
_Nullable
)
callback
// TODO: Add macOS support for replies once
// https://github.com/flutter/flutter/issues/18852 is fixed.
API_UNAVAILABLE
(
macos
);
result
:(
FlutterResult
_Nullable
)
callback
;
/**
* Registers a handler for method calls from the Flutter side.
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录