diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 23:27:52 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 23:27:52 +0000 |
commit | 0599ea5f32330ec22080b4cf66ffa925b215ad69 (patch) | |
tree | 77fb552d252befd1c548c67066545cd4eeffda2e /ppapi | |
parent | 93ae045c61dc86613b92b6fd910570df9845056f (diff) | |
download | chromium_src-0599ea5f32330ec22080b4cf66ffa925b215ad69.zip chromium_src-0599ea5f32330ec22080b4cf66ffa925b215ad69.tar.gz chromium_src-0599ea5f32330ec22080b4cf66ffa925b215ad69.tar.bz2 |
Pepper: Remove ResourceArray_Dev.
It's no longer used.
BUG=
TBR=binji
Review URL: https://codereview.chromium.org/123933006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
24 files changed, 1 insertions, 691 deletions
diff --git a/ppapi/api/dev/ppb_resource_array_dev.idl b/ppapi/api/dev/ppb_resource_array_dev.idl deleted file mode 100644 index b7497b2..0000000 --- a/ppapi/api/dev/ppb_resource_array_dev.idl +++ /dev/null @@ -1,68 +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. - */ - -/** - * This file defines the <code>PPB_ResourceArray_Dev</code> interface. - */ - -[generate_thunk] - -label Chrome { - M18 = 0.1 -}; - -/** - * A resource array holds a list of resources and retains a reference to each of - * them. - */ -interface PPB_ResourceArray_Dev { - /** - * Creates a resource array. - * Note: It will add a reference to each of the elements. - * - * @param[in] elements <code>PP_Resource</code>s to be stored in the created - * resource array. - * @param[in] size The number of elements. - * - * @return A <code>PP_Resource</code> corresponding to a resource array if - * successful; 0 if failed. - */ - PP_Resource Create([in] PP_Instance instance, - [in, size_as=size] PP_Resource[] elements, - [in] uint32_t size); - - /** - * Determines if the provided resource is a resource array. - * - * @param[in] resource A <code>PP_Resource</code> corresponding to a generic - * resource. - * - * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given - * resource is a resource array, otherwise <code>PP_FALSE</code>. - */ - PP_Bool IsResourceArray([in] PP_Resource resource); - - /** - * Gets the array size. - * - * @param[in] resource_array The resource array. - * - * @return How many elements are there in the array. - */ - uint32_t GetSize([in] PP_Resource resource_array); - - /** - * Gets the element at the specified position. - * Note: It doesn't add a reference to the returned resource for the caller. - * - * @param[in] resource_array The resource array. - * @param[in] index An integer indicating a position in the array. - * - * @return A <code>PP_Resource</code>. Returns 0 if the index is out of range. - */ - PP_Resource GetAt( - [in] PP_Resource resource_array, - [in] uint32_t index); -}; diff --git a/ppapi/c/dev/ppb_resource_array_dev.h b/ppapi/c/dev/ppb_resource_array_dev.h deleted file mode 100644 index 03a811e..0000000 --- a/ppapi/c/dev/ppb_resource_array_dev.h +++ /dev/null @@ -1,85 +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. - */ - -/* From dev/ppb_resource_array_dev.idl modified Fri Jan 6 11:59:21 2012. */ - -#ifndef PPAPI_C_DEV_PPB_RESOURCE_ARRAY_DEV_H_ -#define PPAPI_C_DEV_PPB_RESOURCE_ARRAY_DEV_H_ - -#include "ppapi/c/pp_bool.h" -#include "ppapi/c/pp_instance.h" -#include "ppapi/c/pp_macros.h" -#include "ppapi/c/pp_resource.h" -#include "ppapi/c/pp_stdint.h" - -#define PPB_RESOURCEARRAY_DEV_INTERFACE_0_1 "PPB_ResourceArray(Dev);0.1" -#define PPB_RESOURCEARRAY_DEV_INTERFACE PPB_RESOURCEARRAY_DEV_INTERFACE_0_1 - -/** - * @file - * This file defines the <code>PPB_ResourceArray_Dev</code> interface. - */ - - -/** - * @addtogroup Interfaces - * @{ - */ -/** - * A resource array holds a list of resources and retains a reference to each of - * them. - */ -struct PPB_ResourceArray_Dev_0_1 { - /** - * Creates a resource array. - * Note: It will add a reference to each of the elements. - * - * @param[in] elements <code>PP_Resource</code>s to be stored in the created - * resource array. - * @param[in] size The number of elements. - * - * @return A <code>PP_Resource</code> corresponding to a resource array if - * successful; 0 if failed. - */ - PP_Resource (*Create)(PP_Instance instance, - const PP_Resource elements[], - uint32_t size); - /** - * Determines if the provided resource is a resource array. - * - * @param[in] resource A <code>PP_Resource</code> corresponding to a generic - * resource. - * - * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given - * resource is a resource array, otherwise <code>PP_FALSE</code>. - */ - PP_Bool (*IsResourceArray)(PP_Resource resource); - /** - * Gets the array size. - * - * @param[in] resource_array The resource array. - * - * @return How many elements are there in the array. - */ - uint32_t (*GetSize)(PP_Resource resource_array); - /** - * Gets the element at the specified position. - * Note: It doesn't add a reference to the returned resource for the caller. - * - * @param[in] resource_array The resource array. - * @param[in] index An integer indicating a position in the array. - * - * @return A <code>PP_Resource</code>. Returns 0 if the index is out of range. - */ - PP_Resource (*GetAt)(PP_Resource resource_array, uint32_t index); -}; - -typedef struct PPB_ResourceArray_Dev_0_1 PPB_ResourceArray_Dev; -/** - * @} - */ - -#endif /* PPAPI_C_DEV_PPB_RESOURCE_ARRAY_DEV_H_ */ - diff --git a/ppapi/cpp/dev/audio_input_dev.cc b/ppapi/cpp/dev/audio_input_dev.cc index 463245d..c98fefa 100644 --- a/ppapi/cpp/dev/audio_input_dev.cc +++ b/ppapi/cpp/dev/audio_input_dev.cc @@ -6,7 +6,6 @@ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_errors.h" -#include "ppapi/cpp/dev/resource_array_dev.h" #include "ppapi/cpp/instance_handle.h" #include "ppapi/cpp/module_impl.h" diff --git a/ppapi/cpp/dev/resource_array_dev.cc b/ppapi/cpp/dev/resource_array_dev.cc deleted file mode 100644 index 5bd2549..0000000 --- a/ppapi/cpp/dev/resource_array_dev.cc +++ /dev/null @@ -1,92 +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/resource_array_dev.h" - -#include "ppapi/c/dev/ppb_resource_array_dev.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/cpp/instance_handle.h" -#include "ppapi/cpp/logging.h" -#include "ppapi/cpp/module.h" -#include "ppapi/cpp/module_impl.h" - -namespace pp { - -namespace { - -template <> const char* interface_name<PPB_ResourceArray_Dev>() { - return PPB_RESOURCEARRAY_DEV_INTERFACE; -} - -} // namespace - -ResourceArray_Dev::ResourceArray_Dev() { -} - -ResourceArray_Dev::ResourceArray_Dev(PassRef, PP_Resource resource) - : Resource(PASS_REF, resource) { -} - -ResourceArray_Dev::ResourceArray_Dev(const ResourceArray_Dev& other) - : Resource(other) { -} - -ResourceArray_Dev::ResourceArray_Dev(const InstanceHandle& instance, - const PP_Resource elements[], - uint32_t size) { - if (has_interface<PPB_ResourceArray_Dev>()) { - PassRefFromConstructor(get_interface<PPB_ResourceArray_Dev>()->Create( - instance.pp_instance(), elements, size)); - } -} - -ResourceArray_Dev::~ResourceArray_Dev() { -} - -ResourceArray_Dev& ResourceArray_Dev::operator=( - const ResourceArray_Dev& other) { - Resource::operator=(other); - return *this; -} - -uint32_t ResourceArray_Dev::size() const { - if (!has_interface<PPB_ResourceArray_Dev>()) - return 0; - return get_interface<PPB_ResourceArray_Dev>()->GetSize(pp_resource()); -} - -PP_Resource ResourceArray_Dev::operator[](uint32_t index) const { - if (!has_interface<PPB_ResourceArray_Dev>()) - return 0; - return get_interface<PPB_ResourceArray_Dev>()->GetAt(pp_resource(), index); -} - -// static -void ResourceArray_Dev::ArrayOutputCallbackConverter(void* user_data, - int32_t result) { - ArrayOutputCallbackData* data = - static_cast<ArrayOutputCallbackData*>(user_data); - - // data->resource_array_output should remain 0 if the call failed. - ResourceArray_Dev resources(PASS_REF, data->resource_array_output); - PP_DCHECK(resources.is_null() || result == PP_OK); - - // Need to issue the "GetDataBuffer" even for error cases and when the number - // of items is 0. - PP_Resource* output_buf = static_cast<PP_Resource*>( - data->output.GetDataBuffer( - data->output.user_data, resources.is_null() ? 0 : resources.size(), - sizeof(PP_Resource))); - if (output_buf) { - for (uint32_t index = 0; index < resources.size(); ++index) { - output_buf[index] = resources[index]; - Module::Get()->core()->AddRefResource(output_buf[index]); - } - } - - PP_RunCompletionCallback(&data->original_callback, result); - delete data; -} - -} // namespace pp diff --git a/ppapi/cpp/dev/resource_array_dev.h b/ppapi/cpp/dev/resource_array_dev.h deleted file mode 100644 index f9daf5f..0000000 --- a/ppapi/cpp/dev/resource_array_dev.h +++ /dev/null @@ -1,71 +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. - -#ifndef PPAPI_CPP_DEV_RESOURCE_ARRAY_DEV_H_ -#define PPAPI_CPP_DEV_RESOURCE_ARRAY_DEV_H_ - -#include "ppapi/c/pp_array_output.h" -#include "ppapi/c/pp_completion_callback.h" -#include "ppapi/c/pp_stdint.h" -#include "ppapi/cpp/resource.h" - -namespace pp { - -class InstanceHandle; - -class ResourceArray_Dev : public Resource { - public: - // Heap-allocated data passed to ArrayOutputCallbackConverter(). Please see - // the comment of ArrayOutputCallbackConverter() for more details. - struct ArrayOutputCallbackData { - ArrayOutputCallbackData(const PP_ArrayOutput& array_output, - const PP_CompletionCallback& callback) - : resource_array_output(0), - output(array_output), - original_callback(callback) { - } - - PP_Resource resource_array_output; - PP_ArrayOutput output; - PP_CompletionCallback original_callback; - }; - - ResourceArray_Dev(); - - ResourceArray_Dev(PassRef, PP_Resource resource); - - ResourceArray_Dev(const ResourceArray_Dev& other); - - ResourceArray_Dev(const InstanceHandle& instance, - const PP_Resource elements[], - uint32_t size); - - virtual ~ResourceArray_Dev(); - - ResourceArray_Dev& operator=(const ResourceArray_Dev& other); - - uint32_t size() const; - - PP_Resource operator[](uint32_t index) const; - - // This is an adapter for backward compatibility. It works with those APIs - // which take a PPB_ResourceArray_Dev resource as output parameter, and - // returns results using PP_ArrayOutput. For example: - // - // ResourceArray_Dev::ArrayOutputCallbackData* data = - // new ResourceArray_Dev::ArrayOutputCallbackData( - // pp_array_output, callback); - // ppb_foo->Bar( - // foo_resource, &data->resource_array_output, - // PP_MakeCompletionCallback( - // &ResourceArray_Dev::ArrayOutputCallbackConverter, data)); - // - // It takes a heap-allocated ArrayOutputCallbackData struct passed as the user - // data, and deletes it when the call completes. - static void ArrayOutputCallbackConverter(void* user_data, int32_t result); -}; - -} // namespace pp - -#endif // PPAPI_CPP_DEV_RESOURCE_ARRAY_DEV_H_ diff --git a/ppapi/cpp/dev/video_capture_dev.cc b/ppapi/cpp/dev/video_capture_dev.cc index 49d2741..36293b7 100644 --- a/ppapi/cpp/dev/video_capture_dev.cc +++ b/ppapi/cpp/dev/video_capture_dev.cc @@ -6,7 +6,6 @@ #include "ppapi/c/dev/ppb_video_capture_dev.h" #include "ppapi/c/pp_errors.h" -#include "ppapi/cpp/dev/resource_array_dev.h" #include "ppapi/cpp/instance_handle.h" #include "ppapi/cpp/module_impl.h" diff --git a/ppapi/cpp/file_io.cc b/ppapi/cpp/file_io.cc index faaf284..640016c 100644 --- a/ppapi/cpp/file_io.cc +++ b/ppapi/cpp/file_io.cc @@ -9,7 +9,6 @@ #include "ppapi/c/ppb_file_io.h" #include "ppapi/c/pp_errors.h" #include "ppapi/cpp/completion_callback.h" -#include "ppapi/cpp/dev/resource_array_dev.h" #include "ppapi/cpp/file_ref.h" #include "ppapi/cpp/instance_handle.h" #include "ppapi/cpp/module.h" 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 c83a1f6d..b575587 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 @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. +/* Copyright (c) 2014 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. */ @@ -22,7 +22,6 @@ #include "ppapi/c/dev/ppb_keyboard_input_event_dev.h" #include "ppapi/c/dev/ppb_memory_dev.h" #include "ppapi/c/dev/ppb_printing_dev.h" -#include "ppapi/c/dev/ppb_resource_array_dev.h" #include "ppapi/c/dev/ppb_scrollbar_dev.h" #include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/dev/ppb_trace_event_dev.h" @@ -2040,8 +2039,6 @@ static int32_t Pnacl_M23_PPB_Printing_Dev_GetDefaultPrintSettings(PP_Resource re /* End wrapper methods for PPB_Printing_Dev_0_7 */ -/* Not generating wrapper methods for PPB_ResourceArray_Dev_0_1 */ - /* Not generating wrapper methods for PPB_Scrollbar_Dev_0_5 */ /* Not generating wrapper methods for PPB_TextInput_Dev_0_1 */ @@ -4546,8 +4543,6 @@ struct PPB_Printing_Dev_0_7 Pnacl_Wrappers_PPB_Printing_Dev_0_7 = { .GetDefaultPrintSettings = (int32_t (*)(PP_Resource resource, struct PP_PrintSettings_Dev* print_settings, struct PP_CompletionCallback callback))&Pnacl_M23_PPB_Printing_Dev_GetDefaultPrintSettings }; -/* Not generating wrapper interface for PPB_ResourceArray_Dev_0_1 */ - /* Not generating wrapper interface for PPB_Scrollbar_Dev_0_5 */ /* Not generating wrapper interface for PPB_TextInput_Dev_0_1 */ diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi index 3cdec10..8e5f50b 100644 --- a/ppapi/ppapi_shared.gypi +++ b/ppapi/ppapi_shared.gypi @@ -71,8 +71,6 @@ 'shared_impl/ppb_message_loop_shared.h', 'shared_impl/ppb_opengles2_shared.cc', 'shared_impl/ppb_opengles2_shared.h', - 'shared_impl/ppb_resource_array_shared.cc', - 'shared_impl/ppb_resource_array_shared.h', 'shared_impl/ppb_tcp_socket_shared.cc', 'shared_impl/ppb_tcp_socket_shared.h', 'shared_impl/ppb_trace_event_impl.cc', @@ -223,8 +221,6 @@ 'thunk/ppb_platform_verification_private_thunk.cc', 'thunk/ppb_printing_api.h', 'thunk/ppb_printing_dev_thunk.cc', - 'thunk/ppb_resource_array_api.h', - 'thunk/ppb_resource_array_dev_thunk.cc', 'thunk/ppb_scrollbar_api.h', 'thunk/ppb_scrollbar_thunk.cc', 'thunk/ppb_talk_private_api.h', diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi index be7627c..8d1a623 100644 --- a/ppapi/ppapi_sources.gypi +++ b/ppapi/ppapi_sources.gypi @@ -82,7 +82,6 @@ 'c/dev/ppb_ime_input_event_dev.h', 'c/dev/ppb_memory_dev.h', 'c/dev/ppb_printing_dev.h', - 'c/dev/ppb_resource_array_dev.h', 'c/dev/ppb_scrollbar_dev.h', 'c/dev/ppb_text_input_dev.h', 'c/dev/ppb_truetype_font_dev.h', @@ -268,8 +267,6 @@ 'cpp/dev/optional_dev.h', 'cpp/dev/printing_dev.cc', 'cpp/dev/printing_dev.h', - 'cpp/dev/resource_array_dev.cc', - 'cpp/dev/resource_array_dev.h', 'cpp/dev/scrollbar_dev.cc', 'cpp/dev/scrollbar_dev.h', 'cpp/dev/selection_dev.cc', @@ -556,8 +553,6 @@ 'tests/test_pdf.h', 'tests/test_platform_verification_private.cc', 'tests/test_platform_verification_private.h', - 'tests/test_resource_array.cc', - 'tests/test_resource_array.h', 'tests/test_struct_sizes.c', 'tests/test_talk_private.cc', 'tests/test_talk_private.h', diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc index bf4a938..c734710 100644 --- a/ppapi/proxy/interface_list.cc +++ b/ppapi/proxy/interface_list.cc @@ -21,7 +21,6 @@ #include "ppapi/c/dev/ppb_memory_dev.h" #include "ppapi/c/dev/ppb_opengles2ext_dev.h" #include "ppapi/c/dev/ppb_printing_dev.h" -#include "ppapi/c/dev/ppb_resource_array_dev.h" #include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/dev/ppb_trace_event_dev.h" #include "ppapi/c/dev/ppb_truetype_font_dev.h" diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc index 231142a..db14611 100644 --- a/ppapi/proxy/resource_creation_proxy.cc +++ b/ppapi/proxy/resource_creation_proxy.cc @@ -54,7 +54,6 @@ #include "ppapi/shared_impl/ppb_audio_config_shared.h" #include "ppapi/shared_impl/ppb_audio_shared.h" #include "ppapi/shared_impl/ppb_input_event_shared.h" -#include "ppapi/shared_impl/ppb_resource_array_shared.h" #include "ppapi/shared_impl/var.h" #include "ppapi/thunk/enter.h" #include "ppapi/thunk/ppb_image_data_api.h" @@ -143,15 +142,6 @@ PP_Resource ResourceCreationProxy::CreateTouchInputEvent( OBJECT_IS_PROXY, instance, type, time_stamp, modifiers); } -PP_Resource ResourceCreationProxy::CreateResourceArray( - PP_Instance instance, - const PP_Resource elements[], - uint32_t size) { - PPB_ResourceArray_Shared* object = new PPB_ResourceArray_Shared( - OBJECT_IS_PROXY, instance, elements, size); - return object->GetReference(); -} - PP_Resource ResourceCreationProxy::CreateTrueTypeFont( PP_Instance instance, const PP_TrueTypeFontDesc_Dev* desc) { diff --git a/ppapi/proxy/resource_creation_proxy.h b/ppapi/proxy/resource_creation_proxy.h index df564da..418fb8d 100644 --- a/ppapi/proxy/resource_creation_proxy.h +++ b/ppapi/proxy/resource_creation_proxy.h @@ -73,9 +73,6 @@ class ResourceCreationProxy : public InterfaceProxy, PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers) OVERRIDE; - virtual PP_Resource CreateResourceArray(PP_Instance instance, - const PP_Resource elements[], - uint32_t size) OVERRIDE; virtual PP_Resource CreateTrueTypeFont( PP_Instance instance, const PP_TrueTypeFontDesc_Dev* desc) OVERRIDE; diff --git a/ppapi/shared_impl/ppb_resource_array_shared.cc b/ppapi/shared_impl/ppb_resource_array_shared.cc deleted file mode 100644 index f7353f1..0000000 --- a/ppapi/shared_impl/ppb_resource_array_shared.cc +++ /dev/null @@ -1,51 +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/shared_impl/ppb_resource_array_shared.h" - -#include "base/logging.h" -#include "ppapi/shared_impl/ppapi_globals.h" -#include "ppapi/shared_impl/resource_tracker.h" - -using ppapi::thunk::PPB_ResourceArray_API; - -namespace ppapi { - -PPB_ResourceArray_Shared::PPB_ResourceArray_Shared(ResourceObjectType type, - PP_Instance instance, - const PP_Resource elements[], - uint32_t size) - : Resource(type, instance) { - DCHECK(resources_.empty()); - - resources_.reserve(size); - for (uint32_t index = 0; index < size; ++index) { - PP_Resource element = elements[index]; - if (element) - PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(element); - resources_.push_back(element); - } -} - -PPB_ResourceArray_Shared::~PPB_ResourceArray_Shared() { - for (std::vector<PP_Resource>::iterator iter = resources_.begin(); - iter != resources_.end(); ++iter) { - if (*iter) - PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(*iter); - } -} - -PPB_ResourceArray_API* PPB_ResourceArray_Shared::AsPPB_ResourceArray_API() { - return this; -} - -uint32_t PPB_ResourceArray_Shared::GetSize() { - return static_cast<uint32_t>(resources_.size()); -} - -PP_Resource PPB_ResourceArray_Shared::GetAt(uint32_t index) { - return index < resources_.size() ? resources_[index] : 0; -} - -} // namespace ppapi diff --git a/ppapi/shared_impl/ppb_resource_array_shared.h b/ppapi/shared_impl/ppb_resource_array_shared.h deleted file mode 100644 index e3d6750..0000000 --- a/ppapi/shared_impl/ppb_resource_array_shared.h +++ /dev/null @@ -1,42 +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. - -#ifndef PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_ -#define PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_ - -#include <vector> - -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "ppapi/shared_impl/resource.h" -#include "ppapi/thunk/ppb_resource_array_api.h" - -namespace ppapi { - -class PPAPI_SHARED_EXPORT PPB_ResourceArray_Shared - : public Resource, - public thunk::PPB_ResourceArray_API { - public: - PPB_ResourceArray_Shared(ResourceObjectType type, - PP_Instance instance, - const PP_Resource elements[], - uint32_t size); - virtual ~PPB_ResourceArray_Shared(); - - // Resource overrides. - virtual PPB_ResourceArray_API* AsPPB_ResourceArray_API() OVERRIDE; - - // PPB_ResourceArray_API implementation. - virtual uint32_t GetSize() OVERRIDE; - virtual PP_Resource GetAt(uint32_t index) OVERRIDE; - - private: - std::vector<PP_Resource> resources_; - - DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_ResourceArray_Shared); -}; - -} // namespace ppapi - -#endif // PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_ diff --git a/ppapi/shared_impl/resource.h b/ppapi/shared_impl/resource.h index ec4f517..a3c15d1 100644 --- a/ppapi/shared_impl/resource.h +++ b/ppapi/shared_impl/resource.h @@ -62,7 +62,6 @@ F(PPB_PDF_API) \ F(PPB_PlatformVerification_API) \ F(PPB_Printing_API) \ - F(PPB_ResourceArray_API) \ F(PPB_Scrollbar_API) \ F(PPB_Talk_Private_API) \ F(PPB_TrueTypeFont_API) \ diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h index dd7f648..8dfae23 100644 --- a/ppapi/tests/all_c_includes.h +++ b/ppapi/tests/all_c_includes.h @@ -25,7 +25,6 @@ #include "ppapi/c/dev/ppb_ime_input_event_dev.h" #include "ppapi/c/dev/ppb_memory_dev.h" #include "ppapi/c/dev/ppb_printing_dev.h" -#include "ppapi/c/dev/ppb_resource_array_dev.h" #include "ppapi/c/dev/ppb_scrollbar_dev.h" #include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/dev/ppb_trace_event_dev.h" diff --git a/ppapi/tests/all_cpp_includes.h b/ppapi/tests/all_cpp_includes.h index 85e16e6..75cfbf8 100644 --- a/ppapi/tests/all_cpp_includes.h +++ b/ppapi/tests/all_cpp_includes.h @@ -25,7 +25,6 @@ #include "ppapi/cpp/dev/memory_dev.h" #include "ppapi/cpp/dev/optional_dev.h" #include "ppapi/cpp/dev/printing_dev.h" -#include "ppapi/cpp/dev/resource_array_dev.h" #include "ppapi/cpp/dev/scriptable_object_deprecated.h" #include "ppapi/cpp/dev/scrollbar_dev.h" #include "ppapi/cpp/dev/selection_dev.h" diff --git a/ppapi/tests/test_resource_array.cc b/ppapi/tests/test_resource_array.cc deleted file mode 100644 index 333505e..0000000 --- a/ppapi/tests/test_resource_array.cc +++ /dev/null @@ -1,123 +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/tests/test_resource_array.h" - -#include "ppapi/cpp/dev/resource_array_dev.h" -#include "ppapi/cpp/image_data.h" -#include "ppapi/cpp/input_event.h" -#include "ppapi/tests/testing_instance.h" - -REGISTER_TEST_CASE(ResourceArray); - -namespace { - -pp::InputEvent CreateMouseEvent(pp::Instance* instance, - PP_InputEvent_Type type, - PP_InputEvent_MouseButton buttons) { - return pp::MouseInputEvent( - instance, - type, - 100, // time_stamp - 0, // modifiers - buttons, - pp::Point(), // position - 1, // click count - pp::Point()); // movement -} - -pp::ImageData CreateImageData(pp::Instance* instance) { - return pp::ImageData( - instance, - PP_IMAGEDATAFORMAT_RGBA_PREMUL, - pp::Size(1, 1), - true); -} - -} // namespace - -TestResourceArray::TestResourceArray(TestingInstance* instance) - : TestCase(instance) { -} - -TestResourceArray::~TestResourceArray() { -} - -void TestResourceArray::RunTests(const std::string& filter) { - RUN_TEST(Basics, filter); - RUN_TEST(OutOfRangeAccess, filter); - RUN_TEST(EmptyArray, filter); - RUN_TEST(InvalidElement, filter); -} - -std::string TestResourceArray::TestBasics() { - pp::InputEvent mouse_event_1 = CreateMouseEvent( - instance_, PP_INPUTEVENT_TYPE_MOUSEDOWN, PP_INPUTEVENT_MOUSEBUTTON_LEFT); - pp::InputEvent mouse_event_2 = CreateMouseEvent( - instance_, PP_INPUTEVENT_TYPE_MOUSEUP, PP_INPUTEVENT_MOUSEBUTTON_RIGHT); - pp::ImageData image_data = CreateImageData(instance_); - - PP_Resource elements[] = { - mouse_event_1.pp_resource(), - mouse_event_2.pp_resource(), - image_data.pp_resource() - }; - size_t size = sizeof(elements) / sizeof(elements[0]); - - pp::ResourceArray_Dev resource_array(instance_, elements, size); - - ASSERT_EQ(size, resource_array.size()); - for (uint32_t index = 0; index < size; ++index) - ASSERT_EQ(elements[index], resource_array[index]); - - PASS(); -} - -std::string TestResourceArray::TestOutOfRangeAccess() { - pp::InputEvent mouse_event_1 = CreateMouseEvent( - instance_, PP_INPUTEVENT_TYPE_MOUSEDOWN, PP_INPUTEVENT_MOUSEBUTTON_LEFT); - pp::InputEvent mouse_event_2 = CreateMouseEvent( - instance_, PP_INPUTEVENT_TYPE_MOUSEUP, PP_INPUTEVENT_MOUSEBUTTON_RIGHT); - pp::ImageData image_data = CreateImageData(instance_); - - PP_Resource elements[] = { - mouse_event_1.pp_resource(), - mouse_event_2.pp_resource(), - image_data.pp_resource() - }; - size_t size = sizeof(elements) / sizeof(elements[0]); - - pp::ResourceArray_Dev resource_array(instance_, elements, size); - ASSERT_EQ(0, resource_array[size]); - ASSERT_EQ(0, resource_array[size + 1]); - - PASS(); -} - -std::string TestResourceArray::TestEmptyArray() { - pp::ResourceArray_Dev resource_array(instance_, NULL, 0); - ASSERT_EQ(0, resource_array.size()); - PASS(); -} - -std::string TestResourceArray::TestInvalidElement() { - pp::InputEvent mouse_event = CreateMouseEvent( - instance_, PP_INPUTEVENT_TYPE_MOUSEDOWN, PP_INPUTEVENT_MOUSEBUTTON_LEFT); - pp::ImageData image_data = CreateImageData(instance_); - - PP_Resource elements[] = { - mouse_event.pp_resource(), - 0, - image_data.pp_resource() - }; - size_t size = sizeof(elements) / sizeof(elements[0]); - - pp::ResourceArray_Dev resource_array(instance_, elements, size); - - ASSERT_EQ(size, resource_array.size()); - for (uint32_t index = 0; index < size; ++index) - ASSERT_EQ(elements[index], resource_array[index]); - - PASS(); -} diff --git a/ppapi/tests/test_resource_array.h b/ppapi/tests/test_resource_array.h deleted file mode 100644 index b5dfcc9..0000000 --- a/ppapi/tests/test_resource_array.h +++ /dev/null @@ -1,28 +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. - -#ifndef PPAPI_TESTS_TEST_RESOURCE_ARRAY_H_ -#define PPAPI_TESTS_TEST_RESOURCE_ARRAY_H_ - -#include <string> - -#include "ppapi/tests/test_case.h" - -class TestResourceArray : public TestCase { - public: - explicit TestResourceArray(TestingInstance* instance); - virtual ~TestResourceArray(); - - // TestCase implementation. - virtual void RunTests(const std::string& test_filter); - - private: - std::string TestBasics(); - std::string TestOutOfRangeAccess(); - std::string TestEmptyArray(); - std::string TestInvalidElement(); -}; - -#endif // PPAPI_TESTS_TEST_RESOURCE_ARRAY_H_ - diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h index 4e30407..a3bbc49 100644 --- a/ppapi/thunk/interfaces_ppb_public_dev.h +++ b/ppapi/thunk/interfaces_ppb_public_dev.h @@ -22,7 +22,6 @@ PROXIED_IFACE(PPB_KEYBOARD_INPUT_EVENT_DEV_INTERFACE_0_2, PPB_KeyboardInputEvent_Dev_0_2) PROXIED_IFACE(PPB_MEMORY_DEV_INTERFACE_0_1, PPB_Memory_Dev_0_1) PROXIED_IFACE(PPB_PRINTING_DEV_INTERFACE_0_7, PPB_Printing_Dev_0_7) -PROXIED_IFACE(PPB_RESOURCEARRAY_DEV_INTERFACE_0_1, PPB_ResourceArray_Dev_0_1) PROXIED_IFACE(PPB_TEXTINPUT_DEV_INTERFACE_0_2, PPB_TextInput_Dev_0_2) PROXIED_IFACE(PPB_TRUETYPEFONT_DEV_INTERFACE_0_1, PPB_TrueTypeFont_Dev_0_1) PROXIED_IFACE(PPB_VAR_RESOURCE_DEV_INTERFACE_0_1, PPB_VarResource_Dev_0_1) diff --git a/ppapi/thunk/ppb_resource_array_api.h b/ppapi/thunk/ppb_resource_array_api.h deleted file mode 100644 index ec37f9e..0000000 --- a/ppapi/thunk/ppb_resource_array_api.h +++ /dev/null @@ -1,25 +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. - -#ifndef PPAPI_THUNK_PPB_RESOURCE_ARRAY_API_H_ -#define PPAPI_THUNK_PPB_RESOURCE_ARRAY_API_H_ - -#include "ppapi/c/dev/ppb_resource_array_dev.h" -#include "ppapi/thunk/ppapi_thunk_export.h" - -namespace ppapi { -namespace thunk { - -class PPAPI_THUNK_EXPORT PPB_ResourceArray_API { - public: - virtual ~PPB_ResourceArray_API() {} - - virtual uint32_t GetSize() = 0; - virtual PP_Resource GetAt(uint32_t index) = 0; -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_PPB_RESOURCE_ARRAY_API_H_ diff --git a/ppapi/thunk/ppb_resource_array_dev_thunk.cc b/ppapi/thunk/ppb_resource_array_dev_thunk.cc deleted file mode 100644 index 6d51a56..0000000 --- a/ppapi/thunk/ppb_resource_array_dev_thunk.cc +++ /dev/null @@ -1,67 +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. - -// From dev/ppb_resource_array_dev.idl modified Thu Dec 20 13:10:26 2012. - -#include "ppapi/c/dev/ppb_resource_array_dev.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/shared_impl/tracked_callback.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_instance_api.h" -#include "ppapi/thunk/ppb_resource_array_api.h" -#include "ppapi/thunk/resource_creation_api.h" -#include "ppapi/thunk/thunk.h" - -namespace ppapi { -namespace thunk { - -namespace { - -PP_Resource Create(PP_Instance instance, - const PP_Resource elements[], - uint32_t size) { - VLOG(4) << "PPB_ResourceArray_Dev::Create()"; - EnterResourceCreation enter(instance); - if (enter.failed()) - return 0; - return enter.functions()->CreateResourceArray(instance, elements, size); -} - -PP_Bool IsResourceArray(PP_Resource resource) { - VLOG(4) << "PPB_ResourceArray_Dev::IsResourceArray()"; - EnterResource<PPB_ResourceArray_API> enter(resource, false); - return PP_FromBool(enter.succeeded()); -} - -uint32_t GetSize(PP_Resource resource_array) { - VLOG(4) << "PPB_ResourceArray_Dev::GetSize()"; - EnterResource<PPB_ResourceArray_API> enter(resource_array, true); - if (enter.failed()) - return 0; - return enter.object()->GetSize(); -} - -PP_Resource GetAt(PP_Resource resource_array, uint32_t index) { - VLOG(4) << "PPB_ResourceArray_Dev::GetAt()"; - EnterResource<PPB_ResourceArray_API> enter(resource_array, true); - if (enter.failed()) - return 0; - return enter.object()->GetAt(index); -} - -const PPB_ResourceArray_Dev_0_1 g_ppb_resourcearray_dev_thunk_0_1 = { - &Create, - &IsResourceArray, - &GetSize, - &GetAt -}; - -} // namespace - -const PPB_ResourceArray_Dev_0_1* GetPPB_ResourceArray_Dev_0_1_Thunk() { - return &g_ppb_resourcearray_dev_thunk_0_1; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h index 61eaa97..bff4f15 100644 --- a/ppapi/thunk/resource_creation_api.h +++ b/ppapi/thunk/resource_creation_api.h @@ -84,9 +84,6 @@ class ResourceCreationAPI { PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers) = 0; - virtual PP_Resource CreateResourceArray(PP_Instance instance, - const PP_Resource elements[], - uint32_t size) = 0; virtual PP_Resource CreateTrueTypeFont( PP_Instance instance, const PP_TrueTypeFontDesc_Dev* desc) = 0; |