summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-16 19:09:38 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-16 19:09:38 +0000
commitcef56eabc38047340ea3229e85506afcd187984e (patch)
tree75415933e55859243e9c9bbf54db5468186aa938 /ppapi
parent93ef86cbf2c5b896183b811d6297b77726d25f57 (diff)
downloadchromium_src-cef56eabc38047340ea3229e85506afcd187984e.zip
chromium_src-cef56eabc38047340ea3229e85506afcd187984e.tar.gz
chromium_src-cef56eabc38047340ea3229e85506afcd187984e.tar.bz2
Remove apps in Pepper support and the PPB_Alarms_Dev API.
BUG=366304 TEST=None Review URL: https://codereview.chromium.org/314823002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277513 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/BUILD.gn6
-rw-r--r--ppapi/api/dev/pp_optional_structs_dev.idl14
-rw-r--r--ppapi/api/dev/ppb_alarms_dev.idl181
-rw-r--r--ppapi/c/dev/pp_optional_structs_dev.h34
-rw-r--r--ppapi/c/dev/ppb_alarms_dev.h210
-rw-r--r--ppapi/cpp/dev/alarms_dev.cc295
-rw-r--r--ppapi/cpp/dev/alarms_dev.h170
-rw-r--r--ppapi/cpp/dev/array_dev.h196
-rw-r--r--ppapi/cpp/dev/may_own_ptr_dev.h61
-rw-r--r--ppapi/cpp/dev/optional_dev.h117
-rw-r--r--ppapi/cpp/dev/string_wrapper_dev.cc129
-rw-r--r--ppapi/cpp/dev/string_wrapper_dev.h93
-rw-r--r--ppapi/cpp/dev/struct_wrapper_output_traits_dev.h37
-rw-r--r--ppapi/cpp/dev/to_c_type_converter_dev.h96
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c52
-rw-r--r--ppapi/ppapi_proxy.gypi2
-rw-r--r--ppapi/ppapi_shared.gypi4
-rw-r--r--ppapi/ppapi_sources.gypi11
-rw-r--r--ppapi/ppapi_tests.gypi1
-rw-r--r--ppapi/proxy/extensions_common_resource.cc139
-rw-r--r--ppapi/proxy/extensions_common_resource.h68
-rw-r--r--ppapi/proxy/interface_list.cc1
-rw-r--r--ppapi/proxy/ppapi_messages.h20
-rw-r--r--ppapi/proxy/ppb_instance_proxy.cc4
-rw-r--r--ppapi/shared_impl/resource.h1
-rw-r--r--ppapi/shared_impl/singleton_resource_id.h1
-rw-r--r--ppapi/shared_impl/var_value_conversions.cc381
-rw-r--r--ppapi/shared_impl/var_value_conversions.h61
-rw-r--r--ppapi/shared_impl/var_value_conversions_unittest.cc391
-rw-r--r--ppapi/tests/all_c_includes.h2
-rw-r--r--ppapi/tests/all_cpp_includes.h7
-rw-r--r--ppapi/thunk/extensions_common_api.h44
-rw-r--r--ppapi/thunk/interfaces_ppb_public_dev.h1
-rw-r--r--ppapi/thunk/ppb_alarms_dev_thunk.cc82
34 files changed, 0 insertions, 2912 deletions
diff --git a/ppapi/BUILD.gn b/ppapi/BUILD.gn
index 8a2f1bb..78d5ce9 100644
--- a/ppapi/BUILD.gn
+++ b/ppapi/BUILD.gn
@@ -189,8 +189,6 @@ component("ppapi_shared") {
"shared_impl/var.h",
"shared_impl/var_tracker.cc",
"shared_impl/var_tracker.h",
- "shared_impl/var_value_conversions.cc",
- "shared_impl/var_value_conversions.h",
# TODO(viettrungluu): Split these out; it won"t be used in NaCl.
"shared_impl/private/net_address_private_impl.cc",
"shared_impl/private/net_address_private_impl_constants.cc",
@@ -201,8 +199,6 @@ component("ppapi_shared") {
"thunk/enter.cc",
"thunk/enter.h",
- "thunk/extensions_common_api.h",
- "thunk/ppb_alarms_dev_thunk.cc",
"thunk/ppb_audio_api.h",
"thunk/ppb_audio_config_api.h",
"thunk/ppb_audio_config_thunk.cc",
@@ -473,8 +469,6 @@ component("ppapi_proxy") {
"proxy/enter_proxy.h",
"proxy/error_conversion.cc",
"proxy/error_conversion.h",
- "proxy/extensions_common_resource.cc",
- "proxy/extensions_common_resource.h",
"proxy/file_chooser_resource.cc",
"proxy/file_chooser_resource.h",
"proxy/file_io_resource.cc",
diff --git a/ppapi/api/dev/pp_optional_structs_dev.idl b/ppapi/api/dev/pp_optional_structs_dev.idl
deleted file mode 100644
index 3e0829f..0000000
--- a/ppapi/api/dev/pp_optional_structs_dev.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Copyright 2013 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 optional structs for primitive types.
- */
-
-struct PP_Optional_Double_Dev {
- double_t value;
- PP_Bool is_set;
-};
-
diff --git a/ppapi/api/dev/ppb_alarms_dev.idl b/ppapi/api/dev/ppb_alarms_dev.idl
deleted file mode 100644
index b2345c4..0000000
--- a/ppapi/api/dev/ppb_alarms_dev.idl
+++ /dev/null
@@ -1,181 +0,0 @@
-/* Copyright 2013 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 Pepper equivalent of the <code>chrome.alarms</code>
- * extension API.
- */
-
-label Chrome {
- M33 = 0.1
-};
-
-struct PP_Alarms_Alarm_Dev {
- /**
- * Name of this alarm.
- */
- PP_Var name;
- /**
- * Time at which this alarm was scheduled to fire, in milliseconds past the
- * epoch. For performance reasons, the alarm may have been delayed an
- * arbitrary amount beyond this.
- */
- double_t scheduled_time;
- /**
- * If set, the alarm is a repeating alarm and will fire again in
- * <code>period_in_minutes</code> minutes.
- */
- PP_Optional_Double_Dev period_in_minutes;
-};
-
-struct PP_Alarms_AlarmCreateInfo_Dev {
- /**
- * Time at which the alarm should fire, in milliseconds past the epoch.
- */
- PP_Optional_Double_Dev when;
- /**
- * Length of time in minutes after which the
- * <code>PP_Alarms_OnAlarm_Dev</code> event should fire.
- */
- PP_Optional_Double_Dev delay_in_minutes;
- /**
- * If set, the <code>PP_Alarms_OnAlarm_Dev</code> event should fire every
- * <code>period_in_minutes</code> minutes after the initial event specified by
- * <code>when</code> or <code>delay_in_minutes</code>. If not set, the alarm
- * will only fire once.
- */
- PP_Optional_Double_Dev period_in_minutes;
-};
-
-struct PP_Alarms_Alarm_Array_Dev {
- uint32_t size;
- [size_is(count)] PP_Alarms_Alarm_Dev[] elements;
-};
-
-/**
- * Fired when an alarm has elapsed. Useful for event pages.
- *
- * @param[in] listener_id The listener ID.
- * @param[inout] user_data The opaque pointer that was used when registering the
- * listener.
- * @param[in] alarm The alarm that has elapsed.
- */
-typedef void PP_Alarms_OnAlarm_Dev(
- [in] uint32_t listener_id,
- [inout] mem_t user_data,
- [in] PP_Alarms_Alarm_Dev alarm);
-
-interface PPB_Alarms_Dev {
- /**
- * Creates an alarm. Near the time(s) specified by <code>alarm_info</code>,
- * the <code>PP_Alarms_OnAlarm_Dev</code> event is fired. If there is another
- * alarm with the same name (or no name if none is specified), it will be
- * cancelled and replaced by this alarm.
- *
- * In order to reduce the load on the user's machine, Chrome limits alarms
- * to at most once every 1 minute but may delay them an arbitrary amount more.
- * That is, setting
- * <code>PP_Alarms_AlarmCreateInfo_Dev.delay_in_minutes</code> or
- * <code>PP_Alarms_AlarmCreateInfo_Dev.period_in_minutes</code> to less than
- * <code>1</code> will not be honored and will cause a warning.
- * <code>PP_Alarms_AlarmCreateInfo_Dev.when</code> can be set to less than 1
- * minute after "now" without warning but won't actually cause the alarm to
- * fire for at least 1 minute.
- *
- * To help you debug your app or extension, when you've loaded it unpacked,
- * there's no limit to how often the alarm can fire.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- * @param[in] name A string or undefined <code>PP_Var</code>. Optional name to
- * identify this alarm. Defaults to the empty string.
- * @param[in] alarm_info Describes when the alarm should fire. The initial
- * time must be specified by either <code>when</code> or
- * <code>delay_in_minutes</code> (but not both). If
- * <code>period_in_minutes</code> is set, the alarm will repeat every
- * <code>period_in_minutes</code> minutes after the initial event. If neither
- * <code>when</code> or <code>delay_in_minutes</code> is set for a repeating
- * alarm, <code>period_in_minutes</code> is used as the default for
- * <code>delay_in_minutes</code>.
- */
- void Create(
- [in] PP_Instance instance,
- [in] PP_Var name,
- [in] PP_Alarms_AlarmCreateInfo_Dev alarm_info);
-
- /**
- * Retrieves details about the specified alarm.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- * @param[in] name A string or undefined <code>PP_Var</code>. The name of the
- * alarm to get. Defaults to the empty string.
- * @param[out] alarm A <code>PP_Alarms_Alarm_Dev</code> struct to store the
- * output result.
- * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
- * completion.
- *
- * @return An error code from <code>pp_errors.h</code>
- */
- int32_t Get(
- [in] PP_Instance instance,
- [in] PP_Var name,
- [out] PP_Alarms_Alarm_Dev alarm,
- [in] PP_CompletionCallback callback);
-
- /**
- * Gets an array of all the alarms.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- * @param[out] alarms A <code>PP_Alarms_Alarm_Array_Dev</code> to store the
- * output result.
- * @param[in] array_allocator A <code>PP_ArrayOutput</code> to allocate memory
- * for <code>alarms</code>.
- * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
- * completion.
- *
- * @return An error code from <code>pp_errors.h</code>
- */
- int32_t GetAll(
- [in] PP_Instance instance,
- [out] PP_Alarms_Alarm_Array_Dev alarms,
- [in] PP_ArrayOutput array_allocator,
- [in] PP_CompletionCallback callback);
-
- /**
- * Clears the alarm with the given name.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- * @param[in] name A string or undefined <code>PP_Var</code>. The name of the
- * alarm to clear. Defaults to the empty string.
- */
- void Clear(
- [in] PP_Instance instance,
- [in] PP_Var name);
-
- /**
- * Clears all alarms.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- */
- void ClearAll(
- [in] PP_Instance instance);
-
- /**
- * Registers <code>PP_Alarms_OnAlarm_Dev</code> event.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- * @param[in] callback The callback to receive notifications.
- * @param[inout] user_data An opaque pointer that will be passed to
- * <code>callback</code>.
- *
- * @return A listener ID, or 0 if failed.
- *
- * TODO(yzshen): add a PPB_Events_Dev interface for unregistering:
- * void UnregisterListener(PP_instance instance, uint32_t listener_id);
- */
- uint32_t AddOnAlarmListener(
- [in] PP_Instance instance,
- [in] PP_Alarms_OnAlarm_Dev callback,
- [inout] mem_t user_data);
-};
diff --git a/ppapi/c/dev/pp_optional_structs_dev.h b/ppapi/c/dev/pp_optional_structs_dev.h
deleted file mode 100644
index 06608fe..0000000
--- a/ppapi/c/dev/pp_optional_structs_dev.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2013 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/pp_optional_structs_dev.idl modified Tue Dec 10 17:39:38 2013. */
-
-#ifndef PPAPI_C_DEV_PP_OPTIONAL_STRUCTS_DEV_H_
-#define PPAPI_C_DEV_PP_OPTIONAL_STRUCTS_DEV_H_
-
-#include "ppapi/c/pp_bool.h"
-#include "ppapi/c/pp_macros.h"
-#include "ppapi/c/pp_stdint.h"
-
-/**
- * @file
- * This file defines optional structs for primitive types.
- */
-
-
-/**
- * @addtogroup Structs
- * @{
- */
-struct PP_Optional_Double_Dev {
- double value;
- PP_Bool is_set;
-};
-/**
- * @}
- */
-
-#endif /* PPAPI_C_DEV_PP_OPTIONAL_STRUCTS_DEV_H_ */
-
diff --git a/ppapi/c/dev/ppb_alarms_dev.h b/ppapi/c/dev/ppb_alarms_dev.h
deleted file mode 100644
index 9661793..0000000
--- a/ppapi/c/dev/ppb_alarms_dev.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/* Copyright 2013 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_alarms_dev.idl modified Tue Dec 10 17:40:20 2013. */
-
-#ifndef PPAPI_C_DEV_PPB_ALARMS_DEV_H_
-#define PPAPI_C_DEV_PPB_ALARMS_DEV_H_
-
-#include "ppapi/c/dev/pp_optional_structs_dev.h"
-#include "ppapi/c/pp_array_output.h"
-#include "ppapi/c/pp_bool.h"
-#include "ppapi/c/pp_completion_callback.h"
-#include "ppapi/c/pp_instance.h"
-#include "ppapi/c/pp_macros.h"
-#include "ppapi/c/pp_stdint.h"
-#include "ppapi/c/pp_var.h"
-
-#define PPB_ALARMS_DEV_INTERFACE_0_1 "PPB_Alarms(Dev);0.1"
-#define PPB_ALARMS_DEV_INTERFACE PPB_ALARMS_DEV_INTERFACE_0_1
-
-/**
- * @file
- * This file defines the Pepper equivalent of the <code>chrome.alarms</code>
- * extension API.
- */
-
-
-/**
- * @addtogroup Structs
- * @{
- */
-struct PP_Alarms_Alarm_Dev {
- /**
- * Name of this alarm.
- */
- struct PP_Var name;
- /**
- * Time at which this alarm was scheduled to fire, in milliseconds past the
- * epoch. For performance reasons, the alarm may have been delayed an
- * arbitrary amount beyond this.
- */
- double scheduled_time;
- /**
- * If set, the alarm is a repeating alarm and will fire again in
- * <code>period_in_minutes</code> minutes.
- */
- struct PP_Optional_Double_Dev period_in_minutes;
-};
-
-struct PP_Alarms_AlarmCreateInfo_Dev {
- /**
- * Time at which the alarm should fire, in milliseconds past the epoch.
- */
- struct PP_Optional_Double_Dev when;
- /**
- * Length of time in minutes after which the
- * <code>PP_Alarms_OnAlarm_Dev</code> event should fire.
- */
- struct PP_Optional_Double_Dev delay_in_minutes;
- /**
- * If set, the <code>PP_Alarms_OnAlarm_Dev</code> event should fire every
- * <code>period_in_minutes</code> minutes after the initial event specified by
- * <code>when</code> or <code>delay_in_minutes</code>. If not set, the alarm
- * will only fire once.
- */
- struct PP_Optional_Double_Dev period_in_minutes;
-};
-
-struct PP_Alarms_Alarm_Array_Dev {
- uint32_t size;
- struct PP_Alarms_Alarm_Dev *elements;
-};
-/**
- * @}
- */
-
-/**
- * @addtogroup Typedefs
- * @{
- */
-/**
- * Fired when an alarm has elapsed. Useful for event pages.
- *
- * @param[in] listener_id The listener ID.
- * @param[inout] user_data The opaque pointer that was used when registering the
- * listener.
- * @param[in] alarm The alarm that has elapsed.
- */
-typedef void (*PP_Alarms_OnAlarm_Dev)(
- uint32_t listener_id,
- void* user_data,
- const struct PP_Alarms_Alarm_Dev* alarm);
-/**
- * @}
- */
-
-/**
- * @addtogroup Interfaces
- * @{
- */
-struct PPB_Alarms_Dev_0_1 {
- /**
- * Creates an alarm. Near the time(s) specified by <code>alarm_info</code>,
- * the <code>PP_Alarms_OnAlarm_Dev</code> event is fired. If there is another
- * alarm with the same name (or no name if none is specified), it will be
- * cancelled and replaced by this alarm.
- *
- * In order to reduce the load on the user's machine, Chrome limits alarms
- * to at most once every 1 minute but may delay them an arbitrary amount more.
- * That is, setting
- * <code>PP_Alarms_AlarmCreateInfo_Dev.delay_in_minutes</code> or
- * <code>PP_Alarms_AlarmCreateInfo_Dev.period_in_minutes</code> to less than
- * <code>1</code> will not be honored and will cause a warning.
- * <code>PP_Alarms_AlarmCreateInfo_Dev.when</code> can be set to less than 1
- * minute after "now" without warning but won't actually cause the alarm to
- * fire for at least 1 minute.
- *
- * To help you debug your app or extension, when you've loaded it unpacked,
- * there's no limit to how often the alarm can fire.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- * @param[in] name A string or undefined <code>PP_Var</code>. Optional name to
- * identify this alarm. Defaults to the empty string.
- * @param[in] alarm_info Describes when the alarm should fire. The initial
- * time must be specified by either <code>when</code> or
- * <code>delay_in_minutes</code> (but not both). If
- * <code>period_in_minutes</code> is set, the alarm will repeat every
- * <code>period_in_minutes</code> minutes after the initial event. If neither
- * <code>when</code> or <code>delay_in_minutes</code> is set for a repeating
- * alarm, <code>period_in_minutes</code> is used as the default for
- * <code>delay_in_minutes</code>.
- */
- void (*Create)(PP_Instance instance,
- struct PP_Var name,
- const struct PP_Alarms_AlarmCreateInfo_Dev* alarm_info);
- /**
- * Retrieves details about the specified alarm.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- * @param[in] name A string or undefined <code>PP_Var</code>. The name of the
- * alarm to get. Defaults to the empty string.
- * @param[out] alarm A <code>PP_Alarms_Alarm_Dev</code> struct to store the
- * output result.
- * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
- * completion.
- *
- * @return An error code from <code>pp_errors.h</code>
- */
- int32_t (*Get)(PP_Instance instance,
- struct PP_Var name,
- struct PP_Alarms_Alarm_Dev* alarm,
- struct PP_CompletionCallback callback);
- /**
- * Gets an array of all the alarms.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- * @param[out] alarms A <code>PP_Alarms_Alarm_Array_Dev</code> to store the
- * output result.
- * @param[in] array_allocator A <code>PP_ArrayOutput</code> to allocate memory
- * for <code>alarms</code>.
- * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
- * completion.
- *
- * @return An error code from <code>pp_errors.h</code>
- */
- int32_t (*GetAll)(PP_Instance instance,
- struct PP_Alarms_Alarm_Array_Dev* alarms,
- struct PP_ArrayOutput array_allocator,
- struct PP_CompletionCallback callback);
- /**
- * Clears the alarm with the given name.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- * @param[in] name A string or undefined <code>PP_Var</code>. The name of the
- * alarm to clear. Defaults to the empty string.
- */
- void (*Clear)(PP_Instance instance, struct PP_Var name);
- /**
- * Clears all alarms.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- */
- void (*ClearAll)(PP_Instance instance);
- /**
- * Registers <code>PP_Alarms_OnAlarm_Dev</code> event.
- *
- * @param[in] instance A <code>PP_Instance</code>.
- * @param[in] callback The callback to receive notifications.
- * @param[inout] user_data An opaque pointer that will be passed to
- * <code>callback</code>.
- *
- * @return A listener ID, or 0 if failed.
- *
- * TODO(yzshen): add a PPB_Events_Dev interface for unregistering:
- * void UnregisterListener(PP_instance instance, uint32_t listener_id);
- */
- uint32_t (*AddOnAlarmListener)(PP_Instance instance,
- PP_Alarms_OnAlarm_Dev callback,
- void* user_data);
-};
-
-typedef struct PPB_Alarms_Dev_0_1 PPB_Alarms_Dev;
-/**
- * @}
- */
-
-#endif /* PPAPI_C_DEV_PPB_ALARMS_DEV_H_ */
-
diff --git a/ppapi/cpp/dev/alarms_dev.cc b/ppapi/cpp/dev/alarms_dev.cc
deleted file mode 100644
index 1030185..0000000
--- a/ppapi/cpp/dev/alarms_dev.cc
+++ /dev/null
@@ -1,295 +0,0 @@
-// Copyright 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.
-
-#include "ppapi/cpp/dev/alarms_dev.h"
-
-#include "ppapi/cpp/completion_callback.h"
-#include "ppapi/cpp/dev/array_dev.h"
-#include "ppapi/cpp/dev/to_c_type_converter_dev.h"
-#include "ppapi/cpp/module_impl.h"
-
-namespace pp {
-
-namespace {
-
-template <> const char* interface_name<PPB_Alarms_Dev_0_1>() {
- return PPB_ALARMS_DEV_INTERFACE_0_1;
-}
-
-} // namespace
-
-namespace alarms {
-
-Alarm_Dev::Alarm_Dev()
- : name_wrapper_(&storage_->name, NOT_OWNED),
- period_in_minutes_wrapper_(&storage_->period_in_minutes, NOT_OWNED) {
-}
-
-Alarm_Dev::Alarm_Dev(const Alarm_Dev& other)
- : name_wrapper_(&storage_->name, NOT_OWNED),
- period_in_minutes_wrapper_(&storage_->period_in_minutes, NOT_OWNED) {
- operator=(other);
-}
-
-Alarm_Dev::Alarm_Dev(const PP_Alarms_Alarm_Dev& other)
- : name_wrapper_(&storage_->name, NOT_OWNED),
- period_in_minutes_wrapper_(&storage_->period_in_minutes, NOT_OWNED) {
- operator=(other);
-}
-
-Alarm_Dev::Alarm_Dev(PP_Alarms_Alarm_Dev* storage, NotOwned)
- : storage_(storage, NOT_OWNED),
- name_wrapper_(&storage_->name, NOT_OWNED),
- period_in_minutes_wrapper_(&storage_->period_in_minutes, NOT_OWNED) {
-}
-
-Alarm_Dev::~Alarm_Dev() {
-}
-
-Alarm_Dev& Alarm_Dev::operator=(const Alarm_Dev& other) {
- return operator=(*other.storage_);
-}
-
-Alarm_Dev& Alarm_Dev::operator=(const PP_Alarms_Alarm_Dev& other) {
- if (storage_.get() == &other)
- return *this;
-
- name_wrapper_ = other.name;
- storage_->scheduled_time = other.scheduled_time;
- period_in_minutes_wrapper_ = other.period_in_minutes;
-
- return *this;
-}
-
-std::string Alarm_Dev::name() const {
- return name_wrapper_.get();
-}
-
-void Alarm_Dev::set_name(const std::string& value) {
- name_wrapper_.set(value);
-}
-
-double Alarm_Dev::scheduled_time() const {
- return storage_->scheduled_time;
-}
-
-void Alarm_Dev::set_scheduled_time(double value) {
- storage_->scheduled_time = value;
-}
-
-bool Alarm_Dev::is_period_in_minutes_set() const {
- return period_in_minutes_wrapper_.is_set();
-}
-
-void Alarm_Dev::unset_period_in_minutes() {
- period_in_minutes_wrapper_.unset();
-}
-
-double Alarm_Dev::period_in_minutes() const {
- return period_in_minutes_wrapper_.get();
-}
-
-void Alarm_Dev::set_period_in_minutes(double value) {
- period_in_minutes_wrapper_.set(value);
-}
-
-const PP_Alarms_Alarm_Dev* Alarm_Dev::ToStruct() const {
- return storage_.get();
-}
-
-PP_Alarms_Alarm_Dev* Alarm_Dev::StartRawUpdate() {
- name_wrapper_.StartRawUpdate();
- period_in_minutes_wrapper_.StartRawUpdate();
-
- return storage_.get();
-}
-
-void Alarm_Dev::EndRawUpdate() {
- name_wrapper_.EndRawUpdate();
- period_in_minutes_wrapper_.EndRawUpdate();
-}
-
-AlarmCreateInfo_Dev::AlarmCreateInfo_Dev()
- : when_wrapper_(&storage_->when, NOT_OWNED),
- delay_in_minutes_wrapper_(&storage_->delay_in_minutes, NOT_OWNED),
- period_in_minutes_wrapper_(&storage_->period_in_minutes, NOT_OWNED) {
-}
-
-AlarmCreateInfo_Dev::AlarmCreateInfo_Dev(const AlarmCreateInfo_Dev& other)
- : when_wrapper_(&storage_->when, NOT_OWNED),
- delay_in_minutes_wrapper_(&storage_->delay_in_minutes, NOT_OWNED),
- period_in_minutes_wrapper_(&storage_->period_in_minutes, NOT_OWNED) {
- operator=(other);
-}
-
-AlarmCreateInfo_Dev::AlarmCreateInfo_Dev(
- const PP_Alarms_AlarmCreateInfo_Dev& other)
- : when_wrapper_(&storage_->when, NOT_OWNED),
- delay_in_minutes_wrapper_(&storage_->delay_in_minutes, NOT_OWNED),
- period_in_minutes_wrapper_(&storage_->period_in_minutes, NOT_OWNED) {
- operator=(other);
-}
-
-AlarmCreateInfo_Dev::AlarmCreateInfo_Dev(
- PP_Alarms_AlarmCreateInfo_Dev* storage,
- NotOwned)
- : storage_(storage, NOT_OWNED),
- when_wrapper_(&storage_->when, NOT_OWNED),
- delay_in_minutes_wrapper_(&storage_->delay_in_minutes, NOT_OWNED),
- period_in_minutes_wrapper_(&storage_->period_in_minutes, NOT_OWNED) {
-}
-
-AlarmCreateInfo_Dev::~AlarmCreateInfo_Dev() {
-}
-
-AlarmCreateInfo_Dev& AlarmCreateInfo_Dev::operator=(
- const AlarmCreateInfo_Dev& other) {
- return operator=(*other.storage_);
-}
-
-AlarmCreateInfo_Dev& AlarmCreateInfo_Dev::operator=(
- const PP_Alarms_AlarmCreateInfo_Dev& other) {
- if (storage_.get() == &other)
- return *this;
-
- when_wrapper_ = other.when;
- delay_in_minutes_wrapper_ = other.delay_in_minutes;
- period_in_minutes_wrapper_ = other.period_in_minutes;
-
- return *this;
-}
-
-bool AlarmCreateInfo_Dev::is_when_set() const {
- return when_wrapper_.is_set();
-}
-
-void AlarmCreateInfo_Dev::unset_when() {
- when_wrapper_.unset();
-}
-
-double AlarmCreateInfo_Dev::when() const {
- return when_wrapper_.get();
-}
-
-void AlarmCreateInfo_Dev::set_when(double value) {
- when_wrapper_.set(value);
-}
-
-bool AlarmCreateInfo_Dev::is_delay_in_minutes_set() const {
- return delay_in_minutes_wrapper_.is_set();
-}
-
-void AlarmCreateInfo_Dev::unset_delay_in_minutes() {
- delay_in_minutes_wrapper_.unset();
-}
-
-double AlarmCreateInfo_Dev::delay_in_minutes() const {
- return delay_in_minutes_wrapper_.get();
-}
-
-void AlarmCreateInfo_Dev::set_delay_in_minutes(double value) {
- delay_in_minutes_wrapper_.set(value);
-}
-
-bool AlarmCreateInfo_Dev::is_period_in_minutes_set() const {
- return period_in_minutes_wrapper_.is_set();
-}
-
-void AlarmCreateInfo_Dev::unset_period_in_minutes() {
- period_in_minutes_wrapper_.unset();
-}
-
-double AlarmCreateInfo_Dev::period_in_minutes() const {
- return period_in_minutes_wrapper_.get();
-}
-
-void AlarmCreateInfo_Dev::set_period_in_minutes(double value) {
- period_in_minutes_wrapper_.set(value);
-}
-
-const PP_Alarms_AlarmCreateInfo_Dev* AlarmCreateInfo_Dev::ToStruct() const {
- return storage_.get();
-}
-
-PP_Alarms_AlarmCreateInfo_Dev* AlarmCreateInfo_Dev::StartRawUpdate() {
- when_wrapper_.StartRawUpdate();
- delay_in_minutes_wrapper_.StartRawUpdate();
- period_in_minutes_wrapper_.StartRawUpdate();
-
- return storage_.get();
-}
-
-void AlarmCreateInfo_Dev::EndRawUpdate() {
- when_wrapper_.EndRawUpdate();
- delay_in_minutes_wrapper_.EndRawUpdate();
- period_in_minutes_wrapper_.EndRawUpdate();
-}
-
-Alarms_Dev::Alarms_Dev(const InstanceHandle& instance) : instance_(instance) {
-}
-
-Alarms_Dev::~Alarms_Dev() {
-}
-
-void Alarms_Dev::Create(const Optional<std::string>& name,
- const AlarmCreateInfo_Dev& alarm_info) {
- if (!has_interface<PPB_Alarms_Dev_0_1>())
- return;
-
- internal::ToCTypeConverter<Optional<std::string> > name_converter(name);
- internal::ToCTypeConverter<AlarmCreateInfo_Dev> alarm_info_converter(
- alarm_info);
-
- return get_interface<PPB_Alarms_Dev_0_1>()->Create(
- instance_.pp_instance(),
- name_converter.ToCInput(),
- alarm_info_converter.ToCInput());
-}
-
-int32_t Alarms_Dev::Get(const Optional<std::string>& name,
- const GetCallback& callback) {
- if (!has_interface<PPB_Alarms_Dev_0_1>())
- return callback.MayForce(PP_ERROR_NOINTERFACE);
-
- internal::ToCTypeConverter<Optional<std::string> > name_converter(name);
-
- return get_interface<PPB_Alarms_Dev_0_1>()->Get(
- instance_.pp_instance(),
- name_converter.ToCInput(),
- callback.output(),
- callback.pp_completion_callback());
-}
-
-int32_t Alarms_Dev::GetAll(const GetAllCallback& callback) {
- if (!has_interface<PPB_Alarms_Dev_0_1>())
- return callback.MayForce(PP_ERROR_NOINTERFACE);
-
- return get_interface<PPB_Alarms_Dev_0_1>()->GetAll(
- instance_.pp_instance(),
- callback.output(),
- internal::ArrayAllocator::Get(),
- callback.pp_completion_callback());
-}
-
-void Alarms_Dev::Clear(const Optional<std::string>& name) {
- if (!has_interface<PPB_Alarms_Dev_0_1>())
- return;
-
- internal::ToCTypeConverter<Optional<std::string> > name_converter(name);
-
- return get_interface<PPB_Alarms_Dev_0_1>()->Clear(
- instance_.pp_instance(),
- name_converter.ToCInput());
-}
-
-void Alarms_Dev::ClearAll() {
- if (!has_interface<PPB_Alarms_Dev_0_1>())
- return;
-
- return get_interface<PPB_Alarms_Dev_0_1>()->ClearAll(
- instance_.pp_instance());
-}
-
-} // namespace alarms
-} // namespace pp
diff --git a/ppapi/cpp/dev/alarms_dev.h b/ppapi/cpp/dev/alarms_dev.h
deleted file mode 100644
index fe966e8..0000000
--- a/ppapi/cpp/dev/alarms_dev.h
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright 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.
-
-#ifndef PPAPI_CPP_DEV_ALARMS_DEV_H_
-#define PPAPI_CPP_DEV_ALARMS_DEV_H_
-
-#include <string>
-
-#include "ppapi/c/dev/ppb_alarms_dev.h"
-#include "ppapi/cpp/dev/may_own_ptr_dev.h"
-#include "ppapi/cpp/dev/optional_dev.h"
-#include "ppapi/cpp/dev/string_wrapper_dev.h"
-#include "ppapi/cpp/dev/struct_wrapper_output_traits_dev.h"
-#include "ppapi/cpp/instance_handle.h"
-#include "ppapi/cpp/output_traits.h"
-
-namespace pp {
-
-template <typename T>
-class CompletionCallbackWithOutput;
-
-template <typename T>
-class Array;
-
-namespace alarms {
-
-// Data types ------------------------------------------------------------------
-class Alarm_Dev {
- public:
- typedef PP_Alarms_Alarm_Dev CType;
- typedef PP_Alarms_Alarm_Array_Dev CArrayType;
-
- Alarm_Dev();
-
- Alarm_Dev(const Alarm_Dev& other);
-
- explicit Alarm_Dev(const PP_Alarms_Alarm_Dev& other);
-
- // Creates an accessor to |storage| but doesn't take ownership of the memory.
- // |storage| must live longer than this object. The contents pointed to by
- // |storage| is managed by this object.
- // Used by Pepper internal implementation.
- Alarm_Dev(PP_Alarms_Alarm_Dev* storage, NotOwned);
-
- ~Alarm_Dev();
-
- Alarm_Dev& operator=(const Alarm_Dev& other);
- Alarm_Dev& operator=(const PP_Alarms_Alarm_Dev& other);
-
- std::string name() const;
- void set_name(const std::string& value);
-
- double scheduled_time() const;
- void set_scheduled_time(double value);
-
- bool is_period_in_minutes_set() const;
- void unset_period_in_minutes();
- double period_in_minutes() const;
- void set_period_in_minutes(double value);
-
- const PP_Alarms_Alarm_Dev* ToStruct() const;
-
- // The returned pointer is still owned by this object. And after it is used,
- // EndRawUpdate() must be called.
- PP_Alarms_Alarm_Dev* StartRawUpdate();
- void EndRawUpdate();
-
- private:
- internal::MayOwnPtr<PP_Alarms_Alarm_Dev> storage_;
-
- internal::StringWrapper name_wrapper_;
- Optional<double> period_in_minutes_wrapper_;
-};
-
-class AlarmCreateInfo_Dev {
- public:
- typedef PP_Alarms_AlarmCreateInfo_Dev CType;
-
- AlarmCreateInfo_Dev();
-
- AlarmCreateInfo_Dev(const AlarmCreateInfo_Dev& other);
-
- explicit AlarmCreateInfo_Dev(const PP_Alarms_AlarmCreateInfo_Dev& other);
-
- // Creates an accessor to |storage| but doesn't take ownership of the memory.
- // |storage| must live longer than this object. The contents pointed to by
- // |storage| is managed by this object.
- // Used by Pepper internal implementation.
- AlarmCreateInfo_Dev(PP_Alarms_AlarmCreateInfo_Dev* storage, NotOwned);
-
- ~AlarmCreateInfo_Dev();
-
- AlarmCreateInfo_Dev& operator=(const AlarmCreateInfo_Dev& other);
- AlarmCreateInfo_Dev& operator=(const PP_Alarms_AlarmCreateInfo_Dev& other);
-
- bool is_when_set() const;
- void unset_when();
- double when() const;
- void set_when(double value);
-
- bool is_delay_in_minutes_set() const;
- void unset_delay_in_minutes();
- double delay_in_minutes() const;
- void set_delay_in_minutes(double value);
-
- bool is_period_in_minutes_set() const;
- void unset_period_in_minutes();
- double period_in_minutes() const;
- void set_period_in_minutes(double value);
-
- const PP_Alarms_AlarmCreateInfo_Dev* ToStruct() const;
-
- // The returned pointer is still owned by this object. And after it is used,
- // EndRawUpdate() must be called.
- PP_Alarms_AlarmCreateInfo_Dev* StartRawUpdate();
- void EndRawUpdate();
-
- private:
- internal::MayOwnPtr<PP_Alarms_AlarmCreateInfo_Dev> storage_;
-
- Optional<double> when_wrapper_;
- Optional<double> delay_in_minutes_wrapper_;
- Optional<double> period_in_minutes_wrapper_;
-};
-
-// Functions -------------------------------------------------------------------
-class Alarms_Dev {
- public:
- explicit Alarms_Dev(const InstanceHandle& instance);
- ~Alarms_Dev();
-
- void Create(const Optional<std::string>& name,
- const AlarmCreateInfo_Dev& alarm_info);
-
- typedef CompletionCallbackWithOutput<Alarm_Dev> GetCallback;
- int32_t Get(const Optional<std::string>& name, const GetCallback& callback);
-
- typedef CompletionCallbackWithOutput<Array<Alarm_Dev> > GetAllCallback;
- int32_t GetAll(const GetAllCallback& callback);
-
- void Clear(const Optional<std::string>& name);
-
- void ClearAll();
-
- private:
- InstanceHandle instance_;
-};
-
-// Events ----------------------------------------------------------------------
-// TODO(yzshen): add onAlarm event.
-
-} // namespace alarms
-
-namespace internal {
-
-template <>
-struct CallbackOutputTraits<alarms::Alarm_Dev>
- : public internal::StructWrapperOutputTraits<alarms::Alarm_Dev> {
-};
-
-template <>
-struct CallbackOutputTraits<alarms::AlarmCreateInfo_Dev>
- : public internal::StructWrapperOutputTraits<alarms::AlarmCreateInfo_Dev> {
-};
-
-} // namespace internal
-} // namespace pp
-
-#endif // PPAPI_CPP_DEV_ALARMS_DEV_H_
diff --git a/ppapi/cpp/dev/array_dev.h b/ppapi/cpp/dev/array_dev.h
deleted file mode 100644
index 5d08190..0000000
--- a/ppapi/cpp/dev/array_dev.h
+++ /dev/null
@@ -1,196 +0,0 @@
-// Copyright 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.
-
-#ifndef PPAPI_CPP_DEV_ARRAY_DEV_H_
-#define PPAPI_CPP_DEV_ARRAY_DEV_H_
-
-#include <cstdlib>
-
-#include <vector>
-
-#include "ppapi/cpp/dev/may_own_ptr_dev.h"
-#include "ppapi/cpp/logging.h"
-#include "ppapi/cpp/output_traits.h"
-
-namespace pp {
-
-template <typename T>
-class Array;
-
-namespace internal {
-
-class ArrayAllocator {
- public:
- // Allocates memory and zero-fills it.
- static void* Alloc(uint32_t count, uint32_t size) {
- if (count == 0 || size == 0)
- return NULL;
-
- return calloc(count, size);
- }
-
- static void Free(void* mem) { free(mem); }
-
- static PP_ArrayOutput Get() {
- PP_ArrayOutput array_output = { &ArrayAllocator::GetDataBuffer, NULL };
- return array_output;
- }
-
- private:
- static void* GetDataBuffer(void* /* user_data */,
- uint32_t element_count,
- uint32_t element_size) {
- return Alloc(element_count, element_size);
- }
-};
-
-// A specialization of CallbackOutputTraits for pp::Array parameters.
-template <typename T>
-struct CallbackOutputTraits<Array<T> > {
- typedef typename Array<T>::CArrayType* APIArgType;
- typedef Array<T> StorageType;
-
- // Returns the underlying C struct of |t|, which can be passed to the browser
- // as an output parameter.
- static inline APIArgType StorageToAPIArg(StorageType& t) {
- return t.StartRawUpdate();
- }
-
- // For each |t| passed into StorageToAPIArg(), this method must be called
- // exactly once in order to match StartRawUpdate() and EndRawUpdate().
- static inline Array<T>& StorageToPluginArg(StorageType& t) {
- t.EndRawUpdate();
- return t;
- }
-
- static inline void Initialize(StorageType* /* t */) {}
-};
-
-} // namespace internal
-
-// Generic array for struct wrappers.
-template <class T>
-class Array {
- public:
- typedef typename T::CArrayType CArrayType;
- typedef typename T::CType CType;
-
- Array() {}
-
- explicit Array(uint32_t size) { Reset(size); }
-
- // Creates an accessor to |storage| but doesn't take ownership of the memory.
- // |storage| must live longer than this object.
- //
- // Although this object doesn't own the memory of |storage|, it manages the
- // memory pointed to by |storage->elements| and resets |storage| to empty when
- // destructed.
- Array(CArrayType* storage, NotOwned) : storage_(storage, NOT_OWNED) {
- CreateWrappers();
- }
-
- Array(const Array<T>& other) { DeepCopy(*other.storage_); }
-
- ~Array() { Reset(0); }
-
- Array<T>& operator=(const Array<T>& other) {
- return operator=(*other.storage_);
- }
-
- Array<T>& operator=(const CArrayType& other) {
- if (storage_.get() == &other)
- return *this;
-
- Reset(0);
- DeepCopy(other);
-
- return *this;
- }
-
- uint32_t size() const { return storage_->size; }
-
- T& operator[](uint32_t index) {
- PP_DCHECK(storage_->size == wrappers_.size());
- PP_DCHECK(index < storage_->size);
- PP_DCHECK(wrappers_[index]->ToStruct() == storage_->elements + index);
- return *wrappers_[index];
- }
-
- const T& operator[](uint32_t index) const {
- PP_DCHECK(storage_->size == wrappers_.size());
- PP_DCHECK(index < storage_->size);
- PP_DCHECK(wrappers_[index]->ToStruct() == storage_->elements + index);
- return *wrappers_[index];
- }
-
- // Clears the existing contents of the array, and resets it to |size| elements
- // of default value.
- void Reset(uint32_t size) {
- // Wrappers must be destroyed before we free |storage_->elements|, because
- // they may try to access the memory in their destructors.
- DeleteWrappers();
-
- internal::ArrayAllocator::Free(storage_->elements);
- storage_->elements = NULL;
-
- storage_->size = size;
- if (size > 0) {
- storage_->elements = static_cast<CType*>(
- internal::ArrayAllocator::Alloc(size, sizeof(CType)));
- }
-
- CreateWrappers();
- }
-
- // Sets the underlying C array struct to empty before returning it.
- CArrayType* StartRawUpdate() {
- Reset(0);
- return storage_.get();
- }
-
- void EndRawUpdate() { CreateWrappers(); }
-
- private:
- void DeepCopy(const CArrayType& other) {
- storage_->size = other.size;
-
- if (storage_->size > 0) {
- storage_->elements = static_cast<CType*>(
- internal::ArrayAllocator::Alloc(storage_->size, sizeof(CType)));
- }
-
- CreateWrappers();
-
- for (size_t i = 0; i < storage_->size; ++i)
- wrappers_[i] = other.elements[i];
- }
-
- void DeleteWrappers() {
- for (typename std::vector<T*>::iterator iter = wrappers_.begin();
- iter != wrappers_.end();
- ++iter) {
- delete *iter;
- }
- wrappers_.clear();
- }
-
- void CreateWrappers() {
- PP_DCHECK(wrappers_.empty());
-
- uint32_t size = storage_->size;
- if (size == 0)
- return;
-
- wrappers_.reserve(size);
- for (size_t i = 0; i < size; ++i)
- wrappers_.push_back(new T(&storage_->elements[i], NOT_OWNED));
- }
-
- internal::MayOwnPtr<CArrayType> storage_;
- std::vector<T*> wrappers_;
-};
-
-} // namespace pp
-
-#endif // PPAPI_CPP_DEV_ARRAY_DEV_H_
diff --git a/ppapi/cpp/dev/may_own_ptr_dev.h b/ppapi/cpp/dev/may_own_ptr_dev.h
deleted file mode 100644
index f31d59d..0000000
--- a/ppapi/cpp/dev/may_own_ptr_dev.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 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.
-
-#ifndef PPAPI_CPP_DEV_MAY_OWN_PTR_DEV_H_
-#define PPAPI_CPP_DEV_MAY_OWN_PTR_DEV_H_
-
-#include "ppapi/cpp/logging.h"
-
-namespace pp {
-
-// An annotation used along with a pointer parameter of a function to indicate
-// that the function doesn't take ownership of the pointer.
-enum NotOwned {
- NOT_OWNED
-};
-
-namespace internal {
-
-// MayOwnPtr keeps track of whether it has ownership of the pointer it holds,
-// and deletes the pointer on destruction if it does.
-template <typename T>
-class MayOwnPtr {
- public:
- // Creates and owns a T instance.
- // NOTE: "()" after T is important to do zero-initialization for POD types.
- MayOwnPtr() : value_(new T()), owned_(true) {}
-
- // It doesn't take ownership of |value|, therefore |value| must live longer
- // than this object.
- MayOwnPtr(T* value, NotOwned) : value_(value), owned_(false) {
- PP_DCHECK(value);
- }
-
- ~MayOwnPtr() {
- if (owned_)
- delete value_;
- }
-
- const T* get() const { return value_; }
- T* get() { return value_; }
-
- const T& operator*() const { return *value_; }
- T& operator*() { return *value_; }
-
- const T* operator->() const { return value_; }
- T* operator->() { return value_; }
-
- private:
- // Disallow copying and assignment.
- MayOwnPtr(const MayOwnPtr<T>&);
- MayOwnPtr<T>& operator=(const MayOwnPtr<T>&);
-
- T* value_;
- bool owned_;
-};
-
-} // namespace internal
-} // namespace pp
-
-#endif // PPAPI_CPP_DEV_MAY_OWN_PTR_DEV_H_
diff --git a/ppapi/cpp/dev/optional_dev.h b/ppapi/cpp/dev/optional_dev.h
deleted file mode 100644
index caf364d..0000000
--- a/ppapi/cpp/dev/optional_dev.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright 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.
-
-#ifndef PPAPI_CPP_DEV_OPTIONAL_DEV_H_
-#define PPAPI_CPP_DEV_OPTIONAL_DEV_H_
-
-#include "ppapi/c/dev/pp_optional_structs_dev.h"
-#include "ppapi/c/pp_bool.h"
-#include "ppapi/cpp/dev/may_own_ptr_dev.h"
-#include "ppapi/cpp/dev/string_wrapper_dev.h"
-#include "ppapi/cpp/logging.h"
-#include "ppapi/cpp/var.h"
-
-namespace pp {
-
-template <typename T>
-class Optional;
-
-template <>
-class Optional<double> {
- public:
- typedef const PP_Optional_Double_Dev* CInputType;
-
- Optional() {}
-
- Optional(double value) { set(value); }
-
- // Creates an accessor to |storage| but doesn't take ownership of the memory.
- // |storage| must live longer than this object.
- Optional(PP_Optional_Double_Dev* storage, NotOwned)
- : storage_(storage, NOT_OWNED) {
- }
-
- Optional(const Optional<double>& other) { *storage_ = *other.storage_; }
-
- Optional<double>& operator=(const Optional<double>& other) {
- return operator=(*other.storage_);
- }
-
- Optional<double>& operator=(const PP_Optional_Double_Dev& other) {
- if (storage_.get() == &other)
- return *this;
-
- *storage_ = other;
- return *this;
- }
-
- bool is_set() const { return PP_ToBool(storage_->is_set); }
- void unset() { storage_->is_set = PP_FALSE; }
-
- double get() const {
- PP_DCHECK(is_set());
- return storage_->value;
- }
-
- void set(double value) {
- storage_->value = value;
- storage_->is_set = PP_TRUE;
- }
-
- const PP_Optional_Double_Dev* ToCInput() const { return storage_.get(); }
-
- PP_Optional_Double_Dev* StartRawUpdate() { return storage_.get(); }
- void EndRawUpdate() {}
-
- private:
- internal::MayOwnPtr<PP_Optional_Double_Dev> storage_;
-};
-
-template <>
-class Optional<std::string> {
- public:
- typedef const PP_Var& CInputType;
-
- Optional() {}
-
- Optional(const std::string& value) : wrapper_(value) {}
-
- Optional(const char* value) : wrapper_(value) {}
-
- // Creates an accessor to |storage| but doesn't take ownership of the memory.
- // |storage| must live longer than this object.
- //
- // Although this object doesn't own the memory of |storage|, it manages the
- // ref count and sets the var to undefined when destructed.
- Optional(PP_Var* storage, NotOwned) : wrapper_(storage, NOT_OWNED) {}
-
- Optional(const Optional<std::string>& other) : wrapper_(other.wrapper_) {}
-
- Optional<std::string>& operator=(const Optional<std::string>& other) {
- wrapper_ = other.wrapper_;
- return *this;
- }
-
- Optional<std::string>& operator=(const PP_Var& other) {
- wrapper_ = other;
- return *this;
- }
-
- bool is_set() const { return wrapper_.is_set(); }
- void unset() { wrapper_.unset(); }
- std::string get() const { return wrapper_.get(); }
- void set(const std::string& value) { wrapper_.set(value); }
-
- const PP_Var& ToCInput() const { return wrapper_.ToVar(); }
-
- PP_Var* StartRawUpdate() { return wrapper_.StartRawUpdate(); }
- void EndRawUpdate() { wrapper_.EndRawUpdate(); }
-
- private:
- internal::OptionalStringWrapper wrapper_;
-};
-
-} // namespace pp
-
-#endif // PPAPI_CPP_DEV_OPTIONAL_DEV_H_
diff --git a/ppapi/cpp/dev/string_wrapper_dev.cc b/ppapi/cpp/dev/string_wrapper_dev.cc
deleted file mode 100644
index 7f0976c..0000000
--- a/ppapi/cpp/dev/string_wrapper_dev.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright 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.
-
-#include "ppapi/cpp/dev/string_wrapper_dev.h"
-
-#include "ppapi/cpp/logging.h"
-#include "ppapi/cpp/var.h"
-
-namespace pp {
-namespace internal {
-
-OptionalStringWrapper::OptionalStringWrapper() {
-}
-
-OptionalStringWrapper::OptionalStringWrapper(const std::string& value) {
- *storage_ = Var(value).Detach();
-}
-
-OptionalStringWrapper::OptionalStringWrapper(PP_Var* storage, NotOwned)
- : storage_(storage, NOT_OWNED) {
- PP_DCHECK(storage_->type == PP_VARTYPE_STRING ||
- storage_->type == PP_VARTYPE_UNDEFINED);
-}
-
-OptionalStringWrapper::OptionalStringWrapper(
- const OptionalStringWrapper& other) {
- // Add one ref.
- *storage_ = Var(*other.storage_).Detach();
-}
-
-OptionalStringWrapper::~OptionalStringWrapper() {
- unset();
-}
-
-OptionalStringWrapper& OptionalStringWrapper::operator=(
- const OptionalStringWrapper& other) {
- return operator=(*other.storage_);
-}
-
-OptionalStringWrapper& OptionalStringWrapper::operator=(const PP_Var& other) {
- if (storage_.get() == &other)
- return *this;
-
- Var auto_release(PASS_REF, *storage_);
- // Add one ref.
- *storage_ = Var(other).Detach();
- return *this;
-}
-
-bool OptionalStringWrapper::is_set() const {
- PP_DCHECK(storage_->type == PP_VARTYPE_STRING ||
- storage_->type == PP_VARTYPE_UNDEFINED);
- return storage_->type == PP_VARTYPE_STRING;
-}
-
-void OptionalStringWrapper::unset() {
- Var auto_release(PASS_REF, *storage_);
- *storage_ = PP_MakeUndefined();
-}
-
-std::string OptionalStringWrapper::get() const {
- // TODO(yzshen): consider adding a cache.
- Var var(*storage_);
- if (var.is_string()) {
- return var.AsString();
- } else {
- PP_NOTREACHED();
- return std::string();
- }
-}
-
-void OptionalStringWrapper::set(const std::string& value) {
- Var auto_release(PASS_REF, *storage_);
- *storage_ = Var(value).Detach();
-}
-
-PP_Var* OptionalStringWrapper::StartRawUpdate() {
- unset();
- return storage_.get();
-}
-
-void OptionalStringWrapper::EndRawUpdate() {
- PP_DCHECK(storage_->type == PP_VARTYPE_STRING ||
- storage_->type == PP_VARTYPE_UNDEFINED);
-}
-
-StringWrapper::StringWrapper() : storage_(std::string()) {
-}
-
-StringWrapper::StringWrapper(const std::string& value) : storage_(value) {
-}
-
-StringWrapper::StringWrapper(PP_Var* storage, NotOwned)
- : storage_(storage, NOT_OWNED) {
- if (!storage_.is_set())
- storage_.set(std::string());
-}
-
-StringWrapper::StringWrapper(const StringWrapper& other)
- : storage_(other.storage_) {
-}
-
-StringWrapper::~StringWrapper() {
-}
-
-StringWrapper& StringWrapper::operator=(const StringWrapper& other) {
- storage_ = other.storage_;
- return *this;
-}
-
-StringWrapper& StringWrapper::operator=(const PP_Var& other) {
- PP_DCHECK(other.type == PP_VARTYPE_STRING);
- storage_ = other;
- return *this;
-}
-
-PP_Var* StringWrapper::StartRawUpdate() {
- return storage_.StartRawUpdate();
-}
-
-void StringWrapper::EndRawUpdate() {
- storage_.EndRawUpdate();
- if (!storage_.is_set())
- storage_.set(std::string());
-}
-
-} // namespace internal
-} // namespace pp
diff --git a/ppapi/cpp/dev/string_wrapper_dev.h b/ppapi/cpp/dev/string_wrapper_dev.h
deleted file mode 100644
index 5ac946d..0000000
--- a/ppapi/cpp/dev/string_wrapper_dev.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 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.
-
-#ifndef PPAPI_CPP_DEV_STRING_WRAPPER_DEV_H_
-#define PPAPI_CPP_DEV_STRING_WRAPPER_DEV_H_
-
-#include <string>
-
-#include "ppapi/c/pp_var.h"
-#include "ppapi/cpp/dev/may_own_ptr_dev.h"
-
-namespace pp {
-namespace internal {
-
-// An optional string backed by a PP_Var. When the string is not set, the type
-// of the PP_Var is set to PP_VARTYPE_UNDEFINED; otherwise, it is set to
-// PP_VARTYPE_STRING.
-class OptionalStringWrapper {
- public:
- OptionalStringWrapper();
-
- explicit OptionalStringWrapper(const std::string& value);
-
- // Creates an accessor to |storage| but doesn't take ownership of the memory.
- // |storage| must live longer than this object.
- //
- // Although this object doesn't own the memory of |storage|, it manages the
- // ref count and sets the var to undefined when destructed.
- OptionalStringWrapper(PP_Var* storage, NotOwned);
-
- OptionalStringWrapper(const OptionalStringWrapper& other);
-
- ~OptionalStringWrapper();
-
- OptionalStringWrapper& operator=(const OptionalStringWrapper& other);
- OptionalStringWrapper& operator=(const PP_Var& other);
-
- bool is_set() const;
- void unset();
- std::string get() const;
- void set(const std::string& value);
-
- const PP_Var& ToVar() const { return *storage_; }
-
- // Sets the underlying PP_Var to undefined before returning it.
- PP_Var* StartRawUpdate();
- void EndRawUpdate();
-
- private:
- MayOwnPtr<PP_Var> storage_;
-};
-
-// A string backed by a PP_Var whose type is PP_VARTYPE_STRING.
-class StringWrapper {
- public:
- StringWrapper();
-
- explicit StringWrapper(const std::string& value);
-
- // Creates an accessor to |storage| but doesn't take ownership of the memory.
- // |storage| must live longer than this object.
- //
- // Although this object doesn't own the memory of |storage|, it manages the
- // ref count and sets the var to undefined when destructed.
- StringWrapper(PP_Var* storage, NotOwned);
-
- StringWrapper(const StringWrapper& other);
-
- ~StringWrapper();
-
- StringWrapper& operator=(const StringWrapper& other);
- StringWrapper& operator=(const PP_Var& other);
-
- std::string get() const { return storage_.get(); }
- void set(const std::string& value) { return storage_.set(value); }
-
- const PP_Var& ToVar() const { return storage_.ToVar(); }
-
- // Sets the underlying PP_Var to undefined before returning it.
- PP_Var* StartRawUpdate();
- // If the underlying PP_Var wasn't updated to a valid string, sets it to an
- // empty string.
- void EndRawUpdate();
-
- private:
- OptionalStringWrapper storage_;
-};
-
-} // namespace internal
-} // namespace pp
-
-#endif // PPAPI_CPP_DEV_STRING_WRAPPER_DEV_H_
diff --git a/ppapi/cpp/dev/struct_wrapper_output_traits_dev.h b/ppapi/cpp/dev/struct_wrapper_output_traits_dev.h
deleted file mode 100644
index 0c0762e..0000000
--- a/ppapi/cpp/dev/struct_wrapper_output_traits_dev.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 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.
-
-#ifndef PPAPI_CPP_DEV_STRUCT_WRAPPER_OUTPUT_TRAITS_DEV_
-#define PPAPI_CPP_DEV_STRUCT_WRAPPER_OUTPUT_TRAITS_DEV_
-
-namespace pp {
-namespace internal {
-
-// This class is used as the base class for CallbackOutputTraits specialized for
-// C struct wrappers.
-template <typename T>
-struct StructWrapperOutputTraits {
- typedef typename T::CType* APIArgType;
- typedef T StorageType;
-
- // Returns the underlying C struct of |t|, which can be passed to the browser
- // as an output parameter.
- static inline APIArgType StorageToAPIArg(StorageType& t) {
- return t.StartRawUpdate();
- }
-
- // For each |t| passed into StorageToAPIArg(), this method must be called
- // exactly once in order to match StartRawUpdate() and EndRawUpdate().
- static inline T& StorageToPluginArg(StorageType& t) {
- t.EndRawUpdate();
- return t;
- }
-
- static inline void Initialize(StorageType* /* t */) {}
-};
-
-} // namespace internal
-} // namespace pp
-
-#endif // PPAPI_CPP_DEV_STRUCT_WRAPPER_OUTPUT_TRAITS_DEV_
diff --git a/ppapi/cpp/dev/to_c_type_converter_dev.h b/ppapi/cpp/dev/to_c_type_converter_dev.h
deleted file mode 100644
index ffe5ddf..0000000
--- a/ppapi/cpp/dev/to_c_type_converter_dev.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 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.
-
-#ifndef PPAPI_CPP_DEV_TO_C_TYPE_CONVERTER_DEV_H_
-#define PPAPI_CPP_DEV_TO_C_TYPE_CONVERTER_DEV_H_
-
-#include <string>
-
-#include "ppapi/c/pp_var.h"
-#include "ppapi/cpp/dev/optional_dev.h"
-#include "ppapi/cpp/dev/string_wrapper_dev.h"
-
-namespace pp {
-namespace internal {
-
-// ToCTypeConverter is used to convert C++ API input parameters into C API input
-// parameters.
-
-// Generic converter for C struct wrappers.
-template <typename T>
-class ToCTypeConverter {
- public:
- explicit ToCTypeConverter(const T& object) : wrapper_(object) {}
-
- ~ToCTypeConverter() {}
-
- const typename T::CType* ToCInput() const { return wrapper_.ToStruct(); }
-
- private:
- // Disallow copying and assignment.
- ToCTypeConverter(const ToCTypeConverter<T>&);
- ToCTypeConverter<T>& operator=(const ToCTypeConverter<T>&);
-
- const T& wrapper_;
-};
-
-template <>
-class ToCTypeConverter<std::string> {
- public:
- explicit ToCTypeConverter(const std::string& object) : wrapper_(object) {}
-
- ~ToCTypeConverter() {}
-
- const PP_Var& ToCInput() const { return wrapper_.ToVar(); }
-
- private:
- // Disallow copying and assignment.
- ToCTypeConverter(const ToCTypeConverter<std::string>&);
- ToCTypeConverter<std::string>& operator=(
- const ToCTypeConverter<std::string>&);
-
- StringWrapper wrapper_;
-};
-
-template <>
-class ToCTypeConverter<double> {
- public:
- explicit ToCTypeConverter(double object) : storage_(object) {}
-
- ~ToCTypeConverter() {}
-
- double ToCInput() const { return storage_; }
-
- private:
- // Disallow copying and assignment.
- ToCTypeConverter(const ToCTypeConverter<double>&);
- ToCTypeConverter<double>& operator=(const ToCTypeConverter<double>&);
-
- double storage_;
-};
-
-template <typename T>
-class ToCTypeConverter<Optional<T> > {
- public:
- explicit ToCTypeConverter(const Optional<T>& object) : wrapper_(object) {}
-
- ~ToCTypeConverter() {}
-
- typename Optional<T>::CInputType ToCInput() const {
- return wrapper_.ToCInput();
- }
-
- private:
- // Disallow copying and assignment.
- ToCTypeConverter(const ToCTypeConverter<Optional<T> >&);
- ToCTypeConverter<Optional<T> >& operator=(
- const ToCTypeConverter<Optional<T> >&);
-
- const Optional<T>& wrapper_;
-};
-
-} // namespace internal
-} // namespace pp
-
-#endif // PPAPI_CPP_DEV_TO_C_TYPE_CONVERTER_DEV_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 b632db2..d1a2c57 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
@@ -7,7 +7,6 @@
#include "ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.h"
#include "ppapi/c/ppb.h"
-#include "ppapi/c/dev/ppb_alarms_dev.h"
#include "ppapi/c/dev/ppb_audio_input_dev.h"
#include "ppapi/c/dev/ppb_device_ref_dev.h"
#include "ppapi/c/dev/ppb_file_chooser_dev.h"
@@ -145,7 +144,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VarDictionary_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoDecoder_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_WebSocket_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Messaging_1_0;
-static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_3;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_4;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_DeviceRef_Dev_0_1;
@@ -2032,40 +2030,6 @@ static void Pnacl_M14_PPP_Messaging_HandleMessage(PP_Instance instance, struct P
/* Not generating wrapper methods for PPB_URLLoaderTrusted_0_3 */
-/* Begin wrapper methods for PPB_Alarms_Dev_0_1 */
-
-static void Pnacl_M33_PPB_Alarms_Dev_Create(PP_Instance instance, struct PP_Var* name, const struct PP_Alarms_AlarmCreateInfo_Dev* alarm_info) {
- const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface;
- iface->Create(instance, *name, alarm_info);
-}
-
-static int32_t Pnacl_M33_PPB_Alarms_Dev_Get(PP_Instance instance, struct PP_Var* name, struct PP_Alarms_Alarm_Dev* alarm, struct PP_CompletionCallback* callback) {
- const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface;
- return iface->Get(instance, *name, alarm, *callback);
-}
-
-static int32_t Pnacl_M33_PPB_Alarms_Dev_GetAll(PP_Instance instance, struct PP_Alarms_Alarm_Array_Dev* alarms, struct PP_ArrayOutput* array_allocator, struct PP_CompletionCallback* callback) {
- const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface;
- return iface->GetAll(instance, alarms, *array_allocator, *callback);
-}
-
-static void Pnacl_M33_PPB_Alarms_Dev_Clear(PP_Instance instance, struct PP_Var* name) {
- const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface;
- iface->Clear(instance, *name);
-}
-
-static void Pnacl_M33_PPB_Alarms_Dev_ClearAll(PP_Instance instance) {
- const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface;
- iface->ClearAll(instance);
-}
-
-static uint32_t Pnacl_M33_PPB_Alarms_Dev_AddOnAlarmListener(PP_Instance instance, PP_Alarms_OnAlarm_Dev callback, void* user_data) {
- const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface;
- return iface->AddOnAlarmListener(instance, callback, user_data);
-}
-
-/* End wrapper methods for PPB_Alarms_Dev_0_1 */
-
/* Begin wrapper methods for PPB_AudioInput_Dev_0_3 */
static PP_Resource Pnacl_M25_PPB_AudioInput_Dev_Create(PP_Instance instance) {
@@ -4883,15 +4847,6 @@ static const struct PPP_Messaging_1_0 Pnacl_Wrappers_PPP_Messaging_1_0 = {
/* Not generating wrapper interface for PPB_URLLoaderTrusted_0_3 */
-static const struct PPB_Alarms_Dev_0_1 Pnacl_Wrappers_PPB_Alarms_Dev_0_1 = {
- .Create = (void (*)(PP_Instance instance, struct PP_Var name, const struct PP_Alarms_AlarmCreateInfo_Dev* alarm_info))&Pnacl_M33_PPB_Alarms_Dev_Create,
- .Get = (int32_t (*)(PP_Instance instance, struct PP_Var name, struct PP_Alarms_Alarm_Dev* alarm, struct PP_CompletionCallback callback))&Pnacl_M33_PPB_Alarms_Dev_Get,
- .GetAll = (int32_t (*)(PP_Instance instance, struct PP_Alarms_Alarm_Array_Dev* alarms, struct PP_ArrayOutput array_allocator, struct PP_CompletionCallback callback))&Pnacl_M33_PPB_Alarms_Dev_GetAll,
- .Clear = (void (*)(PP_Instance instance, struct PP_Var name))&Pnacl_M33_PPB_Alarms_Dev_Clear,
- .ClearAll = (void (*)(PP_Instance instance))&Pnacl_M33_PPB_Alarms_Dev_ClearAll,
- .AddOnAlarmListener = (uint32_t (*)(PP_Instance instance, PP_Alarms_OnAlarm_Dev callback, void* user_data))&Pnacl_M33_PPB_Alarms_Dev_AddOnAlarmListener
-};
-
static const struct PPB_AudioInput_Dev_0_3 Pnacl_Wrappers_PPB_AudioInput_Dev_0_3 = {
.Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M25_PPB_AudioInput_Dev_Create,
.IsAudioInput = (PP_Bool (*)(PP_Resource resource))&Pnacl_M25_PPB_AudioInput_Dev_IsAudioInput,
@@ -5820,12 +5775,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Messaging_1_0 = {
.real_iface = NULL
};
-static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1 = {
- .iface_macro = PPB_ALARMS_DEV_INTERFACE_0_1,
- .wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_Alarms_Dev_0_1,
- .real_iface = NULL
-};
-
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_3 = {
.iface_macro = PPB_AUDIO_INPUT_DEV_INTERFACE_0_3,
.wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_AudioInput_Dev_0_3,
@@ -6217,7 +6166,6 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_VarDictionary_1_0,
&Pnacl_WrapperInfo_PPB_VideoDecoder_0_1,
&Pnacl_WrapperInfo_PPB_WebSocket_1_0,
- &Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1,
&Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_3,
&Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_4,
&Pnacl_WrapperInfo_PPB_DeviceRef_Dev_0_1,
diff --git a/ppapi/ppapi_proxy.gypi b/ppapi/ppapi_proxy.gypi
index bd5adc4..117ede6 100644
--- a/ppapi/ppapi_proxy.gypi
+++ b/ppapi/ppapi_proxy.gypi
@@ -41,8 +41,6 @@
'proxy/enter_proxy.h',
'proxy/error_conversion.cc',
'proxy/error_conversion.h',
- 'proxy/extensions_common_resource.cc',
- 'proxy/extensions_common_resource.h',
'proxy/file_chooser_resource.cc',
'proxy/file_chooser_resource.h',
'proxy/file_io_resource.cc',
diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi
index 23b00de..78010bd 100644
--- a/ppapi/ppapi_shared.gypi
+++ b/ppapi/ppapi_shared.gypi
@@ -128,8 +128,6 @@
'shared_impl/var.h',
'shared_impl/var_tracker.cc',
'shared_impl/var_tracker.h',
- 'shared_impl/var_value_conversions.cc',
- 'shared_impl/var_value_conversions.h',
# TODO(viettrungluu): Split these out; it won't be used in NaCl.
'shared_impl/private/net_address_private_impl.cc',
'shared_impl/private/net_address_private_impl_constants.cc',
@@ -142,8 +140,6 @@
'thunk/enter.cc',
'thunk/enter.h',
- 'thunk/extensions_common_api.h',
- 'thunk/ppb_alarms_dev_thunk.cc',
'thunk/ppb_audio_api.h',
'thunk/ppb_audio_config_api.h',
'thunk/ppb_audio_config_thunk.cc',
diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi
index 03609b0..50e84c3 100644
--- a/ppapi/ppapi_sources.gypi
+++ b/ppapi/ppapi_sources.gypi
@@ -77,9 +77,7 @@
# Dev interfaces.
'c/dev/pp_cursor_type_dev.h',
- 'c/dev/pp_optional_structs_dev.h',
'c/dev/pp_video_dev.h',
- 'c/dev/ppb_alarms_dev.h',
'c/dev/ppb_buffer_dev.h',
'c/dev/ppb_char_set_dev.h',
'c/dev/ppb_cursor_control_dev.h',
@@ -254,9 +252,6 @@
'cpp/websocket.h',
# Dev interfaces.
- 'cpp/dev/alarms_dev.cc',
- 'cpp/dev/alarms_dev.h',
- 'cpp/dev/array_dev.h',
'cpp/dev/audio_input_dev.cc',
'cpp/dev/audio_input_dev.h',
'cpp/dev/buffer_dev.cc',
@@ -273,22 +268,16 @@
'cpp/dev/font_dev.h',
'cpp/dev/ime_input_event_dev.cc',
'cpp/dev/ime_input_event_dev.h',
- 'cpp/dev/may_own_ptr_dev.h',
'cpp/dev/memory_dev.cc',
'cpp/dev/memory_dev.h',
- 'cpp/dev/optional_dev.h',
'cpp/dev/printing_dev.cc',
'cpp/dev/printing_dev.h',
'cpp/dev/scrollbar_dev.cc',
'cpp/dev/scrollbar_dev.h',
'cpp/dev/selection_dev.cc',
'cpp/dev/selection_dev.h',
- 'cpp/dev/string_wrapper_dev.cc',
- 'cpp/dev/string_wrapper_dev.h',
- 'cpp/dev/struct_wrapper_output_traits_dev.h',
'cpp/dev/text_input_dev.cc',
'cpp/dev/text_input_dev.h',
- 'cpp/dev/to_c_type_converter_dev.h',
'cpp/dev/truetype_font_dev.cc',
'cpp/dev/truetype_font_dev.h',
'cpp/dev/url_util_dev.cc',
diff --git a/ppapi/ppapi_tests.gypi b/ppapi/ppapi_tests.gypi
index bc02aa1..df51b73 100644
--- a/ppapi/ppapi_tests.gypi
+++ b/ppapi/ppapi_tests.gypi
@@ -186,7 +186,6 @@
'shared_impl/time_conversion_unittest.cc',
'shared_impl/tracked_callback_unittest.cc',
'shared_impl/var_tracker_unittest.cc',
- 'shared_impl/var_value_conversions_unittest.cc',
],
'conditions': [
[ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
diff --git a/ppapi/proxy/extensions_common_resource.cc b/ppapi/proxy/extensions_common_resource.cc
deleted file mode 100644
index 40d03f9..0000000
--- a/ppapi/proxy/extensions_common_resource.cc
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright (c) 2013 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/proxy/extensions_common_resource.h"
-
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/values.h"
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/proxy/ppapi_messages.h"
-#include "ppapi/proxy/resource_message_params.h"
-#include "ppapi/shared_impl/tracked_callback.h"
-#include "ppapi/shared_impl/var_value_conversions.h"
-
-namespace ppapi {
-namespace proxy {
-
-ExtensionsCommonResource::ExtensionsCommonResource(Connection connection,
- PP_Instance instance)
- : PluginResource(connection, instance) {
- SendCreate(RENDERER, PpapiHostMsg_ExtensionsCommon_Create());
- SendCreate(BROWSER, PpapiHostMsg_ExtensionsCommon_Create());
-}
-
-ExtensionsCommonResource::~ExtensionsCommonResource() {
-}
-
-thunk::ExtensionsCommon_API*
-ExtensionsCommonResource::AsExtensionsCommon_API() {
- return this;
-}
-
-int32_t ExtensionsCommonResource::CallRenderer(
- const std::string& request_name,
- const std::vector<PP_Var>& input_args,
- const std::vector<PP_Var*>& output_args,
- scoped_refptr<TrackedCallback> callback) {
- return CommonCall(RENDERER, request_name, input_args, output_args, callback);
-}
-
-void ExtensionsCommonResource::PostRenderer(const std::string& request_name,
- const std::vector<PP_Var>& args) {
- CommonPost(RENDERER, request_name, args);
-}
-
-int32_t ExtensionsCommonResource::CallBrowser(
- const std::string& request_name,
- const std::vector<PP_Var>& input_args,
- const std::vector<PP_Var*>& output_args,
- scoped_refptr<TrackedCallback> callback) {
- return CommonCall(BROWSER, request_name, input_args, output_args, callback);
-}
-
-void ExtensionsCommonResource::PostBrowser(const std::string& request_name,
- const std::vector<PP_Var>& args) {
- CommonPost(BROWSER, request_name, args);
-}
-
-int32_t ExtensionsCommonResource::CommonCall(
- Destination dest,
- const std::string& request_name,
- const std::vector<PP_Var>& input_args,
- const std::vector<PP_Var*>& output_args,
- scoped_refptr<TrackedCallback> callback) {
- // TODO(yzshen): CreateValueFromVar() doesn't generate null fields for
- // dictionary values. That is the expected behavior for most APIs. If later we
- // want to support APIs that require to preserve null fields in dictionaries,
- // we should change the behavior to always preserve null fields at the plugin
- // side, and figure out whether they should be stripped at the renderer side.
- scoped_ptr<base::ListValue> input_args_value(
- CreateListValueFromVarVector(input_args));
- if (!input_args_value.get()) {
- LOG(WARNING) << "Failed to convert PP_Var input arguments.";
- return PP_ERROR_BADARGUMENT;
- }
-
- PluginResource::Call<PpapiPluginMsg_ExtensionsCommon_CallReply>(
- dest,
- PpapiHostMsg_ExtensionsCommon_Call(request_name, *input_args_value),
- base::Bind(&ExtensionsCommonResource::OnPluginMsgCallReply,
- base::Unretained(this), output_args, callback));
- return PP_OK_COMPLETIONPENDING;
-}
-
-void ExtensionsCommonResource::CommonPost(Destination dest,
- const std::string& request_name,
- const std::vector<PP_Var>& args) {
- scoped_ptr<base::ListValue> args_value(CreateListValueFromVarVector(args));
- if (!args_value.get()) {
- LOG(WARNING) << "Failed to convert PP_Var input arguments.";
- return;
- }
-
- PluginResource::Post(
- dest, PpapiHostMsg_ExtensionsCommon_Post(request_name, *args_value));
-}
-
-void ExtensionsCommonResource::OnPluginMsgCallReply(
- const std::vector<PP_Var*>& output_args,
- scoped_refptr<TrackedCallback> callback,
- const ResourceMessageReplyParams& params,
- const base::ListValue& output) {
- // |output_args| may be invalid and shouldn't be accessed if the callback has
- // been called.
- if (!TrackedCallback::IsPending(callback))
- return;
-
- int32_t result = params.result();
-
- // If the size doesn't match, something must be really wrong.
- CHECK_EQ(output_args.size(), output.GetSize());
-
- std::vector<PP_Var> output_vars;
- if (CreateVarVectorFromListValue(output, &output_vars)) {
- DCHECK_EQ(output_args.size(), output_vars.size());
- std::vector<PP_Var>::const_iterator src_iter = output_vars.begin();
- std::vector<PP_Var*>::const_iterator dest_iter = output_args.begin();
- for (; src_iter != output_vars.end() && dest_iter != output_args.end();
- ++src_iter, ++dest_iter) {
- **dest_iter = *src_iter;
- }
- } else {
- NOTREACHED();
- result = PP_ERROR_FAILED;
- for (std::vector<PP_Var*>::const_iterator dest_iter = output_args.begin();
- dest_iter != output_args.end();
- ++dest_iter) {
- **dest_iter = PP_MakeUndefined();
- }
- }
-
- callback->Run(result);
-}
-
-} // namespace proxy
-} // namespace ppapi
diff --git a/ppapi/proxy/extensions_common_resource.h b/ppapi/proxy/extensions_common_resource.h
deleted file mode 100644
index b3ec366..0000000
--- a/ppapi/proxy/extensions_common_resource.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2013 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_PROXY_EXTENSIONS_COMMON_RESOURCE_H_
-#define PPAPI_PROXY_EXTENSIONS_COMMON_RESOURCE_H_
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "ppapi/proxy/connection.h"
-#include "ppapi/proxy/plugin_resource.h"
-#include "ppapi/thunk/extensions_common_api.h"
-
-namespace base {
-class ListValue;
-}
-
-namespace ppapi {
-namespace proxy {
-
-class ResourceMessageReplyParams;
-
-class ExtensionsCommonResource : public PluginResource,
- public thunk::ExtensionsCommon_API {
- public:
- ExtensionsCommonResource(Connection connection, PP_Instance instance);
- virtual ~ExtensionsCommonResource();
-
- // Resource overrides.
- virtual thunk::ExtensionsCommon_API* AsExtensionsCommon_API() OVERRIDE;
-
- // ExtensionsCommon_API implementation.
- virtual int32_t CallRenderer(
- const std::string& request_name,
- const std::vector<PP_Var>& input_args,
- const std::vector<PP_Var*>& output_args,
- scoped_refptr<TrackedCallback> callback) OVERRIDE;
- virtual void PostRenderer(const std::string& request_name,
- const std::vector<PP_Var>& args) OVERRIDE;
- virtual int32_t CallBrowser(const std::string& request_name,
- const std::vector<PP_Var>& input_args,
- const std::vector<PP_Var*>& output_args,
- scoped_refptr<TrackedCallback> callback) OVERRIDE;
- virtual void PostBrowser(const std::string& request_name,
- const std::vector<PP_Var>& args) OVERRIDE;
-
- private:
- int32_t CommonCall(Destination dest,
- const std::string& request_name,
- const std::vector<PP_Var>& input_args,
- const std::vector<PP_Var*>& output_args,
- scoped_refptr<TrackedCallback> callback);
- void CommonPost(Destination dest,
- const std::string& request_name,
- const std::vector<PP_Var>& args);
-
- void OnPluginMsgCallReply(const std::vector<PP_Var*>& output_args,
- scoped_refptr<TrackedCallback> callback,
- const ResourceMessageReplyParams& params,
- const base::ListValue& output);
-
- DISALLOW_COPY_AND_ASSIGN(ExtensionsCommonResource);
-};
-
-} // namespace proxy
-} // namespace ppapi
-
-#endif // PPAPI_PROXY_EXTENSIONS_COMMON_RESOURCE_H_
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index 61e1f17..7e5125d 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -7,7 +7,6 @@
#include "base/hash.h"
#include "base/lazy_instance.h"
#include "base/memory/singleton.h"
-#include "ppapi/c/dev/ppb_alarms_dev.h"
#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"
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index a1ef6d6..255cc9c 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -13,7 +13,6 @@
#include "base/process/process.h"
#include "base/strings/string16.h"
#include "base/sync_socket.h"
-#include "base/values.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/ipc/gpu_command_buffer_traits.h"
@@ -1307,25 +1306,6 @@ IPC_MESSAGE_CONTROL0(PpapiHostMsg_Broker_Create)
// ResourceMessageReplyParams in the reply message.
IPC_MESSAGE_CONTROL0(PpapiHostMsg_Broker_IsAllowed)
-// Extensions common -----------------------------------------------------------
-IPC_MESSAGE_CONTROL0(PpapiHostMsg_ExtensionsCommon_Create)
-
-// Starts an extension API request which doesn't expect a response.
-// |request_name| is an API function name. |args| is a list of input arguments.
-IPC_MESSAGE_CONTROL2(PpapiHostMsg_ExtensionsCommon_Post,
- std::string /* request_name */,
- base::ListValue /* args */)
-
-// Starts an extension API request which expects a response sent back using a
-// PpapiPluginMsg_ExtensionsCommon_CallReply message.
-// |request_name| is an API function name. |args| is a list of input arguments.
-// |output| is a list of output results.
-IPC_MESSAGE_CONTROL2(PpapiHostMsg_ExtensionsCommon_Call,
- std::string /* request_name */,
- base::ListValue /* args */)
-IPC_MESSAGE_CONTROL1(PpapiPluginMsg_ExtensionsCommon_CallReply,
- base::ListValue /* output */)
-
// UMA
IPC_MESSAGE_CONTROL0(PpapiHostMsg_UMA_Create)
IPC_MESSAGE_CONTROL5(PpapiHostMsg_UMA_HistogramCustomTimes,
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index 48f4378..2b1a988 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -18,7 +18,6 @@
#include "ppapi/proxy/browser_font_singleton_resource.h"
#include "ppapi/proxy/content_decryptor_private_serializer.h"
#include "ppapi/proxy/enter_proxy.h"
-#include "ppapi/proxy/extensions_common_resource.h"
#include "ppapi/proxy/file_mapping_resource.h"
#include "ppapi/proxy/flash_clipboard_resource.h"
#include "ppapi/proxy/flash_file_resource.h"
@@ -395,9 +394,6 @@ Resource* PPB_Instance_Proxy::GetSingletonResource(PP_Instance instance,
case BROKER_SINGLETON_ID:
new_singleton = new BrokerResource(connection, instance);
break;
- case EXTENSIONS_COMMON_SINGLETON_ID:
- new_singleton = new ExtensionsCommonResource(connection, instance);
- break;
case FILE_MAPPING_SINGLETON_ID:
new_singleton = new FileMappingResource(connection, instance);
break;
diff --git a/ppapi/shared_impl/resource.h b/ppapi/shared_impl/resource.h
index 632520a..fdcf4fc 100644
--- a/ppapi/shared_impl/resource.h
+++ b/ppapi/shared_impl/resource.h
@@ -19,7 +19,6 @@
// All resource types should be added here. This implements our hand-rolled
// RTTI system since we don't compile with "real" RTTI.
#define FOR_ALL_PPAPI_RESOURCE_APIS(F) \
- F(ExtensionsCommon_API) \
F(PPB_Audio_API) \
F(PPB_AudioBuffer_API) \
F(PPB_AudioConfig_API) \
diff --git a/ppapi/shared_impl/singleton_resource_id.h b/ppapi/shared_impl/singleton_resource_id.h
index 6441a2b..4d34fd6 100644
--- a/ppapi/shared_impl/singleton_resource_id.h
+++ b/ppapi/shared_impl/singleton_resource_id.h
@@ -15,7 +15,6 @@ enum SingletonResourceID {
// resource model.
BROKER_SINGLETON_ID,
BROWSER_FONT_SINGLETON_ID,
- EXTENSIONS_COMMON_SINGLETON_ID,
FILE_MAPPING_SINGLETON_ID,
FLASH_CLIPBOARD_SINGLETON_ID,
FLASH_FILE_SINGLETON_ID,
diff --git a/ppapi/shared_impl/var_value_conversions.cc b/ppapi/shared_impl/var_value_conversions.cc
deleted file mode 100644
index d5aad57..0000000
--- a/ppapi/shared_impl/var_value_conversions.cc
+++ /dev/null
@@ -1,381 +0,0 @@
-// Copyright (c) 2013 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/var_value_conversions.h"
-
-#include <limits>
-#include <set>
-#include <stack>
-
-#include "base/logging.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/stl_util.h"
-#include "base/values.h"
-#include "ppapi/c/pp_bool.h"
-#include "ppapi/c/pp_stdint.h"
-#include "ppapi/shared_impl/array_var.h"
-#include "ppapi/shared_impl/dictionary_var.h"
-#include "ppapi/shared_impl/ppapi_globals.h"
-#include "ppapi/shared_impl/scoped_pp_var.h"
-#include "ppapi/shared_impl/var.h"
-#include "ppapi/shared_impl/var_tracker.h"
-
-namespace ppapi {
-
-namespace {
-
-// In CreateValueFromVar(), a stack is used to keep track of conversion progress
-// of array and dictionary vars. VarNode represents elements of that stack.
-struct VarNode {
- VarNode(const PP_Var& in_var, base::Value* in_value)
- : var(in_var), value(in_value), sentinel(false) {}
-
- // This object doesn't hold a reference to it.
- PP_Var var;
- // It is not owned by this object.
- base::Value* value;
- // When this is set to true for a node in the stack, it means that we have
- // finished processing the node itself. However, we keep it in the stack as
- // a sentinel. When it becomes the top element of the stack again, we know
- // that we have processed all the descendants of this node.
- bool sentinel;
-};
-
-// In CreateVarFromValue(), a stack is used to keep track of conversion progress
-// of list and dictionary values. ValueNode represents elements of that stack.
-struct ValueNode {
- ValueNode(const PP_Var& in_var, const base::Value* in_value)
- : var(in_var), value(in_value) {}
-
- // This object doesn't hold a reference to it.
- PP_Var var;
- // It is not owned by this object.
- const base::Value* value;
-};
-
-// Helper function for CreateValueFromVar(). It only looks at |var| but not its
-// descendants. The conversion result is stored in |value|. If |var| is array or
-// dictionary, a new node is pushed onto |state|.
-//
-// Returns false on failure.
-bool CreateValueFromVarHelper(const std::set<int64_t>& parent_ids,
- const PP_Var& var,
- scoped_ptr<base::Value>* value,
- std::stack<VarNode>* state) {
- switch (var.type) {
- case PP_VARTYPE_UNDEFINED:
- case PP_VARTYPE_NULL: {
- value->reset(base::Value::CreateNullValue());
- return true;
- }
- case PP_VARTYPE_BOOL: {
- value->reset(new base::FundamentalValue(PP_ToBool(var.value.as_bool)));
- return true;
- }
- case PP_VARTYPE_INT32: {
- value->reset(new base::FundamentalValue(var.value.as_int));
- return true;
- }
- case PP_VARTYPE_DOUBLE: {
- value->reset(new base::FundamentalValue(var.value.as_double));
- return true;
- }
- case PP_VARTYPE_STRING: {
- StringVar* string_var = StringVar::FromPPVar(var);
- if (!string_var)
- return false;
-
- value->reset(new base::StringValue(string_var->value()));
- return true;
- }
- case PP_VARTYPE_OBJECT: { return false; }
- case PP_VARTYPE_ARRAY: {
- if (ContainsKey(parent_ids, var.value.as_id)) {
- // A circular reference is found.
- return false;
- }
-
- value->reset(new base::ListValue());
- state->push(VarNode(var, value->get()));
- return true;
- }
- case PP_VARTYPE_DICTIONARY: {
- if (ContainsKey(parent_ids, var.value.as_id)) {
- // A circular reference is found.
- return false;
- }
-
- value->reset(new base::DictionaryValue());
- state->push(VarNode(var, value->get()));
- return true;
- }
- case PP_VARTYPE_ARRAY_BUFFER: {
- ArrayBufferVar* array_buffer = ArrayBufferVar::FromPPVar(var);
- if (!array_buffer)
- return false;
-
- base::BinaryValue* binary_value =
- base::BinaryValue::CreateWithCopiedBuffer(
- static_cast<const char*>(array_buffer->Map()),
- array_buffer->ByteLength());
- array_buffer->Unmap();
- value->reset(binary_value);
- return true;
- }
- case PP_VARTYPE_RESOURCE: { return false; }
- }
- NOTREACHED();
- return false;
-}
-
-// Helper function for CreateVarFromValue(). It only looks at |value| but not
-// its descendants. The conversion result is stored in |var|. If |value| is list
-// or dictionary, a new node is pushed onto |state|.
-//
-// Returns false on failure.
-bool CreateVarFromValueHelper(const base::Value& value,
- ScopedPPVar* var,
- std::stack<ValueNode>* state) {
- switch (value.GetType()) {
- case base::Value::TYPE_NULL: {
- *var = PP_MakeNull();
- return true;
- }
- case base::Value::TYPE_BOOLEAN: {
- bool result = false;
- if (value.GetAsBoolean(&result)) {
- *var = PP_MakeBool(PP_FromBool(result));
- return true;
- }
- return false;
- }
- case base::Value::TYPE_INTEGER: {
- int result = 0;
- if (value.GetAsInteger(&result)) {
- *var = PP_MakeInt32(result);
- return true;
- }
- return false;
- }
- case base::Value::TYPE_DOUBLE: {
- double result = 0;
- if (value.GetAsDouble(&result)) {
- *var = PP_MakeDouble(result);
- return true;
- }
- return false;
- }
- case base::Value::TYPE_STRING: {
- std::string result;
- if (value.GetAsString(&result)) {
- *var = ScopedPPVar(ScopedPPVar::PassRef(),
- StringVar::StringToPPVar(result));
- return true;
- }
- return false;
- }
- case base::Value::TYPE_BINARY: {
- const base::BinaryValue& binary_value =
- static_cast<const base::BinaryValue&>(value);
-
- size_t size = binary_value.GetSize();
- if (size > std::numeric_limits<uint32>::max())
- return false;
-
- ScopedPPVar temp(
- ScopedPPVar::PassRef(),
- PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(
- static_cast<uint32>(size), binary_value.GetBuffer()));
- if (temp.get().type == PP_VARTYPE_ARRAY_BUFFER) {
- *var = temp;
- return true;
- }
- return false;
- }
- case base::Value::TYPE_DICTIONARY: {
- scoped_refptr<DictionaryVar> dict_var(new DictionaryVar());
- *var = ScopedPPVar(ScopedPPVar::PassRef(), dict_var->GetPPVar());
- state->push(ValueNode(var->get(), &value));
- return true;
- }
- case base::Value::TYPE_LIST: {
- scoped_refptr<ArrayVar> array_var(new ArrayVar());
- *var = ScopedPPVar(ScopedPPVar::PassRef(), array_var->GetPPVar());
- state->push(ValueNode(var->get(), &value));
- return true;
- }
- }
- NOTREACHED();
- return false;
-}
-
-} // namespace
-
-base::Value* CreateValueFromVar(const PP_Var& var) {
- // Used to detect circular references.
- std::set<int64_t> parent_ids;
- std::stack<VarNode> state;
- scoped_ptr<base::Value> root_value;
-
- if (!CreateValueFromVarHelper(parent_ids, var, &root_value, &state))
- return NULL;
-
- while (!state.empty()) {
- VarNode& top = state.top();
- if (top.sentinel) {
- parent_ids.erase(top.var.value.as_id);
- state.pop();
- } else if (top.var.type == PP_VARTYPE_DICTIONARY) {
- parent_ids.insert(top.var.value.as_id);
- top.sentinel = true;
-
- DictionaryVar* dict_var = DictionaryVar::FromPPVar(top.var);
- if (!dict_var)
- return NULL;
-
- DCHECK(top.value->GetType() == base::Value::TYPE_DICTIONARY);
- base::DictionaryValue* dict_value =
- static_cast<base::DictionaryValue*>(top.value);
-
- for (DictionaryVar::KeyValueMap::const_iterator iter =
- dict_var->key_value_map().begin();
- iter != dict_var->key_value_map().end();
- ++iter) {
- // Skip the key-value pair if the value is undefined or null.
- if (iter->second.get().type == PP_VARTYPE_UNDEFINED ||
- iter->second.get().type == PP_VARTYPE_NULL) {
- continue;
- }
-
- scoped_ptr<base::Value> child_value;
- if (!CreateValueFromVarHelper(
- parent_ids, iter->second.get(), &child_value, &state)) {
- return NULL;
- }
-
- dict_value->SetWithoutPathExpansion(iter->first, child_value.release());
- }
- } else if (top.var.type == PP_VARTYPE_ARRAY) {
- parent_ids.insert(top.var.value.as_id);
- top.sentinel = true;
-
- ArrayVar* array_var = ArrayVar::FromPPVar(top.var);
- if (!array_var)
- return NULL;
-
- DCHECK(top.value->GetType() == base::Value::TYPE_LIST);
- base::ListValue* list_value = static_cast<base::ListValue*>(top.value);
-
- for (ArrayVar::ElementVector::const_iterator iter =
- array_var->elements().begin();
- iter != array_var->elements().end();
- ++iter) {
- scoped_ptr<base::Value> child_value;
- if (!CreateValueFromVarHelper(
- parent_ids, iter->get(), &child_value, &state)) {
- return NULL;
- }
-
- list_value->Append(child_value.release());
- }
- } else {
- NOTREACHED();
- return NULL;
- }
- }
- DCHECK(parent_ids.empty());
- return root_value.release();
-}
-
-PP_Var CreateVarFromValue(const base::Value& value) {
- std::stack<ValueNode> state;
- ScopedPPVar root_var;
-
- if (!CreateVarFromValueHelper(value, &root_var, &state))
- return PP_MakeUndefined();
-
- while (!state.empty()) {
- ValueNode top = state.top();
- state.pop();
-
- if (top.value->GetType() == base::Value::TYPE_DICTIONARY) {
- const base::DictionaryValue* dict_value =
- static_cast<const base::DictionaryValue*>(top.value);
- DictionaryVar* dict_var = DictionaryVar::FromPPVar(top.var);
- DCHECK(dict_var);
- for (base::DictionaryValue::Iterator iter(*dict_value); !iter.IsAtEnd();
- iter.Advance()) {
- ScopedPPVar child_var;
- if (!CreateVarFromValueHelper(iter.value(), &child_var, &state) ||
- !dict_var->SetWithStringKey(iter.key(), child_var.get())) {
- return PP_MakeUndefined();
- }
- }
- } else if (top.value->GetType() == base::Value::TYPE_LIST) {
- const base::ListValue* list_value =
- static_cast<const base::ListValue*>(top.value);
- ArrayVar* array_var = ArrayVar::FromPPVar(top.var);
- DCHECK(array_var);
- for (base::ListValue::const_iterator iter = list_value->begin();
- iter != list_value->end();
- ++iter) {
- ScopedPPVar child_var;
- if (!CreateVarFromValueHelper(**iter, &child_var, &state))
- return PP_MakeUndefined();
-
- array_var->elements().push_back(child_var);
- }
- } else {
- NOTREACHED();
- return PP_MakeUndefined();
- }
- }
-
- return root_var.Release();
-}
-
-base::ListValue* CreateListValueFromVarVector(const std::vector<PP_Var>& vars) {
- scoped_ptr<base::ListValue> list_value(new base::ListValue());
-
- for (std::vector<PP_Var>::const_iterator iter = vars.begin();
- iter != vars.end();
- ++iter) {
- base::Value* value = CreateValueFromVar(*iter);
- if (!value)
- return NULL;
- list_value->Append(value);
- }
- return list_value.release();
-}
-
-bool CreateVarVectorFromListValue(const base::ListValue& list_value,
- std::vector<PP_Var>* vars) {
- if (!vars)
- return false;
-
- std::vector<ScopedPPVar> result;
- result.reserve(list_value.GetSize());
- for (base::ListValue::const_iterator iter = list_value.begin();
- iter != list_value.end();
- ++iter) {
- ScopedPPVar child_var(ScopedPPVar::PassRef(), CreateVarFromValue(**iter));
- if (child_var.get().type == PP_VARTYPE_UNDEFINED)
- return false;
-
- result.push_back(child_var);
- }
-
- vars->clear();
- vars->reserve(result.size());
- for (std::vector<ScopedPPVar>::iterator iter = result.begin();
- iter != result.end();
- ++iter) {
- vars->push_back(iter->Release());
- }
-
- return true;
-}
-
-} // namespace ppapi
diff --git a/ppapi/shared_impl/var_value_conversions.h b/ppapi/shared_impl/var_value_conversions.h
deleted file mode 100644
index dfbda50..0000000
--- a/ppapi/shared_impl/var_value_conversions.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2013 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_VAR_VALUE_CONVERSIONS_H_
-#define PPAPI_SHARED_IMPL_VAR_VALUE_CONVERSIONS_H_
-
-#include <vector>
-
-#include "ppapi/c/pp_var.h"
-#include "ppapi/shared_impl/ppapi_shared_export.h"
-
-namespace base {
-class ListValue;
-class Value;
-}
-
-namespace ppapi {
-
-// Converts a PP_Var to a base::Value object. The caller takes ownership of the
-// returned object.
-//
-// Both PP_VARTYPE_UNDEFINED and PP_VARTYPE_NULL are converted to
-// base::Value::TYPE_NULL. In dictionary vars, key-value pairs whose value is
-// undefined (PP_VARTYPE_UNDEFINED) or null (PP_VARTYPE_NULL) are ignored. If a
-// node in |var| appears more than once, it is duplicated in the result. For
-// example, if |var| is an array and it has two elements pointing to the same
-// dictionary, the resulting list value will have two copies of the dictionary.
-//
-// The conversion fails and returns NULL if
-// - |var| is object (PP_VARTYPE_OBJECT); or
-// - |var| is an array or dictionary, and calling CreateValueFromVar() on any of
-// the array elements or dictionary values fails; or
-// - there exist circular references, i.e., an array or dictionary is its own
-// ancestor/descendant.
-PPAPI_SHARED_EXPORT base::Value* CreateValueFromVar(const PP_Var& var);
-
-// The returned var has had 1 ref added on behalf of the caller.
-// Returns an undefined var if the conversion fails.
-PPAPI_SHARED_EXPORT PP_Var CreateVarFromValue(const base::Value& value);
-
-// Calls CreateValueFromVar() on each element of |vars| and puts them in a
-// base::ListValue. The caller takes ownership of the returned object.
-//
-// The conversion fails and returns NULL if any of the calls to
-// CreateValueFromVar() fails.
-PPAPI_SHARED_EXPORT base::ListValue* CreateListValueFromVarVector(
- const std::vector<PP_Var>& vars);
-
-// Calls CreateVarFromValue() on each element of |list_value| and puts them in
-// |vars|. The returned vars have had 1 ref added on behalf of the caller.
-//
-// The conversion fails and returns false if any of the calls to
-// CreateVarFromValue() fails. In that case, |vars| is untouched.
-PPAPI_SHARED_EXPORT bool CreateVarVectorFromListValue(
- const base::ListValue& list_value,
- std::vector<PP_Var>* vars);
-
-} // namespace ppapi
-
-#endif // PPAPI_SHARED_IMPL_VAR_VALUE_CONVERSIONS_H_
diff --git a/ppapi/shared_impl/var_value_conversions_unittest.cc b/ppapi/shared_impl/var_value_conversions_unittest.cc
deleted file mode 100644
index 8a6fc19..0000000
--- a/ppapi/shared_impl/var_value_conversions_unittest.cc
+++ /dev/null
@@ -1,391 +0,0 @@
-// Copyright (c) 2013 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/var_value_conversions.h"
-
-#include <cmath>
-#include <cstring>
-
-#include "base/logging.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/values.h"
-#include "ppapi/c/pp_bool.h"
-#include "ppapi/c/pp_var.h"
-#include "ppapi/shared_impl/array_var.h"
-#include "ppapi/shared_impl/dictionary_var.h"
-#include "ppapi/shared_impl/ppapi_globals.h"
-#include "ppapi/shared_impl/proxy_lock.h"
-#include "ppapi/shared_impl/scoped_pp_var.h"
-#include "ppapi/shared_impl/test_globals.h"
-#include "ppapi/shared_impl/var.h"
-#include "ppapi/shared_impl/var_tracker.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace ppapi {
-namespace {
-
-bool Equals(const base::Value& value, const PP_Var& var) {
- switch (value.GetType()) {
- case base::Value::TYPE_NULL: {
- return var.type == PP_VARTYPE_NULL || var.type == PP_VARTYPE_UNDEFINED;
- }
- case base::Value::TYPE_BOOLEAN: {
- bool result = false;
- return var.type == PP_VARTYPE_BOOL && value.GetAsBoolean(&result) &&
- result == PP_ToBool(var.value.as_bool);
- }
- case base::Value::TYPE_INTEGER: {
- int result = 0;
- return var.type == PP_VARTYPE_INT32 && value.GetAsInteger(&result) &&
- result == var.value.as_int;
- }
- case base::Value::TYPE_DOUBLE: {
- double result = 0;
- return var.type == PP_VARTYPE_DOUBLE && value.GetAsDouble(&result) &&
- fabs(result - var.value.as_double) < 1.0e-4;
- }
- case base::Value::TYPE_STRING: {
- std::string result;
- StringVar* string_var = StringVar::FromPPVar(var);
- return string_var && value.GetAsString(&result) &&
- result == string_var->value();
- }
- case base::Value::TYPE_BINARY: {
- const base::BinaryValue& binary_value =
- static_cast<const base::BinaryValue&>(value);
- ArrayBufferVar* array_buffer_var = ArrayBufferVar::FromPPVar(var);
- if (!array_buffer_var ||
- binary_value.GetSize() != array_buffer_var->ByteLength()) {
- return false;
- }
-
- bool result = !memcmp(binary_value.GetBuffer(),
- array_buffer_var->Map(),
- binary_value.GetSize());
- array_buffer_var->Unmap();
- return result;
- }
- case base::Value::TYPE_DICTIONARY: {
- const base::DictionaryValue& dict_value =
- static_cast<const base::DictionaryValue&>(value);
- DictionaryVar* dict_var = DictionaryVar::FromPPVar(var);
- if (!dict_var)
- return false;
-
- size_t count = 0;
- for (DictionaryVar::KeyValueMap::const_iterator iter =
- dict_var->key_value_map().begin();
- iter != dict_var->key_value_map().end();
- ++iter) {
- if (iter->second.get().type == PP_VARTYPE_UNDEFINED ||
- iter->second.get().type == PP_VARTYPE_NULL) {
- continue;
- }
-
- ++count;
- const base::Value* sub_value = NULL;
- if (!dict_value.GetWithoutPathExpansion(iter->first, &sub_value) ||
- !Equals(*sub_value, iter->second.get())) {
- return false;
- }
- }
- return count == dict_value.size();
- }
- case base::Value::TYPE_LIST: {
- const base::ListValue& list_value =
- static_cast<const base::ListValue&>(value);
- ArrayVar* array_var = ArrayVar::FromPPVar(var);
- if (!array_var || list_value.GetSize() != array_var->elements().size())
- return false;
-
- base::ListValue::const_iterator value_iter = list_value.begin();
- ArrayVar::ElementVector::const_iterator var_iter =
- array_var->elements().begin();
- for (; value_iter != list_value.end() &&
- var_iter != array_var->elements().end();
- ++value_iter, ++var_iter) {
- if (!Equals(**value_iter, var_iter->get()))
- return false;
- }
- return true;
- }
- }
- NOTREACHED();
- return false;
-}
-
-bool ConvertVarAndVerify(const PP_Var& var) {
- scoped_ptr<base::Value> value(CreateValueFromVar(var));
- if (value.get())
- return Equals(*value, var);
- return false;
-}
-
-bool ConvertValueAndVerify(const base::Value& value) {
- ScopedPPVar var(ScopedPPVar::PassRef(), CreateVarFromValue(value));
- if (var.get().type != PP_VARTYPE_UNDEFINED)
- return Equals(value, var.get());
- return false;
-}
-
-class VarValueConversionsTest : public testing::Test {
- public:
- VarValueConversionsTest() {}
- virtual ~VarValueConversionsTest() {}
-
- // testing::Test implementation.
- virtual void SetUp() {
- ProxyLock::EnableLockingOnThreadForTest();
- ProxyLock::Acquire();
- }
- virtual void TearDown() {
- ASSERT_TRUE(PpapiGlobals::Get()->GetVarTracker()->GetLiveVars().empty());
- ProxyLock::Release();
- }
-
- private:
- TestGlobals globals_;
-};
-
-} // namespace
-
-TEST_F(VarValueConversionsTest, CreateValueFromVar) {
- {
- // Var holding a ref to itself is not a valid input.
- scoped_refptr<DictionaryVar> dict_var(new DictionaryVar());
- ScopedPPVar var_1(ScopedPPVar::PassRef(), dict_var->GetPPVar());
- scoped_refptr<ArrayVar> array_var(new ArrayVar());
- ScopedPPVar var_2(ScopedPPVar::PassRef(), array_var->GetPPVar());
-
- ASSERT_TRUE(dict_var->SetWithStringKey("key_1", var_2.get()));
- ASSERT_TRUE(ConvertVarAndVerify(var_1.get()));
-
- ASSERT_TRUE(array_var->Set(0, var_1.get()));
- scoped_ptr<base::Value> value(CreateValueFromVar(var_1.get()));
- ASSERT_EQ(NULL, value.get());
-
- // Make sure |var_1| doesn't indirectly hold a ref to itself, otherwise it
- // is leaked.
- dict_var->DeleteWithStringKey("key_1");
- }
-
- // Vars of null or undefined type are converted to null values.
- {
- ASSERT_TRUE(ConvertVarAndVerify(PP_MakeNull()));
- ASSERT_TRUE(ConvertVarAndVerify(PP_MakeUndefined()));
- }
-
- {
- // Test empty dictionary.
- scoped_refptr<DictionaryVar> dict_var(new DictionaryVar());
- ScopedPPVar var(ScopedPPVar::PassRef(), dict_var->GetPPVar());
-
- ASSERT_TRUE(ConvertVarAndVerify(var.get()));
- }
-
- {
- // Key-value pairs whose value is undefined or null are ignored.
- scoped_refptr<DictionaryVar> dict_var(new DictionaryVar());
- ASSERT_TRUE(dict_var->SetWithStringKey("key_1", PP_MakeUndefined()));
- ASSERT_TRUE(dict_var->SetWithStringKey("key_2", PP_MakeInt32(1)));
- ASSERT_TRUE(dict_var->SetWithStringKey("key_3", PP_MakeNull()));
- ScopedPPVar var(ScopedPPVar::PassRef(), dict_var->GetPPVar());
-
- ASSERT_TRUE(ConvertVarAndVerify(var.get()));
- }
-
- {
- // The same PP_Var is allowed to appear multiple times.
- scoped_refptr<DictionaryVar> dict_var_1(new DictionaryVar());
- ScopedPPVar dict_pp_var_1(ScopedPPVar::PassRef(), dict_var_1->GetPPVar());
- scoped_refptr<DictionaryVar> dict_var_2(new DictionaryVar());
- ScopedPPVar dict_pp_var_2(ScopedPPVar::PassRef(), dict_var_2->GetPPVar());
- scoped_refptr<StringVar> string_var(new StringVar("string_value"));
- ScopedPPVar string_pp_var(ScopedPPVar::PassRef(), string_var->GetPPVar());
-
- ASSERT_TRUE(dict_var_1->SetWithStringKey("key_1", dict_pp_var_2.get()));
- ASSERT_TRUE(dict_var_1->SetWithStringKey("key_2", dict_pp_var_2.get()));
- ASSERT_TRUE(dict_var_1->SetWithStringKey("key_3", string_pp_var.get()));
- ASSERT_TRUE(dict_var_2->SetWithStringKey("key_4", string_pp_var.get()));
-
- ASSERT_TRUE(ConvertVarAndVerify(dict_pp_var_1.get()));
- }
-
- {
- // Test basic cases for array.
- scoped_refptr<ArrayVar> array_var(new ArrayVar());
- ScopedPPVar var(ScopedPPVar::PassRef(), array_var->GetPPVar());
-
- ASSERT_TRUE(ConvertVarAndVerify(var.get()));
-
- ASSERT_TRUE(array_var->Set(0, PP_MakeDouble(1)));
-
- ASSERT_TRUE(ConvertVarAndVerify(var.get()));
- }
-
- {
- // Test more complex inputs.
- scoped_refptr<DictionaryVar> dict_var_1(new DictionaryVar());
- ScopedPPVar dict_pp_var_1(ScopedPPVar::PassRef(), dict_var_1->GetPPVar());
- scoped_refptr<DictionaryVar> dict_var_2(new DictionaryVar());
- ScopedPPVar dict_pp_var_2(ScopedPPVar::PassRef(), dict_var_2->GetPPVar());
- scoped_refptr<ArrayVar> array_var(new ArrayVar());
- ScopedPPVar array_pp_var(ScopedPPVar::PassRef(), array_var->GetPPVar());
- scoped_refptr<StringVar> string_var(new StringVar("string_value"));
- ScopedPPVar string_pp_var(ScopedPPVar::PassRef(), string_var->GetPPVar());
-
- ASSERT_TRUE(dict_var_1->SetWithStringKey("null_key", PP_MakeNull()));
- ASSERT_TRUE(
- dict_var_1->SetWithStringKey("string_key", string_pp_var.get()));
- ASSERT_TRUE(dict_var_1->SetWithStringKey("dict_key", dict_pp_var_2.get()));
-
- ASSERT_TRUE(
- dict_var_2->SetWithStringKey("undefined_key", PP_MakeUndefined()));
- ASSERT_TRUE(dict_var_2->SetWithStringKey("double_key", PP_MakeDouble(1)));
- ASSERT_TRUE(dict_var_2->SetWithStringKey("array_key", array_pp_var.get()));
-
- ASSERT_TRUE(array_var->Set(0, PP_MakeInt32(2)));
- ASSERT_TRUE(array_var->Set(1, PP_MakeBool(PP_TRUE)));
- ASSERT_TRUE(array_var->SetLength(4));
-
- ASSERT_TRUE(ConvertVarAndVerify(dict_pp_var_1.get()));
- }
-
- {
- // Test that dictionary keys containing '.' are handled correctly.
- scoped_refptr<DictionaryVar> dict_var(new DictionaryVar());
- ScopedPPVar dict_pp_var(ScopedPPVar::PassRef(), dict_var->GetPPVar());
-
- ASSERT_TRUE(dict_var->SetWithStringKey("double.key", PP_MakeDouble(1)));
- ASSERT_TRUE(dict_var->SetWithStringKey("int.key..name", PP_MakeInt32(2)));
-
- ASSERT_TRUE(ConvertVarAndVerify(dict_pp_var.get()));
- }
-}
-
-TEST_F(VarValueConversionsTest, CreateVarFromValue) {
- {
- // Test basic cases for dictionary.
- base::DictionaryValue dict_value;
- ASSERT_TRUE(ConvertValueAndVerify(dict_value));
-
- dict_value.SetInteger("int_key", 1);
- ASSERT_TRUE(ConvertValueAndVerify(dict_value));
- }
-
- {
- // Test basic cases for array.
- base::ListValue list_value;
- ASSERT_TRUE(ConvertValueAndVerify(list_value));
-
- list_value.AppendInteger(1);
- ASSERT_TRUE(ConvertValueAndVerify(list_value));
- }
-
- {
- // Test more complex inputs.
- base::DictionaryValue dict_value;
- dict_value.SetString("string_key", "string_value");
- dict_value.SetDouble("dict_key.double_key", 1);
-
- scoped_ptr<base::ListValue> list_value(new base::ListValue());
- list_value->AppendInteger(2);
- list_value->AppendBoolean(true);
- list_value->Append(base::Value::CreateNullValue());
-
- dict_value.Set("dict_key.array_key", list_value.release());
-
- ASSERT_TRUE(ConvertValueAndVerify(dict_value));
- }
-}
-
-TEST_F(VarValueConversionsTest, CreateListValueFromVarVector) {
- {
- // Test empty var vector.
- scoped_ptr<base::ListValue> list_value(
- CreateListValueFromVarVector(std::vector<PP_Var>()));
- ASSERT_TRUE(list_value.get());
- ASSERT_EQ(0u, list_value->GetSize());
- }
-
- {
- // Test more complex inputs.
- scoped_refptr<StringVar> string_var(new StringVar("string_value"));
- ScopedPPVar string_pp_var(ScopedPPVar::PassRef(), string_var->GetPPVar());
-
- scoped_refptr<DictionaryVar> dict_var(new DictionaryVar());
- ScopedPPVar dict_pp_var(ScopedPPVar::PassRef(), dict_var->GetPPVar());
- ASSERT_TRUE(dict_var->SetWithStringKey("null_key", PP_MakeNull()));
- ASSERT_TRUE(dict_var->SetWithStringKey("string_key", string_pp_var.get()));
-
- scoped_refptr<ArrayVar> array_var(new ArrayVar());
- ScopedPPVar array_pp_var(ScopedPPVar::PassRef(), array_var->GetPPVar());
- ASSERT_TRUE(array_var->Set(0, PP_MakeInt32(2)));
- ASSERT_TRUE(array_var->Set(1, PP_MakeBool(PP_TRUE)));
- ASSERT_TRUE(array_var->SetLength(4));
-
- std::vector<PP_Var> vars;
- vars.push_back(dict_pp_var.get());
- vars.push_back(string_pp_var.get());
- vars.push_back(array_pp_var.get());
- vars.push_back(PP_MakeDouble(1));
- vars.push_back(PP_MakeUndefined());
- vars.push_back(PP_MakeNull());
-
- scoped_ptr<base::ListValue> list_value(CreateListValueFromVarVector(vars));
-
- ASSERT_TRUE(list_value.get());
- ASSERT_EQ(vars.size(), list_value->GetSize());
-
- for (size_t i = 0; i < list_value->GetSize(); ++i) {
- const base::Value* value = NULL;
- ASSERT_TRUE(list_value->Get(i, &value));
- ASSERT_TRUE(Equals(*value, vars[i]));
- }
- }
-}
-
-TEST_F(VarValueConversionsTest, CreateVarVectorFromListValue) {
- {
- // Test empty list.
- base::ListValue list_value;
- std::vector<PP_Var> vars;
- ASSERT_TRUE(CreateVarVectorFromListValue(list_value, &vars));
- ASSERT_EQ(0u, vars.size());
- }
-
- {
- // Test more complex inputs.
- base::ListValue list_value;
-
- scoped_ptr<base::DictionaryValue> dict_value(new base::DictionaryValue());
- dict_value->SetString("string_key", "string_value");
-
- scoped_ptr<base::ListValue> sub_list_value(new base::ListValue());
- sub_list_value->AppendInteger(2);
- sub_list_value->AppendBoolean(true);
-
- list_value.Append(dict_value.release());
- list_value.AppendString("string_value");
- list_value.Append(sub_list_value.release());
- list_value.AppendDouble(1);
- list_value.Append(base::Value::CreateNullValue());
-
- std::vector<PP_Var> vars;
- ASSERT_TRUE(CreateVarVectorFromListValue(list_value, &vars));
-
- ASSERT_EQ(list_value.GetSize(), vars.size());
-
- for (size_t i = 0; i < list_value.GetSize(); ++i) {
- const base::Value* value = NULL;
- ASSERT_TRUE(list_value.Get(i, &value));
- ASSERT_TRUE(Equals(*value, vars[i]));
-
- PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(vars[i]);
- }
- }
-}
-
-} // namespace ppapi
diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h
index 6d7cdf9..1e49d64 100644
--- a/ppapi/tests/all_c_includes.h
+++ b/ppapi/tests/all_c_includes.h
@@ -10,9 +10,7 @@
#include "ppapi/c/dev/deprecated_bool.h"
#include "ppapi/c/dev/pp_cursor_type_dev.h"
-#include "ppapi/c/dev/pp_optional_structs_dev.h"
#include "ppapi/c/dev/pp_video_dev.h"
-#include "ppapi/c/dev/ppb_alarms_dev.h"
#include "ppapi/c/dev/ppb_buffer_dev.h"
#include "ppapi/c/dev/ppb_char_set_dev.h"
#include "ppapi/c/dev/ppb_crypto_dev.h"
diff --git a/ppapi/tests/all_cpp_includes.h b/ppapi/tests/all_cpp_includes.h
index fb72973..6477a76 100644
--- a/ppapi/tests/all_cpp_includes.h
+++ b/ppapi/tests/all_cpp_includes.h
@@ -15,24 +15,17 @@
#include "ppapi/cpp/compositor.h"
#include "ppapi/cpp/compositor_layer.h"
#include "ppapi/cpp/core.h"
-#include "ppapi/cpp/dev/alarms_dev.h"
-#include "ppapi/cpp/dev/array_dev.h"
#include "ppapi/cpp/dev/buffer_dev.h"
#include "ppapi/cpp/dev/device_ref_dev.h"
#include "ppapi/cpp/dev/file_chooser_dev.h"
#include "ppapi/cpp/dev/font_dev.h"
#include "ppapi/cpp/dev/ime_input_event_dev.h"
-#include "ppapi/cpp/dev/may_own_ptr_dev.h"
#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/scriptable_object_deprecated.h"
#include "ppapi/cpp/dev/scrollbar_dev.h"
#include "ppapi/cpp/dev/selection_dev.h"
-#include "ppapi/cpp/dev/string_wrapper_dev.h"
-#include "ppapi/cpp/dev/struct_wrapper_output_traits_dev.h"
#include "ppapi/cpp/dev/text_input_dev.h"
-#include "ppapi/cpp/dev/to_c_type_converter_dev.h"
#include "ppapi/cpp/dev/url_util_dev.h"
#include "ppapi/cpp/dev/video_decoder_dev.h"
#include "ppapi/cpp/dev/view_dev.h"
diff --git a/ppapi/thunk/extensions_common_api.h b/ppapi/thunk/extensions_common_api.h
deleted file mode 100644
index 5afb73f..0000000
--- a/ppapi/thunk/extensions_common_api.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2013 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_EXTENSIONS_COMMON_API_H_
-#define PPAPI_THUNK_EXTENSIONS_COMMON_API_H_
-
-#include <string>
-#include <vector>
-
-#include "base/memory/ref_counted.h"
-#include "ppapi/c/pp_var.h"
-#include "ppapi/shared_impl/singleton_resource_id.h"
-#include "ppapi/shared_impl/tracked_callback.h"
-#include "ppapi/thunk/ppapi_thunk_export.h"
-
-namespace ppapi {
-namespace thunk {
-
-class PPAPI_THUNK_EXPORT ExtensionsCommon_API {
- public:
- virtual ~ExtensionsCommon_API() {}
-
- virtual int32_t CallRenderer(const std::string& request_name,
- const std::vector<PP_Var>& input_args,
- const std::vector<PP_Var*>& output_args,
- scoped_refptr<TrackedCallback> callback) = 0;
- virtual void PostRenderer(const std::string& request_name,
- const std::vector<PP_Var>& args) = 0;
- virtual int32_t CallBrowser(const std::string& request_name,
- const std::vector<PP_Var>& input_args,
- const std::vector<PP_Var*>& output_args,
- scoped_refptr<TrackedCallback> callback) = 0;
- virtual void PostBrowser(const std::string& request_name,
- const std::vector<PP_Var>& args) = 0;
-
- static const SingletonResourceID kSingletonResourceID =
- EXTENSIONS_COMMON_SINGLETON_ID;
-};
-
-} // namespace thunk
-} // namespace ppapi
-
-#endif // PPAPI_THUNK_EXTENSIONS_COMMON_API_H_
diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h
index fee736c..2a1612c 100644
--- a/ppapi/thunk/interfaces_ppb_public_dev.h
+++ b/ppapi/thunk/interfaces_ppb_public_dev.h
@@ -10,7 +10,6 @@
// Map the old dev console interface to the stable one (which is the same) to
// keep Flash, etc. working.
PROXIED_IFACE("PPB_Console(Dev);0.1", PPB_Console_1_0)
-PROXIED_IFACE(PPB_ALARMS_DEV_INTERFACE_0_1, PPB_Alarms_Dev_0_1)
PROXIED_IFACE(PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4, PPB_CursorControl_Dev_0_4)
PROXIED_IFACE(PPB_FILECHOOSER_DEV_INTERFACE_0_5, PPB_FileChooser_Dev_0_5)
PROXIED_IFACE(PPB_FILECHOOSER_DEV_INTERFACE_0_6, PPB_FileChooser_Dev_0_6)
diff --git a/ppapi/thunk/ppb_alarms_dev_thunk.cc b/ppapi/thunk/ppb_alarms_dev_thunk.cc
deleted file mode 100644
index 2d2ae14..0000000
--- a/ppapi/thunk/ppb_alarms_dev_thunk.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2013 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 "base/logging.h"
-#include "ppapi/c/dev/ppb_alarms_dev.h"
-#include "ppapi/shared_impl/tracked_callback.h"
-#include "ppapi/thunk/enter.h"
-#include "ppapi/thunk/extensions_common_api.h"
-#include "ppapi/thunk/thunk.h"
-
-namespace ppapi {
-namespace thunk {
-
-namespace {
-
-// TODO(yzshen): crbug.com/327197 Implement the thunk.
-
-void Create(PP_Instance instance,
- PP_Var name,
- const PP_Alarms_AlarmCreateInfo_Dev* alarm_info) {
- NOTIMPLEMENTED();
-}
-
-int32_t Get(PP_Instance instance,
- PP_Var name,
- PP_Alarms_Alarm_Dev* alarm,
- PP_CompletionCallback callback) {
- EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback);
- if (enter.failed())
- return enter.retval();
-
- NOTIMPLEMENTED();
-
- return enter.SetResult(PP_ERROR_FAILED);
-}
-
-int32_t GetAll(PP_Instance instance,
- PP_Alarms_Alarm_Array_Dev* alarms,
- PP_ArrayOutput array_allocator,
- PP_CompletionCallback callback) {
- EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback);
- if (enter.failed())
- return enter.retval();
-
- NOTIMPLEMENTED();
-
- return enter.SetResult(PP_ERROR_FAILED);
-}
-
-void Clear(PP_Instance instance, PP_Var name) {
- NOTIMPLEMENTED();
-}
-
-void ClearAll(PP_Instance instance) {
- NOTIMPLEMENTED();
-}
-
-uint32_t AddOnAlarmListener(PP_Instance instance,
- PP_Alarms_OnAlarm_Dev callback,
- void* user_data) {
- NOTIMPLEMENTED();
- return 0;
-}
-
-const PPB_Alarms_Dev_0_1 g_ppb_alarms_dev_0_1_thunk = {
- &Create,
- &Get,
- &GetAll,
- &Clear,
- &ClearAll,
- &AddOnAlarmListener
-};
-
-} // namespace
-
-const PPB_Alarms_Dev_0_1* GetPPB_Alarms_Dev_0_1_Thunk() {
- return &g_ppb_alarms_dev_0_1_thunk;
-}
-
-} // namespace thunk
-} // namespace ppapi