Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
cdf869bc
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,发现更多精彩内容 >>
未验证
提交
cdf869bc
编写于
1月 10, 2018
作者:
A
Alexander Aprelev
提交者:
GitHub
1月 10, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
When running on iOS deduce bundle path during engine initialization. (#4532)
上级
6dd2666f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
7 deletion
+20
-7
shell/platform/darwin/common/platform_mac.h
shell/platform/darwin/common/platform_mac.h
+2
-1
shell/platform/darwin/common/platform_mac.mm
shell/platform/darwin/common/platform_mac.mm
+10
-4
shell/platform/darwin/desktop/main_mac.mm
shell/platform/darwin/desktop/main_mac.mm
+1
-1
shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm
.../platform/darwin/ios/framework/Source/flutter_main_ios.mm
+7
-1
未找到文件。
shell/platform/darwin/common/platform_mac.h
浏览文件 @
cdf869bc
...
...
@@ -10,7 +10,8 @@
namespace
shell
{
void
PlatformMacMain
(
std
::
string
icu_data_path
,
std
::
string
application_library_path
);
std
::
string
application_library_path
,
std
::
string
bundle_path
);
bool
AttemptLaunchFromCommandLineSwitches
(
Engine
*
engine
);
...
...
shell/platform/darwin/common/platform_mac.mm
浏览文件 @
cdf869bc
...
...
@@ -31,7 +31,9 @@ static fxl::CommandLine InitializedCommandLine() {
class
EmbedderState
{
public:
EmbedderState
(
std
::
string
icu_data_path
,
std
::
string
application_library_path
)
{
EmbedderState
(
std
::
string
icu_data_path
,
std
::
string
application_library_path
,
std
::
string
bundle_path
)
{
#if TARGET_OS_IPHONE
// This calls crashes on MacOS because we haven't run Dart_Initialize yet.
// See https://github.com/flutter/flutter/issues/4006
...
...
@@ -46,7 +48,8 @@ class EmbedderState {
// marker that can be used as a reference for startup.
TRACE_EVENT_INSTANT0
(
"flutter"
,
"main"
);
shell
::
Shell
::
InitStandalone
(
std
::
move
(
command_line
),
icu_data_path
,
application_library_path
);
shell
::
Shell
::
InitStandalone
(
std
::
move
(
command_line
),
icu_data_path
,
application_library_path
,
bundle_path
);
}
~
EmbedderState
()
{}
...
...
@@ -55,12 +58,15 @@ class EmbedderState {
FXL_DISALLOW_COPY_AND_ASSIGN
(
EmbedderState
);
};
void
PlatformMacMain
(
std
::
string
icu_data_path
,
std
::
string
application_library_path
)
{
void
PlatformMacMain
(
std
::
string
icu_data_path
,
std
::
string
application_library_path
,
std
::
string
bundle_path
)
{
static
std
::
unique_ptr
<
EmbedderState
>
g_embedder
;
static
std
::
once_flag
once_main
;
std
::
call_once
(
once_main
,
[
&
]()
{
g_embedder
=
WTF
::
MakeUnique
<
EmbedderState
>
(
icu_data_path
,
application_library_path
);
g_embedder
=
WTF
::
MakeUnique
<
EmbedderState
>
(
icu_data_path
,
application_library_path
,
bundle_path
);
});
}
...
...
shell/platform/darwin/desktop/main_mac.mm
浏览文件 @
cdf869bc
...
...
@@ -16,7 +16,7 @@
int
main
(
int
argc
,
const
char
*
argv
[])
{
[
FlutterApplication
sharedApplication
];
shell
::
PlatformMacMain
(
""
,
""
);
shell
::
PlatformMacMain
(
""
,
""
,
""
);
const
auto
&
command_line
=
shell
::
Shell
::
Shared
().
GetCommandLine
();
...
...
shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm
浏览文件 @
cdf869bc
...
...
@@ -12,7 +12,13 @@ void FlutterMain() {
NSBundle
*
bundle
=
[
NSBundle
bundleForClass
:[
FlutterViewController
class
]];
NSString
*
icuDataPath
=
[
bundle
pathForResource
:
@"icudtl"
ofType
:
@"dat"
];
NSString
*
libraryName
=
[[
NSBundle
mainBundle
]
objectForInfoDictionaryKey
:
@"FLTLibraryPath"
];
shell
::
PlatformMacMain
(
icuDataPath
.
UTF8String
,
libraryName
!=
nil
?
libraryName
.
UTF8String
:
""
);
NSBundle
*
mainBundle
=
[
NSBundle
mainBundle
];
NSString
*
flutterAssetsPath
=
[
mainBundle
pathForResource
:
@"flutter_assets"
ofType
:
nil
];
shell
::
PlatformMacMain
(
icuDataPath
.
UTF8String
,
libraryName
!=
nil
?
libraryName
.
UTF8String
:
""
,
flutterAssetsPath
.
UTF8String
);
}
}
// namespace shell
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录