Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: ppapi/cpp/instance.cc

Issue 11416214: PPAPI: Move PPB_Console out of dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/instance.h ('k') | ppapi/cpp/private/instance_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ppapi/cpp/instance.h ('k') | ppapi/cpp/private/instance_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698