| Index: ppapi/cpp/module.cc
|
| ===================================================================
|
| --- ppapi/cpp/module.cc (revision 78988)
|
| +++ ppapi/cpp/module.cc (working copy)
|
| @@ -25,6 +25,7 @@
|
|
|
| #include <string.h>
|
|
|
| +#include "ppapi/c/dev/ppp_messaging_dev.h"
|
| #include "ppapi/c/pp_instance.h"
|
| #include "ppapi/c/pp_var.h"
|
| #include "ppapi/c/ppp_instance.h"
|
| @@ -134,6 +135,20 @@
|
| &Instance_GetInstanceObject
|
| };
|
|
|
| +void Messaging_HandleMessage(PP_Instance pp_instance, PP_Var var) {
|
| + Module* module_singleton = Module::Get();
|
| + if (!module_singleton)
|
| + return;
|
| + Instance* instance = module_singleton->InstanceForPPInstance(pp_instance);
|
| + if (!instance)
|
| + return;
|
| + instance->HandleMessage(Var(Var::PassRef(), var));
|
| +}
|
| +
|
| +static PPP_Messaging_Dev instance_messaging_interface = {
|
| + &Messaging_HandleMessage
|
| +};
|
| +
|
| // Module ----------------------------------------------------------------------
|
|
|
| Module::Module() : pp_module_(0), get_browser_interface_(NULL), core_(NULL) {
|
| @@ -152,6 +167,9 @@
|
| if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0)
|
| return &instance_interface;
|
|
|
| + if (strcmp(interface_name, PPP_MESSAGING_DEV_INTERFACE) == 0)
|
| + return &instance_messaging_interface;
|
| +
|
| // Now see if anything was dynamically registered.
|
| InterfaceMap::const_iterator found = additional_interfaces_.find(
|
| std::string(interface_name));
|
|
|