summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authordmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 04:55:55 +0000
committerdmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 04:55:55 +0000
commit9c6e0de10e2cbe72e3368c345b31f5ba18e511e3 (patch)
tree3443d267a3ae72f8108fc6baa7659aa4159588ab /ppapi
parentfadb1f7f903cbe3007c3f42b0f820b06e14e15ed (diff)
downloadchromium_src-9c6e0de10e2cbe72e3368c345b31f5ba18e511e3.zip
chromium_src-9c6e0de10e2cbe72e3368c345b31f5ba18e511e3.tar.gz
chromium_src-9c6e0de10e2cbe72e3368c345b31f5ba18e511e3.tar.bz2
PPAPI: Move PPB_ArrayBuffer out of Dev.
BUG=103435 TEST=N/A Review URL: http://codereview.chromium.org/9107046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/ppb_var_array_buffer.idl (renamed from ppapi/api/dev/ppb_var_array_buffer_dev.idl)10
-rw-r--r--ppapi/c/ppb_var_array_buffer.h (renamed from ppapi/c/dev/ppb_var_array_buffer_dev.h)21
-rw-r--r--ppapi/cpp/dev/var_array_buffer_dev.cc78
-rw-r--r--ppapi/cpp/var_array_buffer.cc77
-rw-r--r--ppapi/cpp/var_array_buffer.h (renamed from ppapi/cpp/dev/var_array_buffer_dev.h)40
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc8
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h4
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.cc6
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.h4
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc2
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_var.cc6
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_var.h6
-rw-r--r--ppapi/ppapi_sources.gypi6
-rw-r--r--ppapi/shared_impl/ppb_var_shared.cc10
-rw-r--r--ppapi/shared_impl/ppb_var_shared.h4
-rw-r--r--ppapi/tests/all_c_includes.h2
-rw-r--r--ppapi/tests/all_cpp_includes.h2
-rw-r--r--ppapi/tests/test_post_message.cc6
-rw-r--r--ppapi/tests/test_websocket.cc6
-rw-r--r--ppapi/tests/test_websocket.h4
20 files changed, 151 insertions, 151 deletions
diff --git a/ppapi/api/dev/ppb_var_array_buffer_dev.idl b/ppapi/api/ppb_var_array_buffer.idl
index 2d3116b..87a545a 100644
--- a/ppapi/api/dev/ppb_var_array_buffer_dev.idl
+++ b/ppapi/api/ppb_var_array_buffer.idl
@@ -4,22 +4,22 @@
*/
/**
- * This file defines the <code>PPB_VarArrayBuffer_Dev</code> struct.
+ * This file defines the <code>PPB_VarArrayBuffer</code> struct.
*/
label Chrome {
- M18 = 0.2
+ M18 = 1.0
};
/**
- * PPB_VarArrayBuffer_Dev API. This provides a way to interact with JavaScript
+ * PPB_VarArrayBuffer API. This provides a way to interact with JavaScript
* ArrayBuffers, which represent a contiguous sequence of bytes. To manage the
* reference count for a VarArrayBuffer, please see PPB_Var. Note that
* these Vars are not part of the embedding page's DOM, and can only be shared
* with JavaScript via pp::Instance's PostMessage and HandleMessage functions.
*/
-[macro="PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE"]
-interface PPB_VarArrayBuffer_Dev {
+[macro="PPB_VAR_ARRAY_BUFFER_INTERFACE"]
+interface PPB_VarArrayBuffer {
/**
* Create a zero-initialized VarArrayBuffer.
*
diff --git a/ppapi/c/dev/ppb_var_array_buffer_dev.h b/ppapi/c/ppb_var_array_buffer.h
index 272c8e2..c9c285f 100644
--- a/ppapi/c/dev/ppb_var_array_buffer_dev.h
+++ b/ppapi/c/ppb_var_array_buffer.h
@@ -3,23 +3,22 @@
* found in the LICENSE file.
*/
-/* From dev/ppb_var_array_buffer_dev.idl modified Thu Jan 26 11:25:54 2012. */
+/* From ppb_var_array_buffer.idl modified Thu Jan 26 14:50:50 2012. */
-#ifndef PPAPI_C_DEV_PPB_VAR_ARRAY_BUFFER_DEV_H_
-#define PPAPI_C_DEV_PPB_VAR_ARRAY_BUFFER_DEV_H_
+#ifndef PPAPI_C_PPB_VAR_ARRAY_BUFFER_H_
+#define PPAPI_C_PPB_VAR_ARRAY_BUFFER_H_
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_var.h"
-#define PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE_0_2 "PPB_VarArrayBuffer(Dev);0.2"
-#define PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE \
- PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE_0_2
+#define PPB_VAR_ARRAY_BUFFER_INTERFACE_1_0 "PPB_VarArrayBuffer;1.0"
+#define PPB_VAR_ARRAY_BUFFER_INTERFACE PPB_VAR_ARRAY_BUFFER_INTERFACE_1_0
/**
* @file
- * This file defines the <code>PPB_VarArrayBuffer_Dev</code> struct.
+ * This file defines the <code>PPB_VarArrayBuffer</code> struct.
*/
@@ -28,13 +27,13 @@
* @{
*/
/**
- * PPB_VarArrayBuffer_Dev API. This provides a way to interact with JavaScript
+ * PPB_VarArrayBuffer API. This provides a way to interact with JavaScript
* ArrayBuffers, which represent a contiguous sequence of bytes. To manage the
* reference count for a VarArrayBuffer, please see PPB_Var. Note that
* these Vars are not part of the embedding page's DOM, and can only be shared
* with JavaScript via pp::Instance's PostMessage and HandleMessage functions.
*/
-struct PPB_VarArrayBuffer_Dev_0_2 {
+struct PPB_VarArrayBuffer_1_0 {
/**
* Create a zero-initialized VarArrayBuffer.
*
@@ -94,10 +93,10 @@ struct PPB_VarArrayBuffer_Dev_0_2 {
void (*Unmap)(struct PP_Var array);
};
-typedef struct PPB_VarArrayBuffer_Dev_0_2 PPB_VarArrayBuffer_Dev;
+typedef struct PPB_VarArrayBuffer_1_0 PPB_VarArrayBuffer;
/**
* @}
*/
-#endif /* PPAPI_C_DEV_PPB_VAR_ARRAY_BUFFER_DEV_H_ */
+#endif /* PPAPI_C_PPB_VAR_ARRAY_BUFFER_H_ */
diff --git a/ppapi/cpp/dev/var_array_buffer_dev.cc b/ppapi/cpp/dev/var_array_buffer_dev.cc
deleted file mode 100644
index 47ad9b3..0000000
--- a/ppapi/cpp/dev/var_array_buffer_dev.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// 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/cpp/dev/var_array_buffer_dev.h"
-
-#include <limits>
-
-#include "ppapi/c/dev/ppb_var_array_buffer_dev.h"
-#include "ppapi/cpp/logging.h"
-#include "ppapi/cpp/module_impl.h"
-
-namespace pp {
-
-namespace {
-
-template <> const char* interface_name<PPB_VarArrayBuffer_Dev>() {
- return PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE;
-}
-
-} // namespace
-
-VarArrayBuffer_Dev::VarArrayBuffer_Dev(const Var& var) : Var(var) {
- if (!var.is_array_buffer()) {
- PP_NOTREACHED();
- var_ = PP_MakeNull();
- }
-}
-
-VarArrayBuffer_Dev::VarArrayBuffer_Dev(uint32_t size_in_bytes) {
- if (has_interface<PPB_VarArrayBuffer_Dev>()) {
- var_ = get_interface<PPB_VarArrayBuffer_Dev>()->Create(size_in_bytes);
- needs_release_ = true;
- } else {
- PP_NOTREACHED();
- var_ = PP_MakeNull();
- }
-}
-
-pp::VarArrayBuffer_Dev& VarArrayBuffer_Dev::operator=(
- const VarArrayBuffer_Dev& other) {
- Var::operator=(other);
- return *this;
-}
-
-pp::Var& VarArrayBuffer_Dev::operator=(const Var& other) {
- if (other.is_array_buffer()) {
- return Var::operator=(other);
- } else {
- PP_NOTREACHED();
- return *this;
- }
-}
-
-uint32_t VarArrayBuffer_Dev::ByteLength() const {
- uint32_t byte_length = std::numeric_limits<uint32_t>::max();
- if (is_array_buffer() && has_interface<PPB_VarArrayBuffer_Dev>())
- get_interface<PPB_VarArrayBuffer_Dev>()->ByteLength(var_, &byte_length);
- else
- PP_NOTREACHED();
- return byte_length;
-}
-
-void* VarArrayBuffer_Dev::Map() {
- if (is_array_buffer() && has_interface<PPB_VarArrayBuffer_Dev>())
- return get_interface<PPB_VarArrayBuffer_Dev>()->Map(var_);
- PP_NOTREACHED();
- return NULL;
-}
-
-void VarArrayBuffer_Dev::Unmap() {
- if (is_array_buffer() && has_interface<PPB_VarArrayBuffer_Dev>())
- get_interface<PPB_VarArrayBuffer_Dev>()->Unmap(var_);
- else
- PP_NOTREACHED();
-}
-
-} // namespace pp
diff --git a/ppapi/cpp/var_array_buffer.cc b/ppapi/cpp/var_array_buffer.cc
new file mode 100644
index 0000000..a4104fd
--- /dev/null
+++ b/ppapi/cpp/var_array_buffer.cc
@@ -0,0 +1,77 @@
+// 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/cpp/var_array_buffer.h"
+
+#include <limits>
+
+#include "ppapi/c/ppb_var_array_buffer.h"
+#include "ppapi/cpp/logging.h"
+#include "ppapi/cpp/module_impl.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_VarArrayBuffer>() {
+ return PPB_VAR_ARRAY_BUFFER_INTERFACE;
+}
+
+} // namespace
+
+VarArrayBuffer::VarArrayBuffer(const Var& var) : Var(var) {
+ if (!var.is_array_buffer()) {
+ PP_NOTREACHED();
+ var_ = PP_MakeNull();
+ }
+}
+
+VarArrayBuffer::VarArrayBuffer(uint32_t size_in_bytes) {
+ if (has_interface<PPB_VarArrayBuffer>()) {
+ var_ = get_interface<PPB_VarArrayBuffer>()->Create(size_in_bytes);
+ needs_release_ = true;
+ } else {
+ PP_NOTREACHED();
+ var_ = PP_MakeNull();
+ }
+}
+
+pp::VarArrayBuffer& VarArrayBuffer::operator=(const VarArrayBuffer& other) {
+ Var::operator=(other);
+ return *this;
+}
+
+pp::Var& VarArrayBuffer::operator=(const Var& other) {
+ if (other.is_array_buffer()) {
+ return Var::operator=(other);
+ } else {
+ PP_NOTREACHED();
+ return *this;
+ }
+}
+
+uint32_t VarArrayBuffer::ByteLength() const {
+ uint32_t byte_length = std::numeric_limits<uint32_t>::max();
+ if (is_array_buffer() && has_interface<PPB_VarArrayBuffer>())
+ get_interface<PPB_VarArrayBuffer>()->ByteLength(var_, &byte_length);
+ else
+ PP_NOTREACHED();
+ return byte_length;
+}
+
+void* VarArrayBuffer::Map() {
+ if (is_array_buffer() && has_interface<PPB_VarArrayBuffer>())
+ return get_interface<PPB_VarArrayBuffer>()->Map(var_);
+ PP_NOTREACHED();
+ return NULL;
+}
+
+void VarArrayBuffer::Unmap() {
+ if (is_array_buffer() && has_interface<PPB_VarArrayBuffer>())
+ get_interface<PPB_VarArrayBuffer>()->Unmap(var_);
+ else
+ PP_NOTREACHED();
+}
+
+} // namespace pp
diff --git a/ppapi/cpp/dev/var_array_buffer_dev.h b/ppapi/cpp/var_array_buffer.h
index 6f7c18a..0c97d99 100644
--- a/ppapi/cpp/dev/var_array_buffer_dev.h
+++ b/ppapi/cpp/var_array_buffer.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef PPAPI_CPP_DEV_VAR_ARRAY_BUFFER_DEV_H_
-#define PPAPI_CPP_DEV_VAR_ARRAY_BUFFER_DEV_H_
+#ifndef PPAPI_CPP_VAR_ARRAY_BUFFER_H_
+#define PPAPI_CPP_VAR_ARRAY_BUFFER_H_
#include "ppapi/cpp/var.h"
@@ -12,31 +12,37 @@
namespace pp {
-/// VarArrayBuffer_Dev provides a way to interact with JavaScript ArrayBuffers,
+/// VarArrayBuffer provides a way to interact with JavaScript ArrayBuffers,
/// which represent a contiguous sequence of bytes. Note that
-/// VarArrayBuffer_Devs are not part of the embedding page's DOM, and can only
+/// VarArrayBuffers are not part of the embedding page's DOM, and can only
/// be shared with JavaScript via pp::Instance's PostMessage and HandleMessage
/// functions.
-class VarArrayBuffer_Dev : public Var {
+class VarArrayBuffer : public Var {
public:
- /// Contruct a VarArrayBuffer_Dev given a var for which is_array_buffer() is
+ /// Contruct a VarArrayBuffer given a var for which is_array_buffer() is
/// true. This will refer to the same ArrayBuffer as var, but allows you to
- /// access methods specific to VarArrayBuffer_Dev.
+ /// access methods specific to VarArrayBuffer.
///
/// @param[in] var An ArrayBuffer Var.
- explicit VarArrayBuffer_Dev(const Var& var);
+ explicit VarArrayBuffer(const Var& var);
+
+ /// Construct a new VarArrayBuffer_Dev which is size_in_bytes bytes long and
+ /// initialized to zero.
+ ///
+ /// @param[in] size_in_bytes The size of the constructed ArrayBuffer in bytes.
+ explicit VarArrayBuffer(uint32_t size_in_bytes);
/// Copy constructor.
- VarArrayBuffer_Dev(const VarArrayBuffer_Dev& buffer) : Var(buffer) {}
+ VarArrayBuffer(const VarArrayBuffer& buffer) : Var(buffer) {}
- virtual ~VarArrayBuffer_Dev() {}
+ virtual ~VarArrayBuffer() {}
/// This function assigns one VarArrayBuffer to another VarArrayBuffer.
///
/// @param[in] other The VarArrayBuffer to be assigned.
///
/// @return The resulting VarArrayBuffer.
- VarArrayBuffer_Dev& operator=(const VarArrayBuffer_Dev& other);
+ VarArrayBuffer& operator=(const VarArrayBuffer& other);
/// This function assigns one VarArrayBuffer to another VarArrayBuffer. Var's
/// assignment operator is overloaded here so that we can check for assigning
@@ -47,15 +53,9 @@ class VarArrayBuffer_Dev : public Var {
/// @return The resulting VarArrayBuffer (as a Var&).
virtual Var& operator=(const Var& other);
- /// Construct a new VarArrayBuffer_Dev which is size_in_bytes bytes long and
- /// initialized to zero.
- ///
- /// @param[in] size_in_bytes The size of the constructed ArrayBuffer in bytes.
- VarArrayBuffer_Dev(uint32_t size_in_bytes);
-
- /// Return the length of the VarArrayBuffer_Dev in bytes.
+ /// Return the length of the VarArrayBuffer in bytes.
///
- /// @return The length of the VarArrayBuffer_Dev in bytes.
+ /// @return The length of the VarArrayBuffer in bytes.
uint32_t ByteLength() const;
/// Maps the ArrayBuffer in to the module's address space and returns a
@@ -82,4 +82,4 @@ class VarArrayBuffer_Dev : public Var {
} // namespace pp
-#endif // PPAPI_CPP_DEV_VAR_ARRAY_BUFFER_DEV_H_
+#endif // PPAPI_CPP_VAR_ARRAY_BUFFER_H_
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
index 001158e..284e56d 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
@@ -318,10 +318,10 @@ const PPB_Var* PPBVarInterface() {
return ppb;
}
-const PPB_VarArrayBuffer_Dev* PPBVarArrayBufferInterface() {
- static const PPB_VarArrayBuffer_Dev* ppb =
- static_cast<const PPB_VarArrayBuffer_Dev*>(
- GetBrowserInterfaceSafe(PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE));
+const PPB_VarArrayBuffer* PPBVarArrayBufferInterface() {
+ static const PPB_VarArrayBuffer* ppb =
+ static_cast<const PPB_VarArrayBuffer*>(
+ GetBrowserInterfaceSafe(PPB_VAR_ARRAY_BUFFER_INTERFACE));
return ppb;
}
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h
index 8d63f38..913cf10 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h
@@ -12,7 +12,6 @@
#include "ppapi/c/dev/ppb_memory_dev.h"
#include "ppapi/c/dev/ppb_scrollbar_dev.h"
#include "ppapi/c/dev/ppb_testing_dev.h"
-#include "ppapi/c/dev/ppb_var_array_buffer_dev.h"
#include "ppapi/c/dev/ppb_websocket_dev.h"
#include "ppapi/c/dev/ppb_widget_dev.h"
#include "ppapi/c/dev/ppb_zoom_dev.h"
@@ -35,6 +34,7 @@
#include "ppapi/c/ppb_url_request_info.h"
#include "ppapi/c/ppb_url_response_info.h"
#include "ppapi/c/ppb_var.h"
+#include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/c/ppb_view.h"
#include "ppapi/c/private/ppb_net_address_private.h"
#include "ppapi/c/private/ppb_pdf.h"
@@ -130,7 +130,7 @@ const PPB_URLLoader* PPBURLLoaderInterface();
const PPB_URLRequestInfo* PPBURLRequestInfoInterface();
const PPB_URLResponseInfo* PPBURLResponseInfoInterface();
const PPB_Var* PPBVarInterface(); // shared
-const PPB_VarArrayBuffer_Dev* PPBVarArrayBufferInterface(); // shared
+const PPB_VarArrayBuffer* PPBVarArrayBufferInterface(); // shared
const PPB_View* PPBViewInterface();
const PPB_WheelInputEvent* PPBWheelInputEventInterface();
const PPB_WebSocket_Dev* PPBWebSocketInterface();
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.cc
index 1aef642..493cacb 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.cc
@@ -85,9 +85,9 @@ const PPB_Var* PPBVarInterface() {
GetBrowserInterfaceSafe(PPB_VAR_INTERFACE));
}
-const PPB_VarArrayBuffer_Dev* PPBVarArrayBufferInterface() {
- return static_cast<const PPB_VarArrayBuffer_Dev*>(
- GetBrowserInterfaceSafe(PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE));
+const PPB_VarArrayBuffer* PPBVarArrayBufferInterface() {
+ return static_cast<const PPB_VarArrayBuffer*>(
+ GetBrowserInterfaceSafe(PPB_VAR_ARRAY_BUFFER_INTERFACE));
}
const PPB_WebSocket_Dev* PPBWebSocketInterface() {
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.h b/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.h
index 18ea331..fbcba2d 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.h
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.h
@@ -6,7 +6,6 @@
#define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_GLOBALS_H_
#include "ppapi/c/dev/ppb_memory_dev.h"
-#include "ppapi/c/dev/ppb_var_array_buffer_dev.h"
#include "ppapi/c/dev/ppb_websocket_dev.h"
#include "ppapi/c/dev/ppp_find_dev.h"
#include "ppapi/c/dev/ppp_printing_dev.h"
@@ -18,6 +17,7 @@
#include "ppapi/c/ppb.h"
#include "ppapi/c/ppb_core.h"
#include "ppapi/c/ppb_var.h"
+#include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/c/ppp_input_event.h"
#include "ppapi/c/ppp_instance.h"
#include "ppapi/c/ppp_messaging.h"
@@ -55,7 +55,7 @@ const void* GetBrowserInterfaceSafe(const char* interface_name);
const PPB_Core* PPBCoreInterface(); // shared
const PPB_Memory_Dev* PPBMemoryInterface(); // shared
const PPB_Var* PPBVarInterface(); // shared
-const PPB_VarArrayBuffer_Dev* PPBVarArrayBufferInterface(); // shared
+const PPB_VarArrayBuffer* PPBVarArrayBufferInterface(); // shared
const PPB_WebSocket_Dev* PPBWebSocketInterface();
// Support for getting PPP_ plugin interfaces.
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
index b57a8d4..1efbab9 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
@@ -98,7 +98,7 @@ InterfaceMapElement interface_map[] = {
{ PPB_URLREQUESTINFO_INTERFACE, PluginURLRequestInfo::GetInterface(), true },
{ PPB_URLRESPONSEINFO_INTERFACE, PluginURLResponseInfo::GetInterface(),
true },
- { PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE, PluginVar::GetArrayBufferInterface(),
+ { PPB_VAR_ARRAY_BUFFER_INTERFACE, PluginVar::GetArrayBufferInterface(),
true },
{ PPB_VAR_INTERFACE, PluginVar::GetInterface(), true },
{ PPB_VAR_INTERFACE_1_0, PluginVar::GetInterface1_0(), true },
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_var.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_var.cc
index b642eb0..d9700da 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_var.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_var.cc
@@ -118,6 +118,8 @@ void* Map(PP_Var var) {
PluginVar::DebugString(var).c_str());
SharedArrayBufferProxyVar buffer_var = ArrayBufferProxyVar::CastFromProxyVar(
ProxyVarCache::GetInstance().SharedProxyVarForVar(var));
+ if (!buffer_var)
+ return NULL;
void* data = buffer_var->buffer();
DebugPrintf("PPB_VarArrayBuffer::Map: buffer=%p\n", data);
return data;
@@ -151,8 +153,8 @@ const PPB_Var_1_0* PluginVar::GetInterface1_0() {
return &var_interface;
}
-const PPB_VarArrayBuffer_Dev* PluginVar::GetArrayBufferInterface() {
- static const PPB_VarArrayBuffer_Dev interface = {
+const PPB_VarArrayBuffer* PluginVar::GetArrayBufferInterface() {
+ static const PPB_VarArrayBuffer interface = {
CreateArrayBuffer,
ByteLength,
Map,
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_var.h b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_var.h
index d6cb40e..21f8169 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_var.h
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_var.h
@@ -9,9 +9,9 @@
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/portability.h"
-#include "ppapi/c/dev/ppb_var_array_buffer_dev.h"
#include "ppapi/c/pp_var.h"
#include "ppapi/c/ppb_var.h"
+#include "ppapi/c/ppb_var_array_buffer.h"
namespace ppapi_proxy {
@@ -25,8 +25,8 @@ class PluginVar {
// Returns the 1.0 interface to support backwards-compatibility.
static const PPB_Var_1_0* GetInterface1_0();
- // Returns an interface pointer for the PPB_VarArrayBuffer_Dev interface.
- static const PPB_VarArrayBuffer_Dev* GetArrayBufferInterface();
+ // Returns an interface pointer for the PPB_VarArrayBuffer interface.
+ static const PPB_VarArrayBuffer* GetArrayBufferInterface();
// String helpers.
static PP_Var StringToPPVar(const std::string& str);
diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi
index e7b869c..3f69a6c 100644
--- a/ppapi/ppapi_sources.gypi
+++ b/ppapi/ppapi_sources.gypi
@@ -41,6 +41,7 @@
'c/ppb_url_request_info.h',
'c/ppb_url_response_info.h',
'c/ppb_var.h',
+ 'c/ppb_var_array_buffer.h',
'c/ppb_view.h',
'c/ppp.h',
'c/ppp_graphics_3d.h',
@@ -70,7 +71,6 @@
'c/dev/ppb_scrollbar_dev.h',
'c/dev/ppb_testing_dev.h',
'c/dev/ppb_url_util_dev.h',
- 'c/dev/ppb_var_array_buffer_dev.h',
'c/dev/ppb_video_decoder_dev.h',
'c/dev/ppb_websocket_dev.h',
'c/dev/ppb_widget_dev.h',
@@ -169,6 +169,8 @@
'cpp/url_response_info.h',
'cpp/var.cc',
'cpp/var.h',
+ 'cpp/var_array_buffer.cc',
+ 'cpp/var_array_buffer.h',
'cpp/view.cc',
'cpp/view.h',
@@ -209,8 +211,6 @@
'cpp/dev/text_input_dev.h',
'cpp/dev/url_util_dev.cc',
'cpp/dev/url_util_dev.h',
- 'cpp/dev/var_array_buffer_dev.cc',
- 'cpp/dev/var_array_buffer_dev.h',
'cpp/dev/video_capture_client_dev.cc',
'cpp/dev/video_capture_client_dev.h',
'cpp/dev/video_capture_dev.cc',
diff --git a/ppapi/shared_impl/ppb_var_shared.cc b/ppapi/shared_impl/ppb_var_shared.cc
index 3fb1c03..107058a 100644
--- a/ppapi/shared_impl/ppb_var_shared.cc
+++ b/ppapi/shared_impl/ppb_var_shared.cc
@@ -6,8 +6,8 @@
#include <limits>
-#include "ppapi/c/dev/ppb_var_array_buffer_dev.h"
#include "ppapi/c/ppb_var.h"
+#include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/c/pp_var.h"
#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/proxy_lock.h"
@@ -68,7 +68,7 @@ const PPB_Var_1_0 var_interface1_0 = {
};
-// PPB_VarArrayBuffer_Dev methods ----------------------------------------------
+// PPB_VarArrayBuffer methods --------------------------------------------------
PP_Var CreateArrayBufferVar(uint32_t size_in_bytes) {
return PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(
@@ -96,7 +96,7 @@ void Unmap(PP_Var array) {
buffer->Unmap();
}
-const PPB_VarArrayBuffer_Dev var_arraybuffer_interface = {
+const PPB_VarArrayBuffer_1_0 var_arraybuffer_interface = {
&CreateArrayBufferVar,
&ByteLength,
&Map,
@@ -116,8 +116,8 @@ const PPB_Var_1_0* PPB_Var_Shared::GetVarInterface1_0() {
}
// static
-const PPB_VarArrayBuffer_Dev* PPB_Var_Shared::GetVarArrayBufferInterface() {
- return &var_arraybuffer_interface;
+const PPB_VarArrayBuffer_1_0* PPB_Var_Shared::GetVarArrayBufferInterface1_0() {
+ return &var_arraybuffer_interface;
}
} // namespace ppapi
diff --git a/ppapi/shared_impl/ppb_var_shared.h b/ppapi/shared_impl/ppb_var_shared.h
index f8b622a..88078ba 100644
--- a/ppapi/shared_impl/ppb_var_shared.h
+++ b/ppapi/shared_impl/ppb_var_shared.h
@@ -8,7 +8,7 @@
#include "ppapi/c/pp_module.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/ppb_var.h"
-#include "ppapi/c/dev/ppb_var_array_buffer_dev.h"
+#include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/shared_impl/ppapi_shared_export.h"
struct PP_Var;
@@ -19,7 +19,7 @@ class PPAPI_SHARED_EXPORT PPB_Var_Shared {
public:
static const PPB_Var_1_1* GetVarInterface1_1();
static const PPB_Var_1_0* GetVarInterface1_0();
- static const PPB_VarArrayBuffer_Dev* GetVarArrayBufferInterface();
+ static const PPB_VarArrayBuffer_1_0* GetVarArrayBufferInterface1_0();
};
} // namespace ppapi
diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h
index 01dd072..46f2fcf 100644
--- a/ppapi/tests/all_c_includes.h
+++ b/ppapi/tests/all_c_includes.h
@@ -32,7 +32,6 @@
#include "ppapi/c/dev/ppb_text_input_dev.h"
#include "ppapi/c/dev/ppb_transport_dev.h"
#include "ppapi/c/dev/ppb_url_util_dev.h"
-#include "ppapi/c/dev/ppb_var_array_buffer_dev.h"
#include "ppapi/c/dev/ppb_var_deprecated.h"
#include "ppapi/c/dev/ppb_video_decoder_dev.h"
#include "ppapi/c/dev/ppb_video_layer_dev.h"
@@ -84,6 +83,7 @@
#include "ppapi/c/ppb_url_loader.h"
#include "ppapi/c/ppb_url_request_info.h"
#include "ppapi/c/ppb_url_response_info.h"
+#include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/c/ppp.h"
#include "ppapi/c/ppp_graphics_3d.h"
#include "ppapi/c/ppp_input_event.h"
diff --git a/ppapi/tests/all_cpp_includes.h b/ppapi/tests/all_cpp_includes.h
index 5bd6d50..481d627 100644
--- a/ppapi/tests/all_cpp_includes.h
+++ b/ppapi/tests/all_cpp_includes.h
@@ -30,7 +30,6 @@
#include "ppapi/cpp/dev/text_input_dev.h"
#include "ppapi/cpp/dev/transport_dev.h"
#include "ppapi/cpp/dev/url_util_dev.h"
-#include "ppapi/cpp/dev/var_array_buffer_dev.h"
#include "ppapi/cpp/dev/video_decoder_dev.h"
#include "ppapi/cpp/dev/websocket_dev.h"
#include "ppapi/cpp/dev/widget_client_dev.h"
@@ -59,6 +58,7 @@
#include "ppapi/cpp/url_request_info.h"
#include "ppapi/cpp/url_response_info.h"
#include "ppapi/cpp/var.h"
+#include "ppapi/cpp/var_array_buffer.h"
#include "ppapi/utility/graphics/paint_aggregator.h"
#include "ppapi/utility/graphics/paint_manager.h"
#include "ppapi/utility/non_thread_safe_ref_count.h"
diff --git a/ppapi/tests/test_post_message.cc b/ppapi/tests/test_post_message.cc
index a79676b..94b47de 100644
--- a/ppapi/tests/test_post_message.cc
+++ b/ppapi/tests/test_post_message.cc
@@ -9,9 +9,9 @@
#include "ppapi/c/dev/ppb_testing_dev.h"
#include "ppapi/c/pp_var.h"
-#include "ppapi/cpp/dev/var_array_buffer_dev.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/var.h"
+#include "ppapi/cpp/var_array_buffer.h"
#include "ppapi/tests/pp_thread.h"
#include "ppapi/tests/test_utils.h"
#include "ppapi/tests/testing_instance.h"
@@ -260,7 +260,7 @@ std::string TestPostMessage::TestSendingArrayBuffer() {
const std::string kSizeAsString(size_stream.str());
// Create an appropriately sized array buffer with test_data[i] == i.
- pp::VarArrayBuffer_Dev test_data(sizes[i]);
+ pp::VarArrayBuffer test_data(sizes[i]);
if (sizes[i] > 0)
ASSERT_NE(NULL, test_data.Map());
// Make sure we can Unmap/Map successfully (there's not really any way to
@@ -313,7 +313,7 @@ std::string TestPostMessage::TestSendingArrayBuffer() {
ASSERT_EQ(message_data_.size(), 0);
ASSERT_EQ(WaitForMessages(), 1);
ASSERT_TRUE(message_data_.back().is_array_buffer());
- pp::VarArrayBuffer_Dev received(message_data_.back());
+ pp::VarArrayBuffer received(message_data_.back());
message_data_.clear();
ASSERT_EQ(test_data.ByteLength(), received.ByteLength());
unsigned char* received_buff = static_cast<unsigned char*>(received.Map());
diff --git a/ppapi/tests/test_websocket.cc b/ppapi/tests/test_websocket.cc
index 368079e..c82eafb 100644
--- a/ppapi/tests/test_websocket.cc
+++ b/ppapi/tests/test_websocket.cc
@@ -8,13 +8,13 @@
#include <vector>
#include "ppapi/c/dev/ppb_testing_dev.h"
-#include "ppapi/c/dev/ppb_var_array_buffer_dev.h"
#include "ppapi/c/dev/ppb_websocket_dev.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_var.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/ppb_core.h"
#include "ppapi/c/ppb_var.h"
+#include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/cpp/dev/websocket_dev.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
@@ -53,9 +53,9 @@ bool TestWebSocket::Init() {
pp::Module::Get()->GetBrowserInterface(PPB_WEBSOCKET_DEV_INTERFACE));
var_interface_ = static_cast<const PPB_Var*>(
pp::Module::Get()->GetBrowserInterface(PPB_VAR_INTERFACE));
- arraybuffer_interface_ = static_cast<const PPB_VarArrayBuffer_Dev*>(
+ arraybuffer_interface_ = static_cast<const PPB_VarArrayBuffer*>(
pp::Module::Get()->GetBrowserInterface(
- PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE));
+ PPB_VAR_ARRAY_BUFFER_INTERFACE));
core_interface_ = static_cast<const PPB_Core*>(
pp::Module::Get()->GetBrowserInterface(PPB_CORE_INTERFACE));
if (!websocket_interface_ || !var_interface_ || !arraybuffer_interface_ ||
diff --git a/ppapi/tests/test_websocket.h b/ppapi/tests/test_websocket.h
index 81773be..43c56cb 100644
--- a/ppapi/tests/test_websocket.h
+++ b/ppapi/tests/test_websocket.h
@@ -7,10 +7,10 @@
#include <string>
-#include "ppapi/c/dev/ppb_var_array_buffer_dev.h"
#include "ppapi/c/dev/ppb_websocket_dev.h"
#include "ppapi/c/ppb_core.h"
#include "ppapi/c/ppb_var.h"
+#include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/tests/test_case.h"
class TestWebSocket : public TestCase {
@@ -50,7 +50,7 @@ class TestWebSocket : public TestCase {
// Used by the tests that access the C API directly.
const PPB_WebSocket_Dev* websocket_interface_;
const PPB_Var* var_interface_;
- const PPB_VarArrayBuffer_Dev* arraybuffer_interface_;
+ const PPB_VarArrayBuffer* arraybuffer_interface_;
const PPB_Core* core_interface_;
};