Calling Mojo from Blink
Variants
module example.mojom; interface Foo { SendData(string param1, array<int32> param2);};mojom("example") { sources = [ "example.mojom" ]
use_new_wrapper_types = true}class Example {
virtual void SendArray(const std::string& param1, const std::vector<int32_t>& param2) = 0;
}
class Example {
virtual void SendArray(const WTF::String& param1, const WTF::Vector<int32_t>& param2) = 0;
}
#include "wtf/Functional.h"
void MyObject::ReverseString(const String& string)
{
m_service->ReverseString(
string,
ConvertToBaseCallback(WTF::Bind(&MyObject::onStringReversed, wrapPersistent(this))));
}
// m_service is a member of MyObject. This code should be run as soon as m_foo is bound to a message pipe.
m_service.set_connection_error_handler(
ConvertToBaseCallback(WTF::Bind(&MyObject::OnConnectionError,
wrapWeakPersistent(this))));
void MyObject::OnConnectionError()
{
m_service.reset();
}
// MyObject.h
class MyObject : public GarbageCollected
, public example::blink::Example
{
USING_PRE_FINALIZER(MyObject, dispose);
public:
MyObject();
void dispose();
// Implementation of example::blink::Example.
private:
mojo::Binding<example::blink::Example> m_binding;
};
// MyObject.cpp
MyObject::MyObject() : m_binding(this)
{
ThreadState::current()->registerPreFinalizer(this);
}
void MyObject::dispose()
{
m_binding.Close();
}
Calling Mojo from Blink的更多相关文章
- [Chromium文档转载,第005章]Calling Mojo from Blink
For Developers > Design Documents > Mojo > Calling Mojo from Blink Variants Let's as ...
- Mojo C++ Bindings API
This document is a subset of the Mojo documentation. Contents Overview Getting Started Interfaces Ba ...
- [Chromium文档转载,第002章]Mojo C++ Bindings API
Mojo C++ Bindings API This document is a subset of the Mojo documentation. Contents Overview Getting ...
- Deno下一代Nodejs?Deno初体验
前言 Ryan Dahl之父发布了新的项目Deno,很多IT媒体都使用了标题“下一代Nodejs”,首先我们看一下Deno的特性: 1.支持typescript (nodejs目前也支持). 2.无p ...
- Converting Legacy Chrome IPC To Mojo
Converting Legacy Chrome IPC To Mojo Looking for Mojo Documentation? Contents Overview Deciding What ...
- [Chromium文档转载,第006章]Chrome IPC To Mojo IPC Cheat Sheet
For Developers > Design Documents > Mojo > Chrome IPC To Mojo IPC Cheat Sheet 目录 1 O ...
- [Chromium文档转载,第001章] Mojo Migration Guide
For Developers > Design Documents > Mojo > Mojo Migration Guide 目录 1 Summary 2 H ...
- Mojo C++ System API
This document is a subset of the Mojo documentation. Contents Overview Scoped, Typed Handles Message ...
- Mojo Associated Interfaces
Mojo Associated Interfaces yzshen@chromium.org 02/22/2017 Background Before associated interfaces ar ...
随机推荐
- MyBatis数据持久化(十一)Mybatis3、Spring4、Struts2整合开发
上一节我们將Mybatis和Spring4进行整合,本节向大家介绍Mybatis在Web开发中的应用,并与主流的MVC框架Struts2进行整合. 我们首先需要获取Struts2框架,Struts2官 ...
- CREC 2017
A:Assignment Algorithm #include <bits/stdc++.h> using namespace std; ][]; ][],n,m,ans=,A,B,l=, ...
- mac 调整Launchpad行列数目
Mac调整Launchpad 行数和列数 开打Terminal终端依次输入以下三句: <1> 改变行数:defaults write com.apple.dock springboard ...
- 洛谷 p2618 数字工程 记忆化搜索_ 线性筛
我们在线筛的同时处理出每个数的所有质因子,记忆化搜索的时候直接枚举质因子即可. 时间复杂度为 O(nlogn)O(nlogn)O(nlogn) Code: #include<cstdio> ...
- 路飞学城Python-Day25
- React高级指南
高级指南 1.深入JSX: 从本质上讲,JSX 只是为 React.createElement(component, props, ...children) 函数提供的语法糖. 因为 JSX 被编译为 ...
- ansible 定义主机用户和密码
定义主机组用户和密码 [webservers] ansible[01:04] ansible_ssh_user='root' ansible_ssh_pass='AAbb0101' [root@ftp ...
- Ajax原理-重点
Ajax原理 AJAX即“Asynchronous Javascript And XML”,是指一种创建交互式网页应用的网页开发技术.AJAX 是一种用于创建快速动态网页的技术.它可以令开发者只向服务 ...
- jenkins 安装遇到的坑
最后启用安全的时候遇到一点坑,直接写了一个用户上去,没有勾选权限,然后在登录就说没有 overright/等,然后需要修改配置文件conf.xml 在主目录下. ...
- sql查询语句中on和where的区别
sql中的连接查询分为3种, cross join,inner join,和outer join , 在 cross join和inner join中,筛选条件放在on后面还是where后面是没区别 ...