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

Unified Diff: ppapi/cpp/private/instance_private.cc

Issue 10703146: PPAPI: Add console logging methods to pp::InstancePrivate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asdf Created 8 years, 5 months 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/private/instance_private.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/private/instance_private.cc
diff --git a/ppapi/cpp/private/instance_private.cc b/ppapi/cpp/private/instance_private.cc
index 4e381149d7d3b50a388db2145b331a1f4de4e798..1dfabbffd5292d31f8fd2d2784cb7fa1b483f254 100644
--- a/ppapi/cpp/private/instance_private.cc
+++ b/ppapi/cpp/private/instance_private.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -17,6 +17,10 @@ template <> const char* interface_name<PPB_Instance_Private>() {
return PPB_INSTANCE_PRIVATE_INTERFACE;
}
+template <> const char* interface_name<PPB_Console_Dev_0_1>() {
+ return PPB_CONSOLE_DEV_INTERFACE_0_1;
+}
+
PP_Var GetInstanceObject(PP_Instance pp_instance) {
Module* module_singleton = Module::Get();
if (!module_singleton)
@@ -66,10 +70,26 @@ VarPrivate InstancePrivate::ExecuteScript(const Var& script, Var* exception) {
if (!has_interface<PPB_Instance_Private>())
return VarPrivate();
return VarPrivate(PASS_REF,
- get_interface<PPB_Instance_Private>()->ExecuteScript(
- pp_instance(),
- script.pp_var(),
- VarPrivate::OutException(exception).get()));
+ get_interface<PPB_Instance_Private>()->ExecuteScript(
+ pp_instance(),
+ script.pp_var(),
+ VarPrivate::OutException(exception).get()));
+}
+
+void InstancePrivate::LogToConsole(PP_LogLevel_Dev level, const Var& value) {
+ if (!has_interface<PPB_Console_Dev_0_1>())
+ return;
+ get_interface<PPB_Console_Dev_0_1>()->Log(
+ pp_instance(), level, value.pp_var());
+}
+
+void InstancePrivate::LogToConsoleWithSource(PP_LogLevel_Dev level,
+ const Var& source,
+ const Var& value) {
+ if (!has_interface<PPB_Console_Dev_0_1>())
+ return;
+ get_interface<PPB_Console_Dev_0_1>()->LogWithSource(
+ pp_instance(), level, source.pp_var(), value.pp_var());
}
} // namespace pp
« no previous file with comments | « ppapi/cpp/private/instance_private.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698