Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
d119d62c
E
engine
项目概览
qq_34031325
/
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,发现更多精彩内容 >>
提交
d119d62c
编写于
3月 23, 2017
作者:
C
Chinmay Garde
提交者:
GitHub
3月 23, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add fml::paths::GetExecutableDirectoryPath. (#3508)
上级
ae9ad396
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
98 addition
and
1 deletion
+98
-1
fml/BUILD.gn
fml/BUILD.gn
+4
-0
fml/icu_util.cc
fml/icu_util.cc
+11
-1
fml/paths.h
fml/paths.h
+19
-0
fml/platform/android/paths_android.cc
fml/platform/android/paths_android.cc
+15
-0
fml/platform/darwin/paths_darwin.mm
fml/platform/darwin/paths_darwin.mm
+20
-0
fml/platform/linux/paths_linux.cc
fml/platform/linux/paths_linux.cc
+25
-0
travis/licenses_golden/licenses_flutter
travis/licenses_golden/licenses_flutter
+4
-0
未找到文件。
fml/BUILD.gn
浏览文件 @
d119d62c
...
@@ -12,6 +12,7 @@ source_set("fml") {
...
@@ -12,6 +12,7 @@ source_set("fml") {
"message_loop.h",
"message_loop.h",
"message_loop_impl.cc",
"message_loop_impl.cc",
"message_loop_impl.h",
"message_loop_impl.h",
"paths.h",
"task_runner.cc",
"task_runner.cc",
"task_runner.h",
"task_runner.h",
"thread.cc",
"thread.cc",
...
@@ -43,6 +44,7 @@ source_set("fml") {
...
@@ -43,6 +44,7 @@ source_set("fml") {
"platform/darwin/message_loop_darwin.mm",
"platform/darwin/message_loop_darwin.mm",
"platform/darwin/nsstring_utils.h",
"platform/darwin/nsstring_utils.h",
"platform/darwin/nsstring_utils.mm",
"platform/darwin/nsstring_utils.mm",
"platform/darwin/paths_darwin.mm",
"platform/darwin/resource_mapping_darwin.h",
"platform/darwin/resource_mapping_darwin.h",
"platform/darwin/resource_mapping_darwin.mm",
"platform/darwin/resource_mapping_darwin.mm",
"platform/darwin/scoped_block.h",
"platform/darwin/scoped_block.h",
...
@@ -62,6 +64,7 @@ source_set("fml") {
...
@@ -62,6 +64,7 @@ source_set("fml") {
"platform/android/jni_weak_ref.h",
"platform/android/jni_weak_ref.h",
"platform/android/message_loop_android.cc",
"platform/android/message_loop_android.cc",
"platform/android/message_loop_android.h",
"platform/android/message_loop_android.h",
"platform/android/paths_android.cc",
"platform/android/scoped_java_ref.cc",
"platform/android/scoped_java_ref.cc",
"platform/android/scoped_java_ref.h",
"platform/android/scoped_java_ref.h",
]
]
...
@@ -83,6 +86,7 @@ source_set("fml") {
...
@@ -83,6 +86,7 @@ source_set("fml") {
sources += [
sources += [
"platform/linux/message_loop_linux.cc",
"platform/linux/message_loop_linux.cc",
"platform/linux/message_loop_linux.h",
"platform/linux/message_loop_linux.h",
"platform/linux/paths_linux.cc",
"platform/linux/timerfd.cc",
"platform/linux/timerfd.cc",
"platform/linux/timerfd.h",
"platform/linux/timerfd.h",
]
]
...
...
fml/icu_util.cc
浏览文件 @
d119d62c
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include <mutex>
#include <mutex>
#include "flutter/fml/mapping.h"
#include "flutter/fml/mapping.h"
#include "flutter/fml/paths.h"
#include "lib/ftl/build_config.h"
#include "lib/ftl/build_config.h"
#include "lib/ftl/logging.h"
#include "lib/ftl/logging.h"
#include "third_party/icu/source/common/unicode/udata.h"
#include "third_party/icu/source/common/unicode/udata.h"
...
@@ -44,7 +45,16 @@ class ICUContext {
...
@@ -44,7 +45,16 @@ class ICUContext {
// Check if the mapping can by directly accessed via a file path. In this
// Check if the mapping can by directly accessed via a file path. In this
// case, the data file needs to be next to the executable.
// case, the data file needs to be next to the executable.
auto
file
=
std
::
make_unique
<
FileMapping
>
(
kIcuDataFileName
);
auto
directory
=
fml
::
paths
::
GetExecutableDirectoryPath
();
if
(
!
directory
.
first
)
{
return
false
;
}
// FIXME(chinmaygarde): There is no Path::Join in FTL. So a non-portable
// version is used here. Patch FTL and update.
auto
file
=
std
::
make_unique
<
FileMapping
>
(
directory
.
second
+
"/"
+
kIcuDataFileName
);
if
(
file
->
GetSize
()
!=
0
)
{
if
(
file
->
GetSize
()
!=
0
)
{
mapping_
=
std
::
move
(
file
);
mapping_
=
std
::
move
(
file
);
return
true
;
return
true
;
...
...
fml/paths.h
0 → 100644
浏览文件 @
d119d62c
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FML_PATHS_H_
#define FLUTTER_FML_PATHS_H_
#include <string>
#include <utility>
namespace
fml
{
namespace
paths
{
std
::
pair
<
bool
,
std
::
string
>
GetExecutableDirectoryPath
();
}
// namespace paths
}
// namespace fml
#endif // FLUTTER_FML_PATHS_H_
fml/platform/android/paths_android.cc
0 → 100644
浏览文件 @
d119d62c
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/paths.h"
namespace
fml
{
namespace
paths
{
std
::
pair
<
bool
,
std
::
string
>
GetExecutableDirectoryPath
()
{
return
{
false
,
""
};
}
}
// namespace paths
}
// namespace fml
fml/platform/darwin/paths_darwin.mm
0 → 100644
浏览文件 @
d119d62c
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/paths.h"
#include <Foundation/Foundation.h>
#include "lib/ftl/files/path.h"
namespace
fml
{
namespace
paths
{
std
::
pair
<
bool
,
std
::
string
>
GetExecutableDirectoryPath
()
{
return
{
true
,
files
::
GetDirectoryName
(
[
NSBundle
mainBundle
].
executablePath
.
UTF8String
)};
}
}
// namespace paths
}
// namespace fml
fml/platform/linux/paths_linux.cc
0 → 100644
浏览文件 @
d119d62c
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/paths.h"
#include <unistd.h>
#include "lib/ftl/files/path.h"
namespace
fml
{
namespace
paths
{
std
::
pair
<
bool
,
std
::
string
>
GetExecutableDirectoryPath
()
{
const
int
path_size
=
255
;
char
path
[
path_size
]
=
{
0
};
auto
read_size
=
::
readlink
(
"/proc/self/exe"
,
path
,
path_size
);
if
(
read_size
==
-
1
)
{
return
{
false
,
""
};
}
return
{
true
,
files
::
GetDirectoryName
(
std
::
string
{
path
,
read_size
})};
}
}
// namespace paths
}
// namespace fml
travis/licenses_golden/licenses_flutter
浏览文件 @
d119d62c
...
@@ -1913,12 +1913,14 @@ FILE: ../../../flutter/fml/message_loop.h
...
@@ -1913,12 +1913,14 @@ FILE: ../../../flutter/fml/message_loop.h
FILE: ../../../flutter/fml/message_loop_impl.cc
FILE: ../../../flutter/fml/message_loop_impl.cc
FILE: ../../../flutter/fml/message_loop_impl.h
FILE: ../../../flutter/fml/message_loop_impl.h
FILE: ../../../flutter/fml/message_loop_unittests.cc
FILE: ../../../flutter/fml/message_loop_unittests.cc
FILE: ../../../flutter/fml/paths.h
FILE: ../../../flutter/fml/platform/android/jni_util.cc
FILE: ../../../flutter/fml/platform/android/jni_util.cc
FILE: ../../../flutter/fml/platform/android/jni_util.h
FILE: ../../../flutter/fml/platform/android/jni_util.h
FILE: ../../../flutter/fml/platform/android/jni_weak_ref.cc
FILE: ../../../flutter/fml/platform/android/jni_weak_ref.cc
FILE: ../../../flutter/fml/platform/android/jni_weak_ref.h
FILE: ../../../flutter/fml/platform/android/jni_weak_ref.h
FILE: ../../../flutter/fml/platform/android/message_loop_android.cc
FILE: ../../../flutter/fml/platform/android/message_loop_android.cc
FILE: ../../../flutter/fml/platform/android/message_loop_android.h
FILE: ../../../flutter/fml/platform/android/message_loop_android.h
FILE: ../../../flutter/fml/platform/android/paths_android.cc
FILE: ../../../flutter/fml/platform/android/scoped_java_ref.cc
FILE: ../../../flutter/fml/platform/android/scoped_java_ref.cc
FILE: ../../../flutter/fml/platform/android/scoped_java_ref.h
FILE: ../../../flutter/fml/platform/android/scoped_java_ref.h
FILE: ../../../flutter/fml/platform/darwin/cf_utils.cc
FILE: ../../../flutter/fml/platform/darwin/cf_utils.cc
...
@@ -1927,6 +1929,7 @@ FILE: ../../../flutter/fml/platform/darwin/message_loop_darwin.h
...
@@ -1927,6 +1929,7 @@ FILE: ../../../flutter/fml/platform/darwin/message_loop_darwin.h
FILE: ../../../flutter/fml/platform/darwin/message_loop_darwin.mm
FILE: ../../../flutter/fml/platform/darwin/message_loop_darwin.mm
FILE: ../../../flutter/fml/platform/darwin/nsstring_utils.h
FILE: ../../../flutter/fml/platform/darwin/nsstring_utils.h
FILE: ../../../flutter/fml/platform/darwin/nsstring_utils.mm
FILE: ../../../flutter/fml/platform/darwin/nsstring_utils.mm
FILE: ../../../flutter/fml/platform/darwin/paths_darwin.mm
FILE: ../../../flutter/fml/platform/darwin/resource_mapping_darwin.h
FILE: ../../../flutter/fml/platform/darwin/resource_mapping_darwin.h
FILE: ../../../flutter/fml/platform/darwin/resource_mapping_darwin.mm
FILE: ../../../flutter/fml/platform/darwin/resource_mapping_darwin.mm
FILE: ../../../flutter/fml/platform/darwin/scoped_block.mm
FILE: ../../../flutter/fml/platform/darwin/scoped_block.mm
...
@@ -1934,6 +1937,7 @@ FILE: ../../../flutter/fml/platform/darwin/scoped_nsobject.h
...
@@ -1934,6 +1937,7 @@ FILE: ../../../flutter/fml/platform/darwin/scoped_nsobject.h
FILE: ../../../flutter/fml/platform/darwin/scoped_nsobject.mm
FILE: ../../../flutter/fml/platform/darwin/scoped_nsobject.mm
FILE: ../../../flutter/fml/platform/linux/message_loop_linux.cc
FILE: ../../../flutter/fml/platform/linux/message_loop_linux.cc
FILE: ../../../flutter/fml/platform/linux/message_loop_linux.h
FILE: ../../../flutter/fml/platform/linux/message_loop_linux.h
FILE: ../../../flutter/fml/platform/linux/paths_linux.cc
FILE: ../../../flutter/fml/platform/linux/timerfd.cc
FILE: ../../../flutter/fml/platform/linux/timerfd.cc
FILE: ../../../flutter/fml/platform/linux/timerfd.h
FILE: ../../../flutter/fml/platform/linux/timerfd.h
FILE: ../../../flutter/fml/task_runner.cc
FILE: ../../../flutter/fml/task_runner.cc
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录