Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
28511cee
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,发现更多精彩内容 >>
提交
28511cee
编写于
11月 05, 2015
作者:
J
Jason Simmons
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Convert Tracing to stop using the IDL-based bindings
上级
9241ef19
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
88 addition
and
70 deletion
+88
-70
sky/engine/bindings/dart_ui.cc
sky/engine/bindings/dart_ui.cc
+2
-0
sky/engine/core/core.gni
sky/engine/core/core.gni
+3
-3
sky/engine/core/dart/tracing.dart
sky/engine/core/dart/tracing.dart
+12
-0
sky/engine/core/dart/window.dart
sky/engine/core/dart/window.dart
+0
-1
sky/engine/core/tracing/tracing.cc
sky/engine/core/tracing/tracing.cc
+52
-0
sky/engine/core/tracing/tracing.h
sky/engine/core/tracing/tracing.h
+19
-0
sky/engine/core/view/Tracing.cpp
sky/engine/core/view/Tracing.cpp
+0
-36
sky/engine/core/view/Tracing.h
sky/engine/core/view/Tracing.h
+0
-30
未找到文件。
sky/engine/bindings/dart_ui.cc
浏览文件 @
28511cee
...
...
@@ -7,6 +7,7 @@
#include "gen/sky/bindings/DartGlobal.h"
#include "sky/engine/bindings/dart_runtime_hooks.h"
#include "sky/engine/core/painting/painting.h"
#include "sky/engine/core/tracing/tracing.h"
#include "sky/engine/core/window/window.h"
#include "sky/engine/tonic/dart_converter.h"
#include "sky/engine/tonic/dart_error.h"
...
...
@@ -40,6 +41,7 @@ void DartUI::InitForIsolate() {
DartRuntimeHooks
::
RegisterNatives
(
g_natives
);
Window
::
RegisterNatives
(
g_natives
);
Painting
::
RegisterNatives
(
g_natives
);
Tracing
::
RegisterNatives
(
g_natives
);
}
DART_CHECK_VALID
(
Dart_SetNativeResolver
(
...
...
sky/engine/core/core.gni
浏览文件 @
28511cee
...
...
@@ -244,8 +244,8 @@ sky_core_files = [
"text/Paragraph.h",
"text/ParagraphBuilder.cpp",
"text/ParagraphBuilder.h",
"
view/Tracing.cpp
",
"
view/T
racing.h",
"
tracing/tracing.cc
",
"
tracing/t
racing.h",
"window/window.cc",
"window/window.h",
]
...
...
@@ -275,7 +275,6 @@ core_idl_files = get_path_info([
"painting/Shader.idl",
"text/Paragraph.idl",
"text/ParagraphBuilder.idl",
"view/Tracing.idl",
],
"abspath")
...
...
@@ -285,6 +284,7 @@ core_dart_files = get_path_info([
"dart/lerp.dart",
"dart/painting.dart",
"dart/text.dart",
"dart/tracing.dart",
"dart/window.dart",
"painting/Color.dart",
"painting/ColorFilter.dart",
...
...
sky/engine/core/
view/Tracing.idl
→
sky/engine/core/
dart/tracing.dart
浏览文件 @
28511cee
...
...
@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
Constructor
()
]
interface
Tracing
{
void
begin
(
DOMString
name
)
;
void
end
(
DOMString
name
)
;
}
;
part of
dart_ui
;
class
_Tracing
{
void
begin
(
String
name
)
native
"Tracing_begin"
;
void
end
(
String
name
)
native
"Tracing_end"
;
}
final
_Tracing
tracing
=
new
_Tracing
();
sky/engine/core/dart/window.dart
浏览文件 @
28511cee
...
...
@@ -38,4 +38,3 @@ class Window {
}
final
Window
window
=
new
Window
.
_
();
final
Tracing
tracing
=
new
Tracing
();
sky/engine/core/tracing/tracing.cc
0 → 100644
浏览文件 @
28511cee
// Copyright 2015 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 "sky/engine/core/tracing/tracing.h"
#include "base/trace_event/trace_event.h"
#include "sky/engine/tonic/dart_converter.h"
#include "sky/engine/wtf/text/StringUTF8Adaptor.h"
namespace
blink
{
namespace
{
void
BeginTracing
(
Dart_NativeArguments
args
)
{
Dart_Handle
exception
=
nullptr
;
String
name
=
DartConverter
<
String
>::
FromArguments
(
args
,
1
,
exception
);
if
(
exception
)
{
Dart_ThrowException
(
exception
);
return
;
}
StringUTF8Adaptor
utf8
(
name
);
// TRACE_EVENT_COPY_BEGIN0 needs a c-style null-terminated string.
CString
cstring
(
utf8
.
data
(),
utf8
.
length
());
TRACE_EVENT_COPY_BEGIN0
(
"script"
,
cstring
.
data
());
}
void
EndTracing
(
Dart_NativeArguments
args
)
{
Dart_Handle
exception
=
nullptr
;
String
name
=
DartConverter
<
String
>::
FromArguments
(
args
,
1
,
exception
);
if
(
exception
)
{
Dart_ThrowException
(
exception
);
return
;
}
StringUTF8Adaptor
utf8
(
name
);
// TRACE_EVENT_COPY_END0 needs a c-style null-terminated string.
CString
cstring
(
utf8
.
data
(),
utf8
.
length
());
TRACE_EVENT_COPY_END0
(
"script"
,
cstring
.
data
());
}
}
// namespace
void
Tracing
::
RegisterNatives
(
DartLibraryNatives
*
natives
)
{
natives
->
Register
({
{
"Tracing_begin"
,
BeginTracing
,
2
,
true
},
{
"Tracing_end"
,
EndTracing
,
2
,
true
},
});
}
}
// namespace blink
sky/engine/core/tracing/tracing.h
0 → 100644
浏览文件 @
28511cee
// Copyright 2015 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 SKY_ENGINE_CORE_TRACING_TRACING_H_
#define SKY_ENGINE_CORE_TRACING_TRACING_H_
#include "sky/engine/tonic/dart_library_natives.h"
namespace
blink
{
class
Tracing
{
public:
static
void
RegisterNatives
(
DartLibraryNatives
*
natives
);
};
}
// namespace blink
#endif // SKY_ENGINE_CORE_TRACING_TRACING_H_
sky/engine/core/view/Tracing.cpp
已删除
100644 → 0
浏览文件 @
9241ef19
// Copyright 2015 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 "sky/engine/core/view/Tracing.h"
#include "base/trace_event/trace_event.h"
#include "sky/engine/wtf/text/StringUTF8Adaptor.h"
namespace
blink
{
Tracing
::
Tracing
()
{
}
Tracing
::~
Tracing
()
{
}
void
Tracing
::
begin
(
const
String
&
name
)
{
StringUTF8Adaptor
utf8
(
name
);
// TRACE_EVENT_COPY_BEGIN0 needs a c-style null-terminated string.
CString
cstring
(
utf8
.
data
(),
utf8
.
length
());
TRACE_EVENT_COPY_BEGIN0
(
"script"
,
cstring
.
data
());
}
void
Tracing
::
end
(
const
String
&
name
)
{
StringUTF8Adaptor
utf8
(
name
);
// TRACE_EVENT_COPY_END0 needs a c-style null-terminated string.
CString
cstring
(
utf8
.
data
(),
utf8
.
length
());
TRACE_EVENT_COPY_END0
(
"script"
,
cstring
.
data
());
}
}
// namespace blink
sky/engine/core/view/Tracing.h
已删除
100644 → 0
浏览文件 @
9241ef19
// Copyright 2015 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 SKY_ENGINE_CORE_VIEW_TRACING_H_
#define SKY_ENGINE_CORE_VIEW_TRACING_H_
#include "sky/engine/tonic/dart_wrappable.h"
#include "sky/engine/wtf/PassRefPtr.h"
#include "sky/engine/wtf/RefCounted.h"
#include "sky/engine/wtf/text/WTFString.h"
namespace
blink
{
class
Tracing
:
public
RefCounted
<
Tracing
>
,
public
DartWrappable
{
DEFINE_WRAPPERTYPEINFO
();
public:
~
Tracing
()
override
;
static
PassRefPtr
<
Tracing
>
create
()
{
return
adoptRef
(
new
Tracing
);
}
void
begin
(
const
String
&
name
);
void
end
(
const
String
&
name
);
private:
Tracing
();
};
}
// namespace blink
#endif // SKY_ENGINE_CORE_VIEW_TRACING_H_
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录