Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
liujiuri
engine
提交
b6e662eb
E
engine
项目概览
liujiuri
/
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,发现更多精彩内容 >>
提交
b6e662eb
编写于
11月 16, 2015
作者:
A
Adam Barth
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2056 from abarth/mojo_services
Wire in Mojo services to sky_shell.mojo
上级
b0d8e5c5
77f873c1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
50 addition
and
24 deletion
+50
-24
sky/shell/platform/mojo/platform_view_mojo.cc
sky/shell/platform/mojo/platform_view_mojo.cc
+10
-3
sky/shell/platform/mojo/platform_view_mojo.h
sky/shell/platform/mojo/platform_view_mojo.h
+3
-2
sky/shell/platform/mojo/sky_application_impl.cc
sky/shell/platform/mojo/sky_application_impl.cc
+17
-10
sky/shell/platform/mojo/sky_application_impl.h
sky/shell/platform/mojo/sky_application_impl.h
+13
-8
sky/shell/ui/internals.cc
sky/shell/ui/internals.cc
+6
-1
sky/shell/ui/internals.h
sky/shell/ui/internals.h
+1
-0
未找到文件。
sky/shell/platform/mojo/platform_view_mojo.cc
浏览文件 @
b6e662eb
...
...
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "mojo/public/cpp/application/connect.h"
#include "sky/shell/gpu/mojo/rasterizer_mojo.h"
namespace
sky
{
...
...
@@ -23,8 +24,9 @@ PlatformViewMojo::PlatformViewMojo(const Config& config)
PlatformViewMojo
::~
PlatformViewMojo
()
{
}
void
PlatformViewMojo
::
Init
(
mojo
::
ApplicationImpl
*
app
)
{
app
->
ConnectToService
(
"mojo:native_viewport_service"
,
&
viewport_
);
void
PlatformViewMojo
::
Init
(
mojo
::
ShellPtr
shell
)
{
mojo
::
ConnectToService
(
shell
.
get
(),
"mojo:native_viewport_service"
,
&
viewport_
);
mojo
::
NativeViewportEventDispatcherPtr
ptr
;
dispatcher_binding_
.
Bind
(
GetProxy
(
&
ptr
));
...
...
@@ -53,11 +55,16 @@ void PlatformViewMojo::Init(mojo::ApplicationImpl* app) {
config_
.
ui_delegate
,
base
::
Bind
(
&
RasterizerMojo
::
OnContextProviderAvailable
,
rasterizer
->
GetWeakPtr
(),
base
::
Passed
(
&
context_provider_info
))));
ConnectToEngine
(
mojo
::
GetProxy
(
&
sky_engine_
));
ServicesDataPtr
services
=
ServicesData
::
New
();
services
->
shell
=
shell
.
Pass
();
sky_engine_
->
SetServices
(
services
.
Pass
());
}
void
PlatformViewMojo
::
Run
(
const
mojo
::
String
&
url
,
mojo
::
asset_bundle
::
AssetBundlePtr
bundle
)
{
ConnectToEngine
(
mojo
::
GetProxy
(
&
sky_engine_
));
sky_engine_
->
RunFromAssetBundle
(
url
,
bundle
.
Pass
());
}
...
...
sky/shell/platform/mojo/platform_view_mojo.h
浏览文件 @
b6e662eb
...
...
@@ -5,8 +5,9 @@
#ifndef SKY_SHELL_PLATFORM_MOJO_PLATFORM_VIEW_MOJO_H_
#define SKY_SHELL_PLATFORM_MOJO_PLATFORM_VIEW_MOJO_H_
#include "mojo/public/cpp/
application/application_impl
.h"
#include "mojo/public/cpp/
bindings/binding
.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
#include "mojo/services/asset_bundle/interfaces/asset_bundle.mojom.h"
#include "mojo/services/native_viewport/interfaces/native_viewport.mojom.h"
#include "sky/shell/platform_view.h"
...
...
@@ -20,7 +21,7 @@ class PlatformViewMojo : public PlatformView,
explicit
PlatformViewMojo
(
const
Config
&
config
);
~
PlatformViewMojo
()
override
;
void
Init
(
mojo
::
ApplicationImpl
*
app
);
void
Init
(
mojo
::
ShellPtr
shell
);
void
Run
(
const
mojo
::
String
&
url
,
mojo
::
asset_bundle
::
AssetBundlePtr
bundle
);
...
...
sky/shell/platform/mojo/sky_application_impl.cc
浏览文件 @
b6e662eb
...
...
@@ -14,32 +14,39 @@ namespace shell {
SkyApplicationImpl
::
SkyApplicationImpl
(
mojo
::
InterfaceRequest
<
mojo
::
Application
>
application
,
mojo
::
URLResponsePtr
response
)
:
app
_
(
this
,
application
.
Pass
()),
:
binding
_
(
this
,
application
.
Pass
()),
initial_response_
(
response
.
Pass
())
{
}
SkyApplicationImpl
::~
SkyApplicationImpl
()
{
}
void
SkyApplicationImpl
::
Initialize
(
mojo
::
ApplicationImpl
*
app
)
{
void
SkyApplicationImpl
::
Initialize
(
mojo
::
ShellPtr
shell
,
mojo
::
Array
<
mojo
::
String
>
args
,
const
mojo
::
String
&
url
)
{
DCHECK
(
initial_response_
);
UnpackInitialResponse
();
UnpackInitialResponse
(
shell
.
get
()
);
shell_view_
.
reset
(
new
ShellView
(
Shell
::
Shared
()));
PlatformViewMojo
*
view
=
platform_view
();
view
->
Init
(
app
);
view
->
Run
(
app_
.
url
()
,
bundle_
.
Pass
());
view
->
Init
(
shell
.
Pass
()
);
view
->
Run
(
url
,
bundle_
.
Pass
());
}
bool
SkyApplicationImpl
::
ConfigureIncomingConnection
(
mojo
::
ApplicationConnection
*
connection
)
{
return
true
;
void
SkyApplicationImpl
::
AcceptConnection
(
const
mojo
::
String
&
requestor_url
,
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
services
,
mojo
::
ServiceProviderPtr
exposed_services
,
const
mojo
::
String
&
resolved_url
)
{
}
void
SkyApplicationImpl
::
UnpackInitialResponse
()
{
void
SkyApplicationImpl
::
RequestQuit
()
{
}
void
SkyApplicationImpl
::
UnpackInitialResponse
(
mojo
::
Shell
*
shell
)
{
DCHECK
(
initial_response_
);
DCHECK
(
!
bundle_
);
mojo
::
asset_bundle
::
AssetUnpackerPtr
unpacker
;
app_
.
ConnectToService
(
"mojo:asset_bundle"
,
&
unpacker
);
mojo
::
ConnectToService
(
shell
,
"mojo:asset_bundle"
,
&
unpacker
);
unpacker
->
UnpackZipStream
(
initial_response_
->
body
.
Pass
(),
mojo
::
GetProxy
(
&
bundle_
));
initial_response_
=
nullptr
;
...
...
sky/shell/platform/mojo/sky_application_impl.h
浏览文件 @
b6e662eb
...
...
@@ -6,8 +6,8 @@
#define SKY_SHELL_PLATFORM_MOJO_SKY_APPLICATION_IMPL_H_
#include "base/message_loop/message_loop.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/interfaces/application/application.mojom.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
#include "mojo/services/asset_bundle/interfaces/asset_bundle.mojom.h"
#include "mojo/services/content_handler/interfaces/content_handler.mojom.h"
...
...
@@ -17,25 +17,30 @@
namespace
sky
{
namespace
shell
{
class
SkyApplicationImpl
:
public
mojo
::
Application
Delegate
{
class
SkyApplicationImpl
:
public
mojo
::
Application
{
public:
SkyApplicationImpl
(
mojo
::
InterfaceRequest
<
mojo
::
Application
>
application
,
mojo
::
URLResponsePtr
response
);
~
SkyApplicationImpl
()
override
;
private:
// mojo::ApplicationDelegate
void
Initialize
(
mojo
::
ApplicationImpl
*
app
)
override
;
bool
ConfigureIncomingConnection
(
mojo
::
ApplicationConnection
*
connection
)
override
;
// mojo::Application
void
Initialize
(
mojo
::
ShellPtr
shell
,
mojo
::
Array
<
mojo
::
String
>
args
,
const
mojo
::
String
&
url
)
override
;
void
AcceptConnection
(
const
mojo
::
String
&
requestor_url
,
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
services
,
mojo
::
ServiceProviderPtr
exposed_services
,
const
mojo
::
String
&
resolved_url
)
override
;
void
RequestQuit
()
override
;
PlatformViewMojo
*
platform_view
()
{
return
static_cast
<
PlatformViewMojo
*>
(
shell_view_
->
view
());
}
void
UnpackInitialResponse
();
void
UnpackInitialResponse
(
mojo
::
Shell
*
shell
);
mojo
::
ApplicationImpl
app
_
;
mojo
::
StrongBinding
<
mojo
::
Application
>
binding
_
;
mojo
::
URLResponsePtr
initial_response_
;
mojo
::
asset_bundle
::
AssetBundlePtr
bundle_
;
scoped_ptr
<
ShellView
>
shell_view_
;
...
...
sky/shell/ui/internals.cc
浏览文件 @
b6e662eb
...
...
@@ -32,7 +32,8 @@ void TakeRootBundleHandle(Dart_NativeArguments args) {
}
void
TakeShellProxyHandle
(
Dart_NativeArguments
args
)
{
Dart_SetIntegerReturnValue
(
args
,
0
);
Dart_SetIntegerReturnValue
(
args
,
GetInternals
()
->
TakeShellProxy
().
value
());
}
void
TakeServicesProvidedByEmbedder
(
Dart_NativeArguments
args
)
{
...
...
@@ -117,6 +118,10 @@ void Internals::Create(
request
.
Pass
(),
base
::
WorkerPool
::
GetTaskRunner
(
true
));
}
mojo
::
Handle
Internals
::
TakeShellProxy
()
{
return
services_
?
services_
->
shell
.
PassInterface
().
PassHandle
().
release
()
:
mojo
::
Handle
();
}
mojo
::
Handle
Internals
::
TakeServicesProvidedByEmbedder
()
{
return
service_provider_
.
PassInterface
().
PassHandle
().
release
();
}
...
...
sky/shell/ui/internals.h
浏览文件 @
b6e662eb
...
...
@@ -30,6 +30,7 @@ class Internals
ServicesDataPtr
services
,
mojo
::
asset_bundle
::
AssetBundlePtr
root_bundle
);
mojo
::
Handle
TakeShellProxy
();
mojo
::
Handle
TakeServicesProvidedByEmbedder
();
mojo
::
Handle
TakeRootBundleHandle
();
mojo
::
Handle
TakeServicesProvidedToEmbedder
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录