c++ 可以在接口(interface)中使用 chromium base::callback 吗?

标签 c++ callback chromium

我可以在界面中使用 chromium base::callback 吗? 我会将回调放到另一个动态链接库线程池中,但我不确定它是否正确以及哪个模块 释放回调?

最佳答案

简短的回答是肯定的,你可以。来自文档

// The Callback objects themselves should be passed by const-reference, and
// stored by copy. They internally store their state via a refcounted class
// and thus do not need to be deleted.
//
// The reason to pass via a const-reference is to avoid unnecessary
// AddRef/Release pairs to the internal state.

Link to documentation.

关于c++ 可以在接口(interface)中使用 chromium base::callback 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21846671/

相关文章:

c++ - 如何在 C++ 中使用 fft 生成音频频谱?

c++ - ASIO (C++ 11) strand.post 在使用私有(private)成员函数时导致段错误

php - 支持 chromium 浏览器透明度的 <frame> 对应物?

firefox - 网络引擎 - 在 Electron 应用程序中用 Firefox 替换 Chrome

c++ - STL 谓词是否需要是纯谓词?

c++ - 当键可能不存在时,如何返回对对象的引用(来自 unordered_map)?

Javascript - 如何确保回调函数在再次执行主函数之前已终止

oauth - 了解用户 ID 在 3 足 OAuth session 中的使用?

google-chrome - 如何忽略开发工具中的某些错误?

c++ - 在 ‘typename’ 之前需要 ‘..’ 因为 ‘..’ 是一个从属范围