CEF加载PPAPI插件
来源:互联网 发布:aloha什么软件 编辑:程序博客网 时间:2024/06/05 15:03
CEF基于Chromium和Webkit而来,支持PPAPI和NaCI。
CEF3的binary包默认已经支持PPAPI(参考http://magpcss.org/ceforum/viewtopic.php?f=10&t=10509),以cefsimple为例(参考CEF Windows开发环境搭建),可以通过命令行参数来注册PPAPI plugin,通过–url参数传递一个加载对应plugin的html页面。
下面是我测试可用的一个命令行参数
--ppapi-out-of-process --register-pepper-plugins="D:\projects\cef_binary_3.2357.1271.g8e0674e_windows32\Release\stub.dll;application/x-ppapi-stub" --url=file:///d:/projects/cef_binary_3.2357.1271.g8e0674e_windows32/Release/stub.html
stub.html非常简单,代码如下:
<!DOCTYPE html><html><head> <title>stub</title></head><body><embed id="plugin" type="application/x-ppapi-stub"></body></html>
其中stub.dll是我编译的PPAPI SDK里的示例,做了些许改动。stub.c代码如下:
// Copyright (c) 2010 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.// This is the simplest possible C Pepper plugin that does nothing. If you're// using C++, you will want to look at stub.cc which uses the more convenient// C++ wrappers.#include <stddef.h>#include <stdint.h>#include <Windows.h>#include <tchar.h>#include "ppapi/c/pp_errors.h"#include "ppapi/c/pp_module.h"#include "ppapi/c/ppb.h"#include "ppapi/c/ppp.h"#include "ppapi/c/pp_instance.h"#include "ppapi/c/ppp_instance.h"PP_Module g_module_id;PPB_GetInterface g_get_browser_interface = NULL;PP_EXPORT int32_t PPP_InitializeModule(PP_Module module_id, PPB_GetInterface get_browser_interface) { // Save the global module information for later. g_module_id = module_id; g_get_browser_interface = get_browser_interface; OutputDebugString(_T("PPP_InitializeModule was called\r\n")); return PP_OK;}PP_EXPORT void PPP_ShutdownModule() {OutputDebugString(_T("PPP_ShutdownModule was called\r\n"));}PP_EXPORT const void* PPP_GetInterface(const char* interface_name) { // You will normally implement a getter for at least PPP_INSTANCE_INTERFACE // here. return NULL;}
如你所见,我只是使用OutputDebugString函数输出了调试信息。运行cefsimple,使用DbgView工具可以看到我们输出的信息。
关于PPAPI插件的细节,后面会有一些文章来讲。
相关文章参考:
- CEF Windows开发环境搭建
0 0
- CEF加载PPAPI插件
- CEFGlue 加载FLASH 使用HOOK 方式 解决 CEF 加载 PPAPI FLASH 插件时弹出 CMD 命令行 窗口的问题
- cef3 加载flash ppapi插件
- CEF启动时注册多个ppapi插件
- CEF 加载flash 插件
- CEF 加载flash 插件
- PPAPI 插件编写
- PPAPI插件开发指南
- PPAPI插件开发指南
- NPAPI和PPAPI插件开发
- cef下加载flash
- VS2013编译最简单的PPAPI插件
- PPAPI插件与浏览器的交互过程
- 在PPAPI插件中创建本地窗口
- PPAPI插件与浏览器的通信
- 在PPAPI插件中使用Skia绘图
- PPAPI插件的全屏切换处理
- PPAPI插件的动态创建、修改、删除
- ROS_RGB-D SLAM学习笔记--室内环境测试
- poj3468 A Simple Problem with Integers 基础线段树or树状数组
- const限定符最基本的
- Socket
- BFS 迷宫的最短路径
- CEF加载PPAPI插件
- 微信开发对接
- 《笨办法学Python》 第8课手记
- vim使用系统剪切板
- How to refresh materialized view in oracle
- HDOJ 2042 不容易系列之二
- std::set自定义比较函数
- Matlab 生成任意扇形区域
- Java读取并修改图片的像素值