Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
1b4d958f
E
engine
项目概览
weixin_43355755
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
未验证
提交
1b4d958f
编写于
6月 03, 2020
作者:
R
Robert Ancell
提交者:
GitHub
6月 03, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add braces around multi-line branches to match code style (#18719)
上级
6589dcb2
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
42 addition
and
25 deletion
+42
-25
shell/platform/linux/fl_basic_message_channel.cc
shell/platform/linux/fl_basic_message_channel.cc
+2
-1
shell/platform/linux/fl_binary_messenger.cc
shell/platform/linux/fl_binary_messenger.cc
+2
-2
shell/platform/linux/fl_dart_project.cc
shell/platform/linux/fl_dart_project.cc
+2
-1
shell/platform/linux/fl_engine.cc
shell/platform/linux/fl_engine.cc
+8
-4
shell/platform/linux/fl_json_message_codec.cc
shell/platform/linux/fl_json_message_codec.cc
+2
-1
shell/platform/linux/fl_json_method_codec_test.cc
shell/platform/linux/fl_json_method_codec_test.cc
+6
-4
shell/platform/linux/fl_key_event_plugin.cc
shell/platform/linux/fl_key_event_plugin.cc
+2
-1
shell/platform/linux/fl_method_channel.cc
shell/platform/linux/fl_method_channel.cc
+2
-1
shell/platform/linux/fl_method_codec_test.cc
shell/platform/linux/fl_method_codec_test.cc
+6
-4
shell/platform/linux/fl_method_response.cc
shell/platform/linux/fl_method_response.cc
+2
-1
shell/platform/linux/fl_standard_method_codec_test.cc
shell/platform/linux/fl_standard_method_codec_test.cc
+6
-4
shell/platform/linux/fl_view.cc
shell/platform/linux/fl_view.cc
+2
-1
未找到文件。
shell/platform/linux/fl_basic_message_channel.cc
浏览文件 @
1b4d958f
...
...
@@ -127,9 +127,10 @@ static void channel_closed_cb(gpointer user_data) {
static
void
fl_basic_message_channel_dispose
(
GObject
*
object
)
{
FlBasicMessageChannel
*
self
=
FL_BASIC_MESSAGE_CHANNEL
(
object
);
if
(
self
->
messenger
!=
nullptr
)
if
(
self
->
messenger
!=
nullptr
)
{
fl_binary_messenger_set_message_handler_on_channel
(
self
->
messenger
,
self
->
name
,
nullptr
,
nullptr
,
nullptr
);
}
g_clear_object
(
&
self
->
messenger
);
g_clear_pointer
(
&
self
->
name
,
g_free
);
...
...
shell/platform/linux/fl_binary_messenger.cc
浏览文件 @
1b4d958f
...
...
@@ -185,11 +185,11 @@ G_MODULE_EXPORT void fl_binary_messenger_set_message_handler_on_channel(
return
;
}
if
(
handler
!=
nullptr
)
if
(
handler
!=
nullptr
)
{
g_hash_table_replace
(
self
->
platform_message_handlers
,
g_strdup
(
channel
),
platform_message_handler_new
(
handler
,
user_data
,
destroy_notify
));
else
}
else
g_hash_table_remove
(
self
->
platform_message_handlers
,
channel
);
}
...
...
shell/platform/linux/fl_dart_project.cc
浏览文件 @
1b4d958f
...
...
@@ -24,9 +24,10 @@ static void fl_dart_project_set_path(FlDartProject* self, const gchar* path) {
else
{
g_autoptr
(
GError
)
error
=
nullptr
;
g_autofree
gchar
*
exe_path
=
g_file_read_link
(
"/proc/self/exe"
,
&
error
);
if
(
exe_path
==
nullptr
)
if
(
exe_path
==
nullptr
)
{
g_critical
(
"Failed to determine location of executable: %s"
,
error
->
message
);
}
g_autofree
gchar
*
dir
=
g_path_get_dirname
(
exe_path
);
self
->
path
=
g_build_filename
(
dir
,
path
,
nullptr
);
}
...
...
shell/platform/linux/fl_engine.cc
浏览文件 @
1b4d958f
...
...
@@ -143,9 +143,10 @@ static void fl_engine_platform_message_cb(const FlutterPlatformMessage* message,
self
->
platform_message_handler_data
);
}
if
(
!
handled
)
if
(
!
handled
)
{
fl_engine_send_platform_message_response
(
self
,
message
->
response_handle
,
nullptr
,
nullptr
);
}
}
// Called when a response to a sent platform message is received from the
...
...
@@ -167,9 +168,10 @@ static void fl_engine_dispose(GObject* object) {
g_clear_object
(
&
self
->
renderer
);
g_clear_object
(
&
self
->
binary_messenger
);
if
(
self
->
platform_message_handler_destroy_notify
)
if
(
self
->
platform_message_handler_destroy_notify
)
{
self
->
platform_message_handler_destroy_notify
(
self
->
platform_message_handler_data
);
}
self
->
platform_message_handler_data
=
nullptr
;
self
->
platform_message_handler_destroy_notify
=
nullptr
;
...
...
@@ -257,9 +259,10 @@ void fl_engine_set_platform_message_handler(
g_return_if_fail
(
FL_IS_ENGINE
(
self
));
g_return_if_fail
(
handler
!=
nullptr
);
if
(
self
->
platform_message_handler_destroy_notify
)
if
(
self
->
platform_message_handler_destroy_notify
)
{
self
->
platform_message_handler_destroy_notify
(
self
->
platform_message_handler_data
);
}
self
->
platform_message_handler
=
handler
;
self
->
platform_message_handler_data
=
user_data
;
...
...
@@ -276,9 +279,10 @@ gboolean fl_engine_send_platform_message_response(
gsize
data_length
=
0
;
const
uint8_t
*
data
=
nullptr
;
if
(
response
!=
nullptr
)
if
(
response
!=
nullptr
)
{
data
=
static_cast
<
const
uint8_t
*>
(
g_bytes_get_data
(
response
,
&
data_length
));
}
FlutterEngineResult
result
=
FlutterEngineSendPlatformMessageResponse
(
self
->
engine
,
handle
,
data
,
data_length
);
...
...
shell/platform/linux/fl_json_message_codec.cc
浏览文件 @
1b4d958f
...
...
@@ -259,10 +259,11 @@ static FlValue* fl_json_message_codec_decode_message(FlMessageCodec* codec,
if
(
handler
.
error
!=
nullptr
)
{
g_propagate_error
(
error
,
handler
.
error
);
handler
.
error
=
nullptr
;
}
else
}
else
{
g_set_error
(
error
,
FL_JSON_MESSAGE_CODEC_ERROR
,
FL_JSON_MESSAGE_CODEC_ERROR_INVALID_JSON
,
"Message is not valid JSON"
);
}
return
nullptr
;
}
...
...
shell/platform/linux/fl_json_method_codec_test.cc
浏览文件 @
1b4d958f
...
...
@@ -119,22 +119,24 @@ static void decode_response_with_error(const char* text,
EXPECT_STREQ
(
fl_method_error_response_get_code
(
FL_METHOD_ERROR_RESPONSE
(
response
)),
code
);
if
(
error_message
==
nullptr
)
if
(
error_message
==
nullptr
)
{
EXPECT_EQ
(
fl_method_error_response_get_message
(
FL_METHOD_ERROR_RESPONSE
(
response
)),
nullptr
);
else
}
else
{
EXPECT_STREQ
(
fl_method_error_response_get_message
(
FL_METHOD_ERROR_RESPONSE
(
response
)),
error_message
);
if
(
details
==
nullptr
)
}
if
(
details
==
nullptr
)
{
EXPECT_EQ
(
fl_method_error_response_get_details
(
FL_METHOD_ERROR_RESPONSE
(
response
)),
nullptr
);
else
}
else
{
EXPECT_TRUE
(
fl_value_equal
(
fl_method_error_response_get_details
(
FL_METHOD_ERROR_RESPONSE
(
response
)),
details
));
}
}
// Decode a response using JsonMethodCodec. Expect the given error.
...
...
shell/platform/linux/fl_key_event_plugin.cc
浏览文件 @
1b4d958f
...
...
@@ -246,9 +246,10 @@ void fl_key_event_plugin_send_key_event(FlKeyEventPlugin* self,
fl_value_new_string
(
kGLFWToolkit
));
fl_value_set_string_take
(
message
,
kKeyCodeKey
,
fl_value_new_int
(
key_code
));
fl_value_set_string_take
(
message
,
kModifiersKey
,
fl_value_new_int
(
modifiers
));
if
(
unicodeScalarValues
!=
0
)
if
(
unicodeScalarValues
!=
0
)
{
fl_value_set_string_take
(
message
,
kUnicodeScalarValuesKey
,
fl_value_new_int
(
unicodeScalarValues
));
}
fl_basic_message_channel_send
(
self
->
channel
,
message
,
nullptr
,
nullptr
,
nullptr
);
...
...
shell/platform/linux/fl_method_channel.cc
浏览文件 @
1b4d958f
...
...
@@ -86,9 +86,10 @@ static void channel_closed_cb(gpointer user_data) {
static
void
fl_method_channel_dispose
(
GObject
*
object
)
{
FlMethodChannel
*
self
=
FL_METHOD_CHANNEL
(
object
);
if
(
self
->
messenger
!=
nullptr
)
if
(
self
->
messenger
!=
nullptr
)
{
fl_binary_messenger_set_message_handler_on_channel
(
self
->
messenger
,
self
->
name
,
nullptr
,
nullptr
,
nullptr
);
}
g_clear_object
(
&
self
->
messenger
);
g_clear_pointer
(
&
self
->
name
,
g_free
);
...
...
shell/platform/linux/fl_method_codec_test.cc
浏览文件 @
1b4d958f
...
...
@@ -46,10 +46,10 @@ static GBytes* fl_test_codec_encode_method_call(FlMethodCodec* codec,
g_autofree
gchar
*
text
=
nullptr
;
if
(
args
==
nullptr
||
fl_value_get_type
(
args
)
==
FL_VALUE_TYPE_NULL
)
text
=
g_strdup_printf
(
"%s()"
,
name
);
else
if
(
fl_value_get_type
(
args
)
==
FL_VALUE_TYPE_INT
)
else
if
(
fl_value_get_type
(
args
)
==
FL_VALUE_TYPE_INT
)
{
text
=
g_strdup_printf
(
"%s(%"
G_GINT64_FORMAT
")"
,
name
,
fl_value_get_int
(
args
));
else
{
}
else
{
g_set_error
(
error
,
FL_MESSAGE_CODEC_ERROR
,
FL_MESSAGE_CODEC_ERROR_FAILED
,
"ERROR"
);
return
nullptr
;
...
...
@@ -117,15 +117,17 @@ static GBytes* fl_test_codec_encode_error_envelope(FlMethodCodec* codec,
if
(
message
==
nullptr
)
{
if
(
details
==
nullptr
||
fl_value_get_type
(
details
)
==
FL_VALUE_TYPE_NULL
)
text
=
g_strdup_printf
(
"Error_%s()"
,
code
);
else
else
{
text
=
g_strdup_printf
(
"Error_%s(%"
G_GINT64_FORMAT
")"
,
code
,
fl_value_get_int
(
details
));
}
}
else
{
if
(
details
==
nullptr
||
fl_value_get_type
(
details
)
==
FL_VALUE_TYPE_NULL
)
text
=
g_strdup_printf
(
"Error_%s(%s)"
,
code
,
message
);
else
else
{
text
=
g_strdup_printf
(
"Error_%s(%s,%"
G_GINT64_FORMAT
")"
,
code
,
message
,
fl_value_get_int
(
details
));
}
}
return
text_to_message
(
text
);
...
...
shell/platform/linux/fl_method_response.cc
浏览文件 @
1b4d958f
...
...
@@ -81,9 +81,10 @@ static void fl_method_not_implemented_response_init(
G_MODULE_EXPORT
FlValue
*
fl_method_response_get_result
(
FlMethodResponse
*
self
,
GError
**
error
)
{
if
(
FL_IS_METHOD_SUCCESS_RESPONSE
(
self
))
if
(
FL_IS_METHOD_SUCCESS_RESPONSE
(
self
))
{
return
fl_method_success_response_get_result
(
FL_METHOD_SUCCESS_RESPONSE
(
self
));
}
if
(
FL_IS_METHOD_ERROR_RESPONSE
(
self
))
{
const
gchar
*
code
=
...
...
shell/platform/linux/fl_standard_method_codec_test.cc
浏览文件 @
1b4d958f
...
...
@@ -114,22 +114,24 @@ static void decode_response_with_error(const char* hex_string,
EXPECT_STREQ
(
fl_method_error_response_get_code
(
FL_METHOD_ERROR_RESPONSE
(
response
)),
code
);
if
(
error_message
==
nullptr
)
if
(
error_message
==
nullptr
)
{
EXPECT_EQ
(
fl_method_error_response_get_message
(
FL_METHOD_ERROR_RESPONSE
(
response
)),
nullptr
);
else
}
else
{
EXPECT_STREQ
(
fl_method_error_response_get_message
(
FL_METHOD_ERROR_RESPONSE
(
response
)),
error_message
);
if
(
details
==
nullptr
)
}
if
(
details
==
nullptr
)
{
EXPECT_EQ
(
fl_method_error_response_get_details
(
FL_METHOD_ERROR_RESPONSE
(
response
)),
nullptr
);
else
}
else
{
EXPECT_TRUE
(
fl_value_equal
(
fl_method_error_response_get_details
(
FL_METHOD_ERROR_RESPONSE
(
response
)),
details
));
}
}
static
void
decode_error_response
(
const
char
*
hex_string
,
...
...
shell/platform/linux/fl_view.cc
浏览文件 @
1b4d958f
...
...
@@ -209,10 +209,11 @@ static void fl_view_size_allocate(GtkWidget* widget,
gtk_widget_set_allocation
(
widget
,
allocation
);
if
(
gtk_widget_get_realized
(
widget
)
&&
gtk_widget_get_has_window
(
widget
))
if
(
gtk_widget_get_realized
(
widget
)
&&
gtk_widget_get_has_window
(
widget
))
{
gdk_window_move_resize
(
gtk_widget_get_window
(
widget
),
allocation
->
x
,
allocation
->
y
,
allocation
->
width
,
allocation
->
height
);
}
// TODO(robert-ancell): This pixel ratio won't work on hidpi displays.
fl_engine_send_window_metrics_event
(
self
->
engine
,
allocation
->
width
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录