| Index: ppapi/cpp/instance.cc
|
| diff --git a/ppapi/cpp/instance.cc b/ppapi/cpp/instance.cc
|
| index e000f9ccf53d7419788f4558482ba3d43a3c49a2..d285fd4936671ad61bc3198a273ad4510cdafc2f 100644
|
| --- a/ppapi/cpp/instance.cc
|
| +++ b/ppapi/cpp/instance.cc
|
| @@ -5,6 +5,7 @@
|
| #include "ppapi/cpp/instance.h"
|
|
|
| #include "ppapi/c/pp_errors.h"
|
| +#include "ppapi/c/ppb_console.h"
|
| #include "ppapi/c/ppb_input_event.h"
|
| #include "ppapi/c/ppb_instance.h"
|
| #include "ppapi/c/ppb_messaging.h"
|
| @@ -24,6 +25,10 @@ namespace pp {
|
|
|
| namespace {
|
|
|
| +template <> const char* interface_name<PPB_Console_1_0>() {
|
| + return PPB_CONSOLE_INTERFACE_1_0;
|
| +}
|
| +
|
| template <> const char* interface_name<PPB_InputEvent_1_0>() {
|
| return PPB_INPUT_EVENT_INTERFACE_1_0;
|
| }
|
| @@ -123,6 +128,22 @@ void Instance::PostMessage(const Var& message) {
|
| message.pp_var());
|
| }
|
|
|
| +void Instance::LogToConsole(PP_LogLevel level, const Var& value) {
|
| + if (!has_interface<PPB_Console_1_0>())
|
| + return;
|
| + get_interface<PPB_Console_1_0>()->Log(
|
| + pp_instance(), level, value.pp_var());
|
| +}
|
| +
|
| +void Instance::LogToConsoleWithSource(PP_LogLevel level,
|
| + const Var& source,
|
| + const Var& value) {
|
| + if (!has_interface<PPB_Console_1_0>())
|
| + return;
|
| + get_interface<PPB_Console_1_0>()->LogWithSource(
|
| + pp_instance(), level, source.pp_var(), value.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
|
|
|