summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorncbray@chromium.org <ncbray@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-13 01:34:32 +0000
committerncbray@chromium.org <ncbray@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-13 01:34:32 +0000
commit598816adfcd9f6d47f51b1209ec890d0bdacdee6 (patch)
tree594984d4a7e5201230fca35638505c5f65990f28 /ppapi
parentb171d8d2c0cdca2cb56df93e03438d210dfe031c (diff)
downloadchromium_src-598816adfcd9f6d47f51b1209ec890d0bdacdee6.zip
chromium_src-598816adfcd9f6d47f51b1209ec890d0bdacdee6.tar.gz
chromium_src-598816adfcd9f6d47f51b1209ec890d0bdacdee6.tar.bz2
PPAPI: Move PPB_Console out of dev.
PPB_Console was not added to the SRPC proxy because this proxy is deprecated. BUG= none Review URL: https://chromiumcodereview.appspot.com/11416214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/ppb_console.idl (renamed from ppapi/api/dev/ppb_console_dev.idl)12
-rw-r--r--ppapi/c/ppb_console.h (renamed from ppapi/c/dev/ppb_console_dev.h)26
-rw-r--r--ppapi/cpp/instance.cc21
-rw-r--r--ppapi/cpp/instance.h24
-rw-r--r--ppapi/cpp/private/instance_private.cc20
-rw-r--r--ppapi/cpp/private/instance_private.h15
-rw-r--r--ppapi/examples/gamepad/gamepad.cc1
-rw-r--r--ppapi/examples/gles2/gles2.cc1
-rw-r--r--ppapi/examples/ime/ime.cc6
-rw-r--r--ppapi/examples/mouse_lock/mouse_lock.cc10
-rw-r--r--ppapi/examples/video_decode/video_decode.cc8
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.cc8
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c60
-rw-r--r--ppapi/ppapi_sources.gypi4
-rw-r--r--ppapi/proxy/host_dispatcher.cc2
-rw-r--r--ppapi/proxy/interface_list.cc2
-rw-r--r--ppapi/proxy/plugin_dispatcher.cc2
-rw-r--r--ppapi/proxy/plugin_dispatcher.h4
-rw-r--r--ppapi/proxy/plugin_globals.cc4
-rw-r--r--ppapi/proxy/plugin_globals.h4
-rw-r--r--ppapi/shared_impl/ppapi_globals.h6
-rw-r--r--ppapi/shared_impl/ppb_instance_shared.cc4
-rw-r--r--ppapi/shared_impl/ppb_instance_shared.h4
-rw-r--r--ppapi/shared_impl/resource.cc2
-rw-r--r--ppapi/shared_impl/resource.h4
-rw-r--r--ppapi/shared_impl/test_globals.cc4
-rw-r--r--ppapi/shared_impl/test_globals.h4
-rw-r--r--ppapi/tests/all_c_includes.h2
-rw-r--r--ppapi/tests/test_console.cc38
-rw-r--r--ppapi/tests/test_console.h27
-rw-r--r--ppapi/thunk/interfaces_ppb_public_dev.h4
-rw-r--r--ppapi/thunk/interfaces_ppb_public_stable.h1
-rw-r--r--ppapi/thunk/ppb_console_thunk.cc12
-rw-r--r--ppapi/thunk/ppb_instance_api.h6
34 files changed, 216 insertions, 136 deletions
diff --git a/ppapi/api/dev/ppb_console_dev.idl b/ppapi/api/ppb_console.idl
index 20767eb..84daa6f 100644
--- a/ppapi/api/dev/ppb_console_dev.idl
+++ b/ppapi/api/ppb_console.idl
@@ -4,24 +4,24 @@
*/
/**
- * This file defines the <code>PPB_Console_Dev</code> interface.
+ * This file defines the <code>PPB_Console</code> interface.
*/
[generate_thunk]
label Chrome {
- M14 = 0.1
+ M25 = 1.0
};
[assert_size(4)]
-enum PP_LogLevel_Dev {
+enum PP_LogLevel {
PP_LOGLEVEL_TIP = 0,
PP_LOGLEVEL_LOG = 1,
PP_LOGLEVEL_WARNING = 2,
PP_LOGLEVEL_ERROR = 3
};
-interface PPB_Console_Dev {
+interface PPB_Console {
/**
* Logs the given message to the JavaScript console associated with the
* given plugin instance with the given logging level. The name of the plugin
@@ -30,7 +30,7 @@ interface PPB_Console_Dev {
*/
void Log(
[in] PP_Instance instance,
- [in] PP_LogLevel_Dev level,
+ [in] PP_LogLevel level,
[in] PP_Var value);
/**
@@ -45,7 +45,7 @@ interface PPB_Console_Dev {
*/
void LogWithSource(
[in] PP_Instance instance,
- [in] PP_LogLevel_Dev level,
+ [in] PP_LogLevel level,
[in] PP_Var source,
[in] PP_Var value);
};
diff --git a/ppapi/c/dev/ppb_console_dev.h b/ppapi/c/ppb_console.h
index 68e697e..f441c31 100644
--- a/ppapi/c/dev/ppb_console_dev.h
+++ b/ppapi/c/ppb_console.h
@@ -3,10 +3,10 @@
* found in the LICENSE file.
*/
-/* From dev/ppb_console_dev.idl modified Mon Nov 14 10:36:01 2011. */
+/* From ppb_console.idl modified Fri Nov 16 15:28:43 2012. */
-#ifndef PPAPI_C_DEV_PPB_CONSOLE_DEV_H_
-#define PPAPI_C_DEV_PPB_CONSOLE_DEV_H_
+#ifndef PPAPI_C_PPB_CONSOLE_H_
+#define PPAPI_C_PPB_CONSOLE_H_
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
@@ -14,12 +14,12 @@
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_var.h"
-#define PPB_CONSOLE_DEV_INTERFACE_0_1 "PPB_Console(Dev);0.1"
-#define PPB_CONSOLE_DEV_INTERFACE PPB_CONSOLE_DEV_INTERFACE_0_1
+#define PPB_CONSOLE_INTERFACE_1_0 "PPB_Console;1.0"
+#define PPB_CONSOLE_INTERFACE PPB_CONSOLE_INTERFACE_1_0
/**
* @file
- * This file defines the <code>PPB_Console_Dev</code> interface.
+ * This file defines the <code>PPB_Console</code> interface.
*/
@@ -32,8 +32,8 @@ typedef enum {
PP_LOGLEVEL_LOG = 1,
PP_LOGLEVEL_WARNING = 2,
PP_LOGLEVEL_ERROR = 3
-} PP_LogLevel_Dev;
-PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_LogLevel_Dev, 4);
+} PP_LogLevel;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_LogLevel, 4);
/**
* @}
*/
@@ -42,14 +42,14 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_LogLevel_Dev, 4);
* @addtogroup Interfaces
* @{
*/
-struct PPB_Console_Dev_0_1 {
+struct PPB_Console_1_0 {
/**
* Logs the given message to the JavaScript console associated with the
* given plugin instance with the given logging level. The name of the plugin
* issuing the log message will be automatically prepended to the message.
* The value may be any type of Var.
*/
- void (*Log)(PP_Instance instance, PP_LogLevel_Dev level, struct PP_Var value);
+ void (*Log)(PP_Instance instance, PP_LogLevel level, struct PP_Var value);
/**
* Logs a message to the console with the given source information rather
* than using the internal PPAPI plugin name. The name must be a string var.
@@ -61,15 +61,15 @@ struct PPB_Console_Dev_0_1 {
* doing the log statement rather than have "python" show up in the console.
*/
void (*LogWithSource)(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
struct PP_Var source,
struct PP_Var value);
};
-typedef struct PPB_Console_Dev_0_1 PPB_Console_Dev;
+typedef struct PPB_Console_1_0 PPB_Console;
/**
* @}
*/
-#endif /* PPAPI_C_DEV_PPB_CONSOLE_DEV_H_ */
+#endif /* PPAPI_C_PPB_CONSOLE_H_ */
diff --git a/ppapi/cpp/instance.cc b/ppapi/cpp/instance.cc
index e000f9c..d285fd4 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
diff --git a/ppapi/cpp/instance.h b/ppapi/cpp/instance.h
index 5e7931c..00eaadc 100644
--- a/ppapi/cpp/instance.h
+++ b/ppapi/cpp/instance.h
@@ -14,6 +14,7 @@
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/view.h"
@@ -472,6 +473,29 @@ class Instance {
/// @}
+ /// @{
+ /// @name PPB_Console methods for logging to the console:
+
+ /// Logs the given message to the JavaScript console associated with the
+ /// given plugin instance with the given logging level. The name of the plugin
+ /// issuing the log message will be automatically prepended to the message.
+ /// The value may be any type of Var.
+ void LogToConsole(PP_LogLevel level, const Var& value);
+
+ /// Logs a message to the console with the given source information rather
+ /// than using the internal PPAPI plugin name. The name must be a string var.
+ ///
+ /// The regular log function will automatically prepend the name of your
+ /// plugin to the message as the "source" of the message. Some plugins may
+ /// wish to override this. For example, if your plugin is a Python
+ /// interpreter, you would want log messages to contain the source .py file
+ /// doing the log statement rather than have "python" show up in the console.
+ void LogToConsoleWithSource(PP_LogLevel level,
+ const Var& source,
+ const Var& value);
+
+ /// @}
+
/// AddPerInstanceObject() associates an instance with an interface,
/// creating an object.
///
diff --git a/ppapi/cpp/private/instance_private.cc b/ppapi/cpp/private/instance_private.cc
index 1dfabbf..c55408a2 100644
--- a/ppapi/cpp/private/instance_private.cc
+++ b/ppapi/cpp/private/instance_private.cc
@@ -17,10 +17,6 @@ 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)
@@ -76,20 +72,4 @@ VarPrivate InstancePrivate::ExecuteScript(const Var& script, Var* exception) {
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
diff --git a/ppapi/cpp/private/instance_private.h b/ppapi/cpp/private/instance_private.h
index c6c51b7..58254698 100644
--- a/ppapi/cpp/private/instance_private.h
+++ b/ppapi/cpp/private/instance_private.h
@@ -13,7 +13,7 @@
* @{
*/
-#include "ppapi/c/dev/ppb_console_dev.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/cpp/instance.h"
/** The C++ interface to the Pepper API. */
@@ -48,19 +48,6 @@ class InstancePrivate : public Instance {
VarPrivate ExecuteScript(const Var& script, Var* exception = NULL);
// @}
-
- // @{
- /// @name PPB_Console_Dev methods for logging to the console:
-
- /// See PPB_Console_Dev.Log.
- void LogToConsole(PP_LogLevel_Dev level, const Var& value);
-
- /// See PPB_Console_Dev.LogWithSource.
- void LogToConsoleWithSource(PP_LogLevel_Dev level,
- const Var& source,
- const Var& value);
-
- // @}
};
} // namespace pp
diff --git a/ppapi/examples/gamepad/gamepad.cc b/ppapi/examples/gamepad/gamepad.cc
index 4fedc0b..e4a9f9f 100644
--- a/ppapi/examples/gamepad/gamepad.cc
+++ b/ppapi/examples/gamepad/gamepad.cc
@@ -6,7 +6,6 @@
#include <stdarg.h>
#include <stdio.h>
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/ppb_gamepad.h"
#include "ppapi/c/ppb_input_event.h"
#include "ppapi/cpp/completion_callback.h"
diff --git a/ppapi/examples/gles2/gles2.cc b/ppapi/examples/gles2/gles2.cc
index fee9364..e202fea 100644
--- a/ppapi/examples/gles2/gles2.cc
+++ b/ppapi/examples/gles2/gles2.cc
@@ -7,7 +7,6 @@
#include <iostream>
#include <sstream>
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_opengles2.h"
#include "ppapi/cpp/core.h"
diff --git a/ppapi/examples/ime/ime.cc b/ppapi/examples/ime/ime.cc
index e217145..f5e2e44 100644
--- a/ppapi/examples/ime/ime.cc
+++ b/ppapi/examples/ime/ime.cc
@@ -6,8 +6,8 @@
#include <utility>
#include <vector>
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/dev/font_dev.h"
#include "ppapi/cpp/dev/ime_input_event_dev.h"
@@ -701,8 +701,8 @@ class MyInstance : public pp::Instance {
// Prints a debug message.
void Log(const pp::Var& value) {
- const PPB_Console_Dev* console = reinterpret_cast<const PPB_Console_Dev*>(
- pp::Module::Get()->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE));
+ const PPB_Console* console = reinterpret_cast<const PPB_Console*>(
+ pp::Module::Get()->GetBrowserInterface(PPB_CONSOLE_INTERFACE));
if (!console)
return;
console->Log(pp_instance(), PP_LOGLEVEL_LOG, value.pp_var());
diff --git a/ppapi/examples/mouse_lock/mouse_lock.cc b/ppapi/examples/mouse_lock/mouse_lock.cc
index 4203622..3b1644f 100644
--- a/ppapi/examples/mouse_lock/mouse_lock.cc
+++ b/ppapi/examples/mouse_lock/mouse_lock.cc
@@ -6,7 +6,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include "ppapi/c/dev/ppb_console_dev.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/c/ppb_input_event.h"
#include "ppapi/cpp/graphics_2d.h"
#include "ppapi/cpp/image_data.h"
@@ -37,8 +37,8 @@ class MyInstance : public pp::Instance, public pp::MouseLock {
virtual ~MyInstance() {}
virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) {
- console_ = reinterpret_cast<const PPB_Console_Dev*>(
- pp::Module::Get()->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE));
+ console_ = reinterpret_cast<const PPB_Console*>(
+ pp::Module::Get()->GetBrowserInterface(PPB_CONSOLE_INTERFACE));
if (!console_)
return false;
@@ -226,7 +226,7 @@ class MyInstance : public pp::Instance, public pp::MouseLock {
pow(static_cast<double>(point_1_y - point_2_y), 2));
}
- void Log(PP_LogLevel_Dev level, const char* format, ...) {
+ void Log(PP_LogLevel level, const char* format, ...) {
va_list args;
va_start(args, format);
char buf[512];
@@ -249,7 +249,7 @@ class MyInstance : public pp::Instance, public pp::MouseLock {
pp::CompletionCallbackFactory<MyInstance> callback_factory_;
- const PPB_Console_Dev* console_;
+ const PPB_Console* console_;
pp::FlashFullscreen flash_fullscreen_;
diff --git a/ppapi/examples/video_decode/video_decode.cc b/ppapi/examples/video_decode/video_decode.cc
index 18c671c..a0469f3 100644
--- a/ppapi/examples/video_decode/video_decode.cc
+++ b/ppapi/examples/video_decode/video_decode.cc
@@ -11,8 +11,8 @@
#include <set>
#include <vector>
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/c/ppb_opengles2.h"
#include "ppapi/cpp/dev/video_decoder_client_dev.h"
#include "ppapi/cpp/dev/video_decoder_dev.h"
@@ -178,7 +178,7 @@ class VideoDecodeDemoInstance : public pp::Instance,
pp::CompletionCallbackFactory<VideoDecodeDemoInstance> callback_factory_;
// Unowned pointers.
- const PPB_Console_Dev* console_if_;
+ const PPB_Console* console_if_;
const PPB_Core* core_if_;
const PPB_OpenGLES2* gles2_if_;
@@ -226,8 +226,8 @@ VideoDecodeDemoInstance::VideoDecodeDemoInstance(PP_Instance instance,
swap_ticks_(0),
callback_factory_(this),
context_(NULL) {
- assert((console_if_ = static_cast<const PPB_Console_Dev*>(
- module->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE))));
+ assert((console_if_ = static_cast<const PPB_Console*>(
+ module->GetBrowserInterface(PPB_CONSOLE_INTERFACE))));
assert((core_if_ = static_cast<const PPB_Core*>(
module->GetBrowserInterface(PPB_CORE_INTERFACE))));
assert((gles2_if_ = static_cast<const PPB_OpenGLES2*>(
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index 7e3402e..a85f641 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -43,12 +43,12 @@
#include "native_client/src/trusted/plugin/utility.h"
#include "native_client/src/trusted/service_runtime/nacl_error_code.h"
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/dev/ppp_find_dev.h"
#include "ppapi/c/dev/ppp_printing_dev.h"
#include "ppapi/c/dev/ppp_selection_dev.h"
#include "ppapi/c/dev/ppp_zoom_dev.h"
#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/c/ppb_var.h"
#include "ppapi/c/ppp_input_event.h"
#include "ppapi/c/ppp_instance.h"
@@ -1914,9 +1914,9 @@ void Plugin::AddToConsole(const nacl::string& text) {
static_cast<uint32_t>(prefix_string.size()));
PP_Var str = var_interface->VarFromUtf8(text.c_str(),
static_cast<uint32_t>(text.size()));
- const PPB_Console_Dev* console_interface =
- static_cast<const PPB_Console_Dev*>(
- module->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE));
+ const PPB_Console* console_interface =
+ static_cast<const PPB_Console*>(
+ module->GetBrowserInterface(PPB_CONSOLE_INTERFACE));
console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str);
var_interface->Release(prefix);
var_interface->Release(str);
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
index 3201d01..1240569 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
@@ -9,7 +9,6 @@
#include "ppapi/c/ppb.h"
#include "ppapi/c/dev/ppb_audio_input_dev.h"
#include "ppapi/c/dev/ppb_buffer_dev.h"
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/dev/ppb_crypto_dev.h"
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
#include "ppapi/c/dev/ppb_device_ref_dev.h"
@@ -43,6 +42,7 @@
#include "ppapi/c/dev/ppp_zoom_dev.h"
#include "ppapi/c/ppb_audio.h"
#include "ppapi/c/ppb_audio_config.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/c/ppb_core.h"
#include "ppapi/c/ppb_file_io.h"
#include "ppapi/c/ppb_file_ref.h"
@@ -121,6 +121,7 @@ static int mystrcmp(const char* s1, const char *s2) {
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Audio_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioConfig_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioConfig_1_1;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Console_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Core_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileIO_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileIO_1_1;
@@ -171,7 +172,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLLoaderTrusted_0_3;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_2;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_3;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Buffer_Dev_0_4;
-static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Console_Dev_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Crypto_Dev_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_CursorControl_Dev_0_4;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_DeviceRef_Dev_0_1;
@@ -260,6 +260,22 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Instance_Private_0_1;
/* Not generating wrapper methods for PPB_AudioConfig_1_1 */
+/* Begin wrapper methods for PPB_Console_1_0 */
+
+static __attribute__((pnaclcall))
+void Pnacl_M25_PPB_Console_Log(PP_Instance instance, PP_LogLevel level, struct PP_Var value) {
+ const struct PPB_Console_1_0 *iface = Pnacl_WrapperInfo_PPB_Console_1_0.real_iface;
+ iface->Log(instance, level, value);
+}
+
+static __attribute__((pnaclcall))
+void Pnacl_M25_PPB_Console_LogWithSource(PP_Instance instance, PP_LogLevel level, struct PP_Var source, struct PP_Var value) {
+ const struct PPB_Console_1_0 *iface = Pnacl_WrapperInfo_PPB_Console_1_0.real_iface;
+ iface->LogWithSource(instance, level, source, value);
+}
+
+/* End wrapper methods for PPB_Console_1_0 */
+
/* Begin wrapper methods for PPB_Core_1_0 */
static __attribute__((pnaclcall))
@@ -1586,22 +1602,6 @@ void Pnacl_M25_PPB_AudioInput_Dev_Close(PP_Resource audio_input) {
/* Not generating wrapper methods for PPB_Buffer_Dev_0_4 */
-/* Begin wrapper methods for PPB_Console_Dev_0_1 */
-
-static __attribute__((pnaclcall))
-void Pnacl_M14_PPB_Console_Dev_Log(PP_Instance instance, PP_LogLevel_Dev level, struct PP_Var value) {
- const struct PPB_Console_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Console_Dev_0_1.real_iface;
- iface->Log(instance, level, value);
-}
-
-static __attribute__((pnaclcall))
-void Pnacl_M14_PPB_Console_Dev_LogWithSource(PP_Instance instance, PP_LogLevel_Dev level, struct PP_Var source, struct PP_Var value) {
- const struct PPB_Console_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Console_Dev_0_1.real_iface;
- iface->LogWithSource(instance, level, source, value);
-}
-
-/* End wrapper methods for PPB_Console_Dev_0_1 */
-
/* Not generating wrapper methods for PPB_Crypto_Dev_0_1 */
/* Not generating wrapper methods for PPB_CursorControl_Dev_0_4 */
@@ -3506,6 +3506,11 @@ static struct PP_Var Pnacl_M18_PPP_Instance_Private_GetInstanceObject(PP_Instanc
/* Not generating wrapper interface for PPB_AudioConfig_1_1 */
+struct PPB_Console_1_0 Pnacl_Wrappers_PPB_Console_1_0 = {
+ .Log = (void (*)(PP_Instance instance, PP_LogLevel level, struct PP_Var value))&Pnacl_M25_PPB_Console_Log,
+ .LogWithSource = (void (*)(PP_Instance instance, PP_LogLevel level, struct PP_Var source, struct PP_Var value))&Pnacl_M25_PPB_Console_LogWithSource
+};
+
struct PPB_Core_1_0 Pnacl_Wrappers_PPB_Core_1_0 = {
.AddRefResource = (void (*)(PP_Resource resource))&Pnacl_M14_PPB_Core_AddRefResource,
.ReleaseResource = (void (*)(PP_Resource resource))&Pnacl_M14_PPB_Core_ReleaseResource,
@@ -3833,11 +3838,6 @@ struct PPB_AudioInput_Dev_0_3 Pnacl_Wrappers_PPB_AudioInput_Dev_0_3 = {
/* Not generating wrapper interface for PPB_Buffer_Dev_0_4 */
-struct PPB_Console_Dev_0_1 Pnacl_Wrappers_PPB_Console_Dev_0_1 = {
- .Log = (void (*)(PP_Instance instance, PP_LogLevel_Dev level, struct PP_Var value))&Pnacl_M14_PPB_Console_Dev_Log,
- .LogWithSource = (void (*)(PP_Instance instance, PP_LogLevel_Dev level, struct PP_Var source, struct PP_Var value))&Pnacl_M14_PPB_Console_Dev_LogWithSource
-};
-
/* Not generating wrapper interface for PPB_Crypto_Dev_0_1 */
/* Not generating wrapper interface for PPB_CursorControl_Dev_0_4 */
@@ -4333,6 +4333,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioConfig_1_1 = {
.real_iface = NULL
};
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Console_1_0 = {
+ .iface_macro = PPB_CONSOLE_INTERFACE_1_0,
+ .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Console_1_0,
+ .real_iface = NULL
+};
+
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Core_1_0 = {
.iface_macro = PPB_CORE_INTERFACE_1_0,
.wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Core_1_0,
@@ -4633,12 +4639,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Buffer_Dev_0_4 = {
.real_iface = NULL
};
-static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Console_Dev_0_1 = {
- .iface_macro = PPB_CONSOLE_DEV_INTERFACE_0_1,
- .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Console_Dev_0_1,
- .real_iface = NULL
-};
-
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Crypto_Dev_0_1 = {
.iface_macro = PPB_CRYPTO_DEV_INTERFACE_0_1,
.wrapped_iface = NULL /* Still need slot for real_iface */,
@@ -5123,6 +5123,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_Audio_1_0,
&Pnacl_WrapperInfo_PPB_AudioConfig_1_0,
&Pnacl_WrapperInfo_PPB_AudioConfig_1_1,
+ &Pnacl_WrapperInfo_PPB_Console_1_0,
&Pnacl_WrapperInfo_PPB_Core_1_0,
&Pnacl_WrapperInfo_PPB_FileIO_1_0,
&Pnacl_WrapperInfo_PPB_FileIO_1_1,
@@ -5167,7 +5168,6 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_2,
&Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_3,
&Pnacl_WrapperInfo_PPB_Buffer_Dev_0_4,
- &Pnacl_WrapperInfo_PPB_Console_Dev_0_1,
&Pnacl_WrapperInfo_PPB_Crypto_Dev_0_1,
&Pnacl_WrapperInfo_PPB_CursorControl_Dev_0_4,
&Pnacl_WrapperInfo_PPB_DeviceRef_Dev_0_1,
diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi
index 55608ae..a636cd3 100644
--- a/ppapi/ppapi_sources.gypi
+++ b/ppapi/ppapi_sources.gypi
@@ -25,6 +25,7 @@
'c/ppb.h',
'c/ppb_audio.h',
'c/ppb_audio_config.h',
+ 'c/ppb_console.h',
'c/ppb_core.h',
'c/ppb_file_io.h',
'c/ppb_file_ref.h',
@@ -61,7 +62,6 @@
'c/dev/pp_video_dev.h',
'c/dev/ppb_buffer_dev.h',
'c/dev/ppb_char_set_dev.h',
- 'c/dev/ppb_console_dev.h',
'c/dev/ppb_cursor_control_dev.h',
'c/dev/ppb_device_ref_dev.h',
'c/dev/ppb_directory_reader_dev.h',
@@ -340,6 +340,8 @@
'tests/test_audio_config.h',
'tests/test_case.cc',
'tests/test_case.h',
+ 'tests/test_console.cc',
+ 'tests/test_console.h',
'tests/test_core.cc',
'tests/test_core.h',
'tests/test_cursor_control.cc',
diff --git a/ppapi/proxy/host_dispatcher.cc b/ppapi/proxy/host_dispatcher.cc
index 82568ab..7124c17 100644
--- a/ppapi/proxy/host_dispatcher.cc
+++ b/ppapi/proxy/host_dispatcher.cc
@@ -247,7 +247,7 @@ void HostDispatcher::OnHostMsgLogWithSource(PP_Instance instance,
int int_log_level,
const std::string& source,
const std::string& value) {
- PP_LogLevel_Dev level = static_cast<PP_LogLevel_Dev>(int_log_level);
+ PP_LogLevel level = static_cast<PP_LogLevel>(int_log_level);
if (instance) {
PpapiGlobals::Get()->LogWithSource(instance, level, source, value);
} else {
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index 1c4d7e0..719df25 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -9,7 +9,6 @@
#include "ppapi/c/dev/ppb_audio_input_dev.h"
#include "ppapi/c/dev/ppb_buffer_dev.h"
#include "ppapi/c/dev/ppb_char_set_dev.h"
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/dev/ppb_crypto_dev.h"
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
#include "ppapi/c/dev/ppb_device_ref_dev.h"
@@ -30,6 +29,7 @@
#include "ppapi/c/dev/ppb_view_dev.h"
#include "ppapi/c/ppb_audio_config.h"
#include "ppapi/c/ppb_audio.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/c/ppb_core.h"
#include "ppapi/c/ppb_file_io.h"
#include "ppapi/c/ppb_file_ref.h"
diff --git a/ppapi/proxy/plugin_dispatcher.cc b/ppapi/proxy/plugin_dispatcher.cc
index b864d99..1b9c80a 100644
--- a/ppapi/proxy/plugin_dispatcher.cc
+++ b/ppapi/proxy/plugin_dispatcher.cc
@@ -117,7 +117,7 @@ const void* PluginDispatcher::GetBrowserInterface(const char* interface_name) {
// static
void PluginDispatcher::LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) {
if (!g_live_dispatchers || !g_instance_to_dispatcher)
diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h
index 8d12e39d..2fb0395 100644
--- a/ppapi/proxy/plugin_dispatcher.h
+++ b/ppapi/proxy/plugin_dispatcher.h
@@ -14,9 +14,9 @@
#include "base/memory/weak_ptr.h"
#include "base/process.h"
#include "build/build_config.h"
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/pp_rect.h"
#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/proxy/dispatcher.h"
#include "ppapi/shared_impl/ppapi_preferences.h"
#include "ppapi/shared_impl/ppb_view_shared.h"
@@ -116,7 +116,7 @@ class PPAPI_PROXY_EXPORT PluginDispatcher
// invalid, to all instances associated with all dispatchers. Used for
// global log messages.
static void LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value);
diff --git a/ppapi/proxy/plugin_globals.cc b/ppapi/proxy/plugin_globals.cc
index 75a6968..1106a75 100644
--- a/ppapi/proxy/plugin_globals.cc
+++ b/ppapi/proxy/plugin_globals.cc
@@ -130,7 +130,7 @@ base::Lock* PluginGlobals::GetProxyLock() {
}
void PluginGlobals::LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) {
const std::string& fixed_up_source = source.empty() ? plugin_name_ : source;
@@ -138,7 +138,7 @@ void PluginGlobals::LogWithSource(PP_Instance instance,
}
void PluginGlobals::BroadcastLogWithSource(PP_Module /* module */,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) {
// Since we have only one module in a plugin process, broadcast is always
diff --git a/ppapi/proxy/plugin_globals.h b/ppapi/proxy/plugin_globals.h
index 0a79891..b323903 100644
--- a/ppapi/proxy/plugin_globals.h
+++ b/ppapi/proxy/plugin_globals.h
@@ -55,11 +55,11 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals {
virtual void PreCacheFontForFlash(const void* logfontw) OVERRIDE;
virtual base::Lock* GetProxyLock() OVERRIDE;
virtual void LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) OVERRIDE;
virtual void BroadcastLogWithSource(PP_Module module,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) OVERRIDE;
virtual MessageLoopShared* GetCurrentMessageLoop() OVERRIDE;
diff --git a/ppapi/shared_impl/ppapi_globals.h b/ppapi/shared_impl/ppapi_globals.h
index b03d35c..0573c98 100644
--- a/ppapi/shared_impl/ppapi_globals.h
+++ b/ppapi/shared_impl/ppapi_globals.h
@@ -10,9 +10,9 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/threading/thread_local.h" // For testing purposes only.
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_module.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/shared_impl/api_id.h"
#include "ppapi/shared_impl/ppapi_shared_export.h"
@@ -79,7 +79,7 @@ class PPAPI_SHARED_EXPORT PpapiGlobals {
// Logs the given string to the JS console. If "source" is empty, the name of
// the current module will be used, if it can be determined.
virtual void LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) = 0;
@@ -92,7 +92,7 @@ class PPAPI_SHARED_EXPORT PpapiGlobals {
// Note that in the plugin process, the module parameter is ignored since
// there is only one possible one.
virtual void BroadcastLogWithSource(PP_Module module,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) = 0;
diff --git a/ppapi/shared_impl/ppb_instance_shared.cc b/ppapi/shared_impl/ppb_instance_shared.cc
index dd46bec3a..8101de6 100644
--- a/ppapi/shared_impl/ppb_instance_shared.cc
+++ b/ppapi/shared_impl/ppb_instance_shared.cc
@@ -23,13 +23,13 @@ PPB_Instance_Shared::~PPB_Instance_Shared() {
}
void PPB_Instance_Shared::Log(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
PP_Var value) {
LogWithSource(instance, level, PP_MakeUndefined(), value);
}
void PPB_Instance_Shared::LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
PP_Var source,
PP_Var value) {
// The source defaults to empty if it's not a string. The PpapiGlobals
diff --git a/ppapi/shared_impl/ppb_instance_shared.h b/ppapi/shared_impl/ppb_instance_shared.h
index a1845d3..61ca56d 100644
--- a/ppapi/shared_impl/ppb_instance_shared.h
+++ b/ppapi/shared_impl/ppb_instance_shared.h
@@ -19,10 +19,10 @@ class PPAPI_SHARED_EXPORT PPB_Instance_Shared
// Implementation of some shared PPB_Instance_FunctionAPI functions.
virtual void Log(PP_Instance instance,
- PP_LogLevel_Dev log_level,
+ PP_LogLevel log_level,
PP_Var value) OVERRIDE;
virtual void LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev log_level,
+ PP_LogLevel log_level,
PP_Var source,
PP_Var value) OVERRIDE;
diff --git a/ppapi/shared_impl/resource.cc b/ppapi/shared_impl/resource.cc
index 88f908b..8b1f6f2 100644
--- a/ppapi/shared_impl/resource.cc
+++ b/ppapi/shared_impl/resource.cc
@@ -70,7 +70,7 @@ void Resource::OnReplyReceived(const proxy::ResourceMessageReplyParams& params,
NOTREACHED();
}
-void Resource::Log(PP_LogLevel_Dev level, const std::string& message) {
+void Resource::Log(PP_LogLevel level, const std::string& message) {
PpapiGlobals::Get()->LogWithSource(pp_instance(), level, std::string(),
message);
}
diff --git a/ppapi/shared_impl/resource.h b/ppapi/shared_impl/resource.h
index 46cb14c..286ebba 100644
--- a/ppapi/shared_impl/resource.h
+++ b/ppapi/shared_impl/resource.h
@@ -13,7 +13,7 @@
#include "base/memory/ref_counted.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_resource.h"
-#include "ppapi/c/dev/ppb_console_dev.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/shared_impl/host_resource.h"
// All resource types should be added here. This implements our hand-rolled
@@ -203,7 +203,7 @@ class PPAPI_SHARED_EXPORT Resource : public base::RefCounted<Resource> {
protected:
// Logs a message to the console from this resource.
- void Log(PP_LogLevel_Dev level, const std::string& message);
+ void Log(PP_LogLevel level, const std::string& message);
// Notifications for subclasses.
virtual void LastPluginRefWasDeleted() {}
diff --git a/ppapi/shared_impl/test_globals.cc b/ppapi/shared_impl/test_globals.cc
index b1dc0fe..cf19286 100644
--- a/ppapi/shared_impl/test_globals.cc
+++ b/ppapi/shared_impl/test_globals.cc
@@ -58,13 +58,13 @@ base::Lock* TestGlobals::GetProxyLock() {
}
void TestGlobals::LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) {
}
void TestGlobals::BroadcastLogWithSource(PP_Module module,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) {
}
diff --git a/ppapi/shared_impl/test_globals.h b/ppapi/shared_impl/test_globals.h
index ca67e77..ea23ec7 100644
--- a/ppapi/shared_impl/test_globals.h
+++ b/ppapi/shared_impl/test_globals.h
@@ -46,11 +46,11 @@ class TestGlobals : public PpapiGlobals {
virtual void PreCacheFontForFlash(const void* logfontw) OVERRIDE;
virtual base::Lock* GetProxyLock() OVERRIDE;
virtual void LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) OVERRIDE;
virtual void BroadcastLogWithSource(PP_Module module,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
const std::string& source,
const std::string& value) OVERRIDE;
virtual MessageLoopShared* GetCurrentMessageLoop() OVERRIDE;
diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h
index 6cc42a0..3dd64ab 100644
--- a/ppapi/tests/all_c_includes.h
+++ b/ppapi/tests/all_c_includes.h
@@ -13,7 +13,6 @@
#include "ppapi/c/dev/pp_video_dev.h"
#include "ppapi/c/dev/ppb_buffer_dev.h"
#include "ppapi/c/dev/ppb_char_set_dev.h"
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/dev/ppb_crypto_dev.h"
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
#include "ppapi/c/dev/ppb_device_ref_dev.h"
@@ -64,6 +63,7 @@
#include "ppapi/c/ppb.h"
#include "ppapi/c/ppb_audio.h"
#include "ppapi/c/ppb_audio_config.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/c/ppb_core.h"
#include "ppapi/c/ppb_file_io.h"
#include "ppapi/c/ppb_file_ref.h"
diff --git a/ppapi/tests/test_console.cc b/ppapi/tests/test_console.cc
new file mode 100644
index 0000000..f39defe
--- /dev/null
+++ b/ppapi/tests/test_console.cc
@@ -0,0 +1,38 @@
+// 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.
+
+#include "ppapi/tests/test_console.h"
+
+#include "ppapi/cpp/module.h"
+#include "ppapi/tests/testing_instance.h"
+
+REGISTER_TEST_CASE(Console);
+
+TestConsole::TestConsole(TestingInstance* instance)
+ : TestCase(instance),
+ console_interface_(NULL) {
+}
+
+bool TestConsole::Init() {
+ console_interface_ = static_cast<const PPB_Console*>(
+ pp::Module::Get()->GetBrowserInterface(PPB_CONSOLE_INTERFACE));
+ return !!console_interface_;
+}
+
+void TestConsole::RunTests(const std::string& filter) {
+ RUN_TEST(Smoke, filter);
+}
+
+std::string TestConsole::TestSmoke() {
+ // This test does not verify the log message actually reaches the console, but
+ // it does test that the interface exists and that it can be called without
+ // crashing.
+ pp::Var source(std::string("somewhere"));
+ pp::Var message(std::string("hello, world."));
+ console_interface_->Log(instance()->pp_instance(), PP_LOGLEVEL_ERROR,
+ message.pp_var());
+ console_interface_->LogWithSource(instance()->pp_instance(), PP_LOGLEVEL_LOG,
+ source.pp_var(), message.pp_var());
+ PASS();
+}
diff --git a/ppapi/tests/test_console.h b/ppapi/tests/test_console.h
new file mode 100644
index 0000000..1b2f55d9
--- /dev/null
+++ b/ppapi/tests/test_console.h
@@ -0,0 +1,27 @@
+// 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.
+
+#ifndef PPAPI_TESTS_TEST_CONSOLE_H_
+#define PPAPI_TESTS_TEST_CONSOLE_H_
+
+#include <string>
+
+#include "ppapi/c/ppb_console.h"
+#include "ppapi/tests/test_case.h"
+
+class TestConsole : public TestCase {
+ public:
+ explicit TestConsole(TestingInstance* instance);
+
+ // TestCase implementation.
+ virtual bool Init();
+ virtual void RunTests(const std::string& filter);
+
+ private:
+ std::string TestSmoke();
+
+ const PPB_Console* console_interface_;
+};
+
+#endif // PPAPI_TESTS_TEST_CONSOLE_H_
diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h
index d380cad..24c1642 100644
--- a/ppapi/thunk/interfaces_ppb_public_dev.h
+++ b/ppapi/thunk/interfaces_ppb_public_dev.h
@@ -7,7 +7,9 @@
#include "ppapi/thunk/interfaces_preamble.h"
-PROXIED_IFACE(PPB_Instance, PPB_CONSOLE_DEV_INTERFACE_0_1, PPB_Console_Dev_0_1)
+// Map the old dev console interface to the stable one (which is the same) to
+// keep Flash, etc. working.
+PROXIED_IFACE(PPB_Instance, "PPB_Console(Dev);0.1", PPB_Console_1_0)
PROXIED_IFACE(NoAPIName, PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4,
PPB_CursorControl_Dev_0_4)
PROXIED_IFACE(NoAPIName, PPB_FILECHOOSER_DEV_INTERFACE_0_5,
diff --git a/ppapi/thunk/interfaces_ppb_public_stable.h b/ppapi/thunk/interfaces_ppb_public_stable.h
index 6698943..c7ae59b6 100644
--- a/ppapi/thunk/interfaces_ppb_public_stable.h
+++ b/ppapi/thunk/interfaces_ppb_public_stable.h
@@ -54,6 +54,7 @@ PROXIED_IFACE(PPB_FileRef, PPB_FILEREF_INTERFACE_1_0, PPB_FileRef_1_0)
PROXIED_IFACE(PPB_FileSystem, PPB_FILESYSTEM_INTERFACE_1_0, PPB_FileSystem_1_0)
PROXIED_IFACE(PPB_Graphics3D, PPB_GRAPHICS_3D_INTERFACE_1_0, PPB_Graphics3D_1_0)
PROXIED_IFACE(PPB_ImageData, PPB_IMAGEDATA_INTERFACE_1_0, PPB_ImageData_1_0)
+PROXIED_IFACE(PPB_Instance, PPB_CONSOLE_INTERFACE_1_0, PPB_Console_1_0)
PROXIED_IFACE(PPB_Instance, PPB_GAMEPAD_INTERFACE_1_0, PPB_Gamepad_1_0)
PROXIED_IFACE(PPB_Instance, PPB_INSTANCE_INTERFACE_1_0, PPB_Instance_1_0)
PROXIED_IFACE(NoAPIName, PPB_GRAPHICS_2D_INTERFACE_1_0, PPB_Graphics2D_1_0)
diff --git a/ppapi/thunk/ppb_console_thunk.cc b/ppapi/thunk/ppb_console_thunk.cc
index a542e37..9ece35d 100644
--- a/ppapi/thunk/ppb_console_thunk.cc
+++ b/ppapi/thunk/ppb_console_thunk.cc
@@ -4,8 +4,8 @@
// From dev/ppb_console_dev.idl modified Mon Nov 19 09:22:44 2012.
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_instance_api.h"
@@ -17,14 +17,14 @@ namespace thunk {
namespace {
-void Log(PP_Instance instance, PP_LogLevel_Dev level, struct PP_Var value) {
+void Log(PP_Instance instance, PP_LogLevel level, struct PP_Var value) {
EnterInstance enter(instance);
if (enter.succeeded())
enter.functions()->Log(instance, level, value);
}
void LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev level,
+ PP_LogLevel level,
struct PP_Var source,
struct PP_Var value) {
EnterInstance enter(instance);
@@ -32,15 +32,15 @@ void LogWithSource(PP_Instance instance,
enter.functions()->LogWithSource(instance, level, source, value);
}
-const PPB_Console_Dev_0_1 g_ppb_console_dev_thunk_0_1 = {
+const PPB_Console_1_0 g_ppb_console_thunk_1_0 = {
&Log,
&LogWithSource,
};
} // namespace
-const PPB_Console_Dev_0_1* GetPPB_Console_Dev_0_1_Thunk() {
- return &g_ppb_console_dev_thunk_0_1;
+const PPB_Console_1_0* GetPPB_Console_1_0_Thunk() {
+ return &g_ppb_console_thunk_1_0;
}
} // namespace thunk
diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h
index 68f7a2b..0c53c8b 100644
--- a/ppapi/thunk/ppb_instance_api.h
+++ b/ppapi/thunk/ppb_instance_api.h
@@ -7,7 +7,6 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/dev/ppb_text_input_dev.h"
#include "ppapi/c/dev/ppb_url_util_dev.h"
#include "ppapi/c/pp_bool.h"
@@ -15,6 +14,7 @@
#include "ppapi/c/pp_size.h"
#include "ppapi/c/pp_time.h"
#include "ppapi/c/ppb_audio_config.h"
+#include "ppapi/c/ppb_console.h"
#include "ppapi/c/ppb_gamepad.h"
#include "ppapi/c/ppb_instance.h"
#include "ppapi/c/ppb_mouse_cursor.h"
@@ -71,10 +71,10 @@ class PPB_Instance_API {
// Console.
virtual void Log(PP_Instance instance,
- PP_LogLevel_Dev log_level,
+ PP_LogLevel log_level,
PP_Var value) = 0;
virtual void LogWithSource(PP_Instance instance,
- PP_LogLevel_Dev log_level,
+ PP_LogLevel log_level,
PP_Var source,
PP_Var value) = 0;