Index: ppapi/cpp/instance.cc |
=================================================================== |
--- ppapi/cpp/instance.cc (revision 78988) |
+++ ppapi/cpp/instance.cc (working copy) |
@@ -4,6 +4,7 @@ |
#include "ppapi/cpp/instance.h" |
+#include "ppapi/c/dev/ppb_messaging_dev.h" |
#include "ppapi/c/dev/ppp_printing_dev.h" |
#include "ppapi/c/ppb_instance.h" |
#include "ppapi/cpp/common.h" |
@@ -25,6 +26,10 @@ |
return PPB_INSTANCE_INTERFACE; |
} |
+template <> const char* interface_name<PPB_Messaging_Dev>() { |
+ return PPB_MESSAGING_DEV_INTERFACE; |
+} |
+ |
} // namespace |
Instance::Instance(PP_Instance instance) : pp_instance_(instance) { |
@@ -61,6 +66,10 @@ |
return false; |
} |
+void Instance::HandleMessage(const Var& /*message_data*/) { |
+ return; |
+} |
+ |
Var Instance::GetInstanceObject() { |
return Var(); |
} |
@@ -115,6 +124,13 @@ |
Var::OutException(exception).get())); |
} |
+void Instance::PostMessage(const Var& message) { |
+ if (!has_interface<PPB_Messaging_Dev>()) |
+ return; |
+ get_interface<PPB_Messaging_Dev>()->PostMessage(pp_instance(), |
+ message.pp_var()); |
+} |
+ |
void Instance::AddPerInstanceObject(const std::string& interface_name, |
void* object) { |
// Ensure we're not trying to register more than one object per interface |