summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-22 06:34:03 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-22 06:34:03 +0000
commit86fbad285cb3697e662e2f0b34f82dd2fba2f71e (patch)
tree6b261d3363dee8f179a5c71dcba5667db8957a78 /ppapi
parentd394d9761b6749ad61a001b0ea69850f937f60c9 (diff)
downloadchromium_src-86fbad285cb3697e662e2f0b34f82dd2fba2f71e.zip
chromium_src-86fbad285cb3697e662e2f0b34f82dd2fba2f71e.tar.gz
chromium_src-86fbad285cb3697e662e2f0b34f82dd2fba2f71e.tar.bz2
Make NetworkList and NetworkMonitor APIs public
BUG=281781 R=nfullagar@chromium.org, thakis@chromium.org, yzshen@chromium.org TBR=cevans@chromium.org Review URL: https://codereview.chromium.org/23450012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224626 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/ppb_network_list.idl (renamed from ppapi/api/private/ppb_network_list_private.idl)45
-rw-r--r--ppapi/api/ppb_network_monitor.idl (renamed from ppapi/api/private/ppb_network_monitor_private.idl)20
-rw-r--r--ppapi/c/ppb_network_list.h (renamed from ppapi/c/private/ppb_network_list_private.h)55
-rw-r--r--ppapi/c/ppb_network_monitor.h (renamed from ppapi/c/private/ppb_network_monitor_private.h)36
-rw-r--r--ppapi/cpp/network_list.cc94
-rw-r--r--ppapi/cpp/network_list.h (renamed from ppapi/cpp/private/network_list_private.h)18
-rw-r--r--ppapi/cpp/network_monitor.cc44
-rw-r--r--ppapi/cpp/network_monitor.h (renamed from ppapi/cpp/private/network_monitor_private.h)16
-rw-r--r--ppapi/cpp/private/network_list_private.cc94
-rw-r--r--ppapi/cpp/private/network_monitor_private.cc44
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c196
-rw-r--r--ppapi/ppapi_shared.gypi6
-rw-r--r--ppapi/ppapi_sources.gypi17
-rw-r--r--ppapi/proxy/interface_list.cc4
-rw-r--r--ppapi/proxy/network_list_resource.cc8
-rw-r--r--ppapi/proxy/network_list_resource.h4
-rw-r--r--ppapi/proxy/ppapi_messages.h4
-rw-r--r--ppapi/proxy/resource_creation_proxy.cc2
-rw-r--r--ppapi/proxy/resource_creation_proxy.h3
-rw-r--r--ppapi/proxy/serialized_structs.cc4
-rw-r--r--ppapi/proxy/serialized_structs.h6
-rw-r--r--ppapi/tests/all_c_includes.h4
-rw-r--r--ppapi/tests/test_network_monitor.cc (renamed from ppapi/tests/test_network_monitor_private.cc)62
-rw-r--r--ppapi/tests/test_network_monitor.h (renamed from ppapi/tests/test_network_monitor_private.h)14
-rw-r--r--ppapi/thunk/interfaces_ppb_private_no_permissions.h4
-rw-r--r--ppapi/thunk/interfaces_ppb_public_stable.h3
-rw-r--r--ppapi/thunk/ppb_network_list_api.h6
-rw-r--r--ppapi/thunk/ppb_network_list_thunk.cc (renamed from ppapi/thunk/ppb_network_list_private_thunk.cc)35
-rw-r--r--ppapi/thunk/ppb_network_monitor_api.h2
-rw-r--r--ppapi/thunk/ppb_network_monitor_thunk.cc (renamed from ppapi/thunk/ppb_network_monitor_private_thunk.cc)20
-rw-r--r--ppapi/thunk/resource_creation_api.h8
31 files changed, 435 insertions, 443 deletions
diff --git a/ppapi/api/private/ppb_network_list_private.idl b/ppapi/api/ppb_network_list.idl
index f7e1e48..70c301f 100644
--- a/ppapi/api/private/ppb_network_list_private.idl
+++ b/ppapi/api/ppb_network_list.idl
@@ -4,65 +4,64 @@
*/
/**
- * This file defines the <code>PPB_NetworkList_Private</code> interface.
+ * This file defines the <code>PPB_NetworkList</code> interface.
*/
[generate_thunk]
label Chrome {
- M31 = 0.3
+ M31 = 1.0
};
/**
* Type of a network interface.
*/
[assert_size(4)]
-enum PP_NetworkListType_Private {
+enum PP_NetworkList_Type {
/**
* Type of the network interface is not known.
*/
- PP_NETWORKLIST_UNKNOWN = 0,
+ PP_NETWORKLIST_TYPE_UNKNOWN = 0,
/**
* Wired Ethernet network.
*/
- PP_NETWORKLIST_ETHERNET = 1,
+ PP_NETWORKLIST_TYPE_ETHERNET = 1,
/**
* Wireless Wi-Fi network.
*/
- PP_NETWORKLIST_WIFI = 2,
+ PP_NETWORKLIST_TYPE_WIFI = 2,
/**
* Cellular network (e.g. LTE).
*/
- PP_NETWORKLIST_CELLULAR = 3
+ PP_NETWORKLIST_TYPE_CELLULAR = 3
};
/**
* State of a network interface.
*/
[assert_size(4)]
-enum PP_NetworkListState_Private {
+enum PP_NetworkList_State {
/**
* Network interface is down.
*/
- PP_NETWORKLIST_DOWN = 0,
+ PP_NETWORKLIST_STATE_DOWN = 0,
/**
* Network interface is up.
*/
- PP_NETWORKLIST_UP = 1
+ PP_NETWORKLIST_STATE_UP = 1
};
/**
- * The <code>PPB_NetworkList_Private</code> is used to represent a
- * list of network interfaces and their configuration. The content of
- * the list is immutable. The current networks configuration can be
- * received using the <code>PPB_NetworkMonitor_Private</code>
- * interface.
+ * The <code>PPB_NetworkList</code> is used to represent a list of
+ * network interfaces and their configuration. The content of the list
+ * is immutable. The current networks configuration can be received
+ * using the <code>PPB_NetworkMonitor</code> interface.
*/
-interface PPB_NetworkList_Private {
+interface PPB_NetworkList {
/**
* Determines if the specified <code>resource</code> is a
* <code>NetworkList</code> object.
@@ -70,7 +69,7 @@ interface PPB_NetworkList_Private {
* @param[in] resource A <code>PP_Resource</code> resource.
*
* @return Returns <code>PP_TRUE</code> if <code>resource</code> is
- * a <code>PPB_NetworkList_Private</code>, <code>PP_FALSE</code>
+ * a <code>PPB_NetworkList</code>, <code>PP_FALSE</code>
* otherwise.
*/
PP_Bool IsNetworkList([in] PP_Resource resource);
@@ -109,9 +108,9 @@ interface PPB_NetworkList_Private {
* @return Returns type of the network interface with the specified
* <code>index</code>.
*/
- [on_failure=PP_NETWORKLIST_UNKNOWN]
- PP_NetworkListType_Private GetType([in] PP_Resource resource,
- [in] uint32_t index);
+ [on_failure=PP_NETWORKLIST_TYPE_UNKNOWN]
+ PP_NetworkList_Type GetType([in] PP_Resource resource,
+ [in] uint32_t index);
/**
* Gets state of a network interface.
@@ -123,9 +122,9 @@ interface PPB_NetworkList_Private {
* @return Returns current state of the network interface with the
* specified <code>index</code>.
*/
- [on_failure=PP_NETWORKLIST_DOWN]
- PP_NetworkListState_Private GetState([in] PP_Resource resource,
- [in] uint32_t index);
+ [on_failure=PP_NETWORKLIST_STATE_DOWN]
+ PP_NetworkList_State GetState([in] PP_Resource resource,
+ [in] uint32_t index);
/**
* Gets list of IP addresses for a network interface.
diff --git a/ppapi/api/private/ppb_network_monitor_private.idl b/ppapi/api/ppb_network_monitor.idl
index eae06a3..361f7cb 100644
--- a/ppapi/api/private/ppb_network_monitor_private.idl
+++ b/ppapi/api/ppb_network_monitor.idl
@@ -4,20 +4,25 @@
*/
/**
- * This file defines the <code>PPB_NetworkMonitor_Private</code> interface.
+ * This file defines the <code>PPB_NetworkMonitor</code> interface.
*/
[generate_thunk]
label Chrome {
- M31 = 0.3
+ M31 = 1.0
};
/**
- * The <code>PPB_NetworkMonitor_Private</code> provides access to
- * notifications of network configuration changes.
+ * The <code>PPB_NetworkMonitor</code> allows to get network interfaces
+ * configuration and monitor network configuration changes.
+ *
+ * Permissions: Apps permission <code>socket</code> with subrule
+ * <code>network-state</code> is required for <code>UpdateNetworkList()</code>.
+ * For more details about network communication permissions, please see:
+ * http://developer.chrome.com/apps/app_network.html
*/
-interface PPB_NetworkMonitor_Private {
+interface PPB_NetworkMonitor {
/**
* Creates a Network Monitor resource.
*
@@ -57,9 +62,8 @@ interface PPB_NetworkMonitor_Private {
*
* @param[in] resource A <code>PP_Resource</code> resource.
*
- * @return Returns <code>PP_TRUE</code> if <code>resource</code> is
- * a <code>PPB_NetworkMonitor_Private</code>, <code>PP_FALSE</code>
- * otherwise.
+ * @return Returns <code>PP_TRUE</code> if <code>resource</code> is a
+ * <code>PPB_NetworkMonitor</code>, <code>PP_FALSE</code> otherwise.
*/
PP_Bool IsNetworkMonitor([in] PP_Resource resource);
};
diff --git a/ppapi/c/private/ppb_network_list_private.h b/ppapi/c/ppb_network_list.h
index 296d0df..d7b2265 100644
--- a/ppapi/c/private/ppb_network_list_private.h
+++ b/ppapi/c/ppb_network_list.h
@@ -3,12 +3,10 @@
* found in the LICENSE file.
*/
-/* From private/ppb_network_list_private.idl,
- * modified Wed Sep 4 11:42:02 2013.
- */
+/* From ppb_network_list.idl modified Mon Sep 9 11:16:26 2013. */
-#ifndef PPAPI_C_PRIVATE_PPB_NETWORK_LIST_PRIVATE_H_
-#define PPAPI_C_PRIVATE_PPB_NETWORK_LIST_PRIVATE_H_
+#ifndef PPAPI_C_PPB_NETWORK_LIST_H_
+#define PPAPI_C_PPB_NETWORK_LIST_H_
#include "ppapi/c/pp_array_output.h"
#include "ppapi/c/pp_bool.h"
@@ -17,12 +15,12 @@
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_var.h"
-#define PPB_NETWORKLIST_PRIVATE_INTERFACE_0_3 "PPB_NetworkList_Private;0.3"
-#define PPB_NETWORKLIST_PRIVATE_INTERFACE PPB_NETWORKLIST_PRIVATE_INTERFACE_0_3
+#define PPB_NETWORKLIST_INTERFACE_1_0 "PPB_NetworkList;1.0"
+#define PPB_NETWORKLIST_INTERFACE PPB_NETWORKLIST_INTERFACE_1_0
/**
* @file
- * This file defines the <code>PPB_NetworkList_Private</code> interface.
+ * This file defines the <code>PPB_NetworkList</code> interface.
*/
@@ -37,21 +35,21 @@ typedef enum {
/**
* Type of the network interface is not known.
*/
- PP_NETWORKLIST_UNKNOWN = 0,
+ PP_NETWORKLIST_TYPE_UNKNOWN = 0,
/**
* Wired Ethernet network.
*/
- PP_NETWORKLIST_ETHERNET = 1,
+ PP_NETWORKLIST_TYPE_ETHERNET = 1,
/**
* Wireless Wi-Fi network.
*/
- PP_NETWORKLIST_WIFI = 2,
+ PP_NETWORKLIST_TYPE_WIFI = 2,
/**
* Cellular network (e.g. LTE).
*/
- PP_NETWORKLIST_CELLULAR = 3
-} PP_NetworkListType_Private;
-PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkListType_Private, 4);
+ PP_NETWORKLIST_TYPE_CELLULAR = 3
+} PP_NetworkList_Type;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkList_Type, 4);
/**
* State of a network interface.
@@ -60,13 +58,13 @@ typedef enum {
/**
* Network interface is down.
*/
- PP_NETWORKLIST_DOWN = 0,
+ PP_NETWORKLIST_STATE_DOWN = 0,
/**
* Network interface is up.
*/
- PP_NETWORKLIST_UP = 1
-} PP_NetworkListState_Private;
-PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkListState_Private, 4);
+ PP_NETWORKLIST_STATE_UP = 1
+} PP_NetworkList_State;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkList_State, 4);
/**
* @}
*/
@@ -76,13 +74,12 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkListState_Private, 4);
* @{
*/
/**
- * The <code>PPB_NetworkList_Private</code> is used to represent a
- * list of network interfaces and their configuration. The content of
- * the list is immutable. The current networks configuration can be
- * received using the <code>PPB_NetworkMonitor_Private</code>
- * interface.
+ * The <code>PPB_NetworkList</code> is used to represent a list of
+ * network interfaces and their configuration. The content of the list
+ * is immutable. The current networks configuration can be received
+ * using the <code>PPB_NetworkMonitor</code> interface.
*/
-struct PPB_NetworkList_Private_0_3 {
+struct PPB_NetworkList_1_0 {
/**
* Determines if the specified <code>resource</code> is a
* <code>NetworkList</code> object.
@@ -90,7 +87,7 @@ struct PPB_NetworkList_Private_0_3 {
* @param[in] resource A <code>PP_Resource</code> resource.
*
* @return Returns <code>PP_TRUE</code> if <code>resource</code> is
- * a <code>PPB_NetworkList_Private</code>, <code>PP_FALSE</code>
+ * a <code>PPB_NetworkList</code>, <code>PP_FALSE</code>
* otherwise.
*/
PP_Bool (*IsNetworkList)(PP_Resource resource);
@@ -125,7 +122,7 @@ struct PPB_NetworkList_Private_0_3 {
* @return Returns type of the network interface with the specified
* <code>index</code>.
*/
- PP_NetworkListType_Private (*GetType)(PP_Resource resource, uint32_t index);
+ PP_NetworkList_Type (*GetType)(PP_Resource resource, uint32_t index);
/**
* Gets state of a network interface.
*
@@ -136,7 +133,7 @@ struct PPB_NetworkList_Private_0_3 {
* @return Returns current state of the network interface with the
* specified <code>index</code>.
*/
- PP_NetworkListState_Private (*GetState)(PP_Resource resource, uint32_t index);
+ PP_NetworkList_State (*GetState)(PP_Resource resource, uint32_t index);
/**
* Gets list of IP addresses for a network interface.
*
@@ -177,10 +174,10 @@ struct PPB_NetworkList_Private_0_3 {
uint32_t (*GetMTU)(PP_Resource resource, uint32_t index);
};
-typedef struct PPB_NetworkList_Private_0_3 PPB_NetworkList_Private;
+typedef struct PPB_NetworkList_1_0 PPB_NetworkList;
/**
* @}
*/
-#endif /* PPAPI_C_PRIVATE_PPB_NETWORK_LIST_PRIVATE_H_ */
+#endif /* PPAPI_C_PPB_NETWORK_LIST_H_ */
diff --git a/ppapi/c/private/ppb_network_monitor_private.h b/ppapi/c/ppb_network_monitor.h
index 29aba98..6408a45 100644
--- a/ppapi/c/private/ppb_network_monitor_private.h
+++ b/ppapi/c/ppb_network_monitor.h
@@ -3,12 +3,10 @@
* found in the LICENSE file.
*/
-/* From private/ppb_network_monitor_private.idl,
- * modified Wed Sep 4 14:16:07 2013.
- */
+/* From ppb_network_monitor.idl modified Thu Sep 19 16:42:34 2013. */
-#ifndef PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_
-#define PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_
+#ifndef PPAPI_C_PPB_NETWORK_MONITOR_H_
+#define PPAPI_C_PPB_NETWORK_MONITOR_H_
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_completion_callback.h"
@@ -17,14 +15,12 @@
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
-#define PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_3 \
- "PPB_NetworkMonitor_Private;0.3"
-#define PPB_NETWORKMONITOR_PRIVATE_INTERFACE \
- PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_3
+#define PPB_NETWORKMONITOR_INTERFACE_1_0 "PPB_NetworkMonitor;1.0"
+#define PPB_NETWORKMONITOR_INTERFACE PPB_NETWORKMONITOR_INTERFACE_1_0
/**
* @file
- * This file defines the <code>PPB_NetworkMonitor_Private</code> interface.
+ * This file defines the <code>PPB_NetworkMonitor</code> interface.
*/
@@ -33,10 +29,15 @@
* @{
*/
/**
- * The <code>PPB_NetworkMonitor_Private</code> provides access to
- * notifications of network configuration changes.
+ * The <code>PPB_NetworkMonitor</code> allows to get network interfaces
+ * configuration and monitor network configuration changes.
+ *
+ * Permissions: Apps permission <code>socket</code> with subrule
+ * <code>network-state</code> is required for <code>UpdateNetworkList()</code>.
+ * For more details about network communication permissions, please see:
+ * http://developer.chrome.com/apps/app_network.html
*/
-struct PPB_NetworkMonitor_Private_0_3 {
+struct PPB_NetworkMonitor_1_0 {
/**
* Creates a Network Monitor resource.
*
@@ -73,17 +74,16 @@ struct PPB_NetworkMonitor_Private_0_3 {
*
* @param[in] resource A <code>PP_Resource</code> resource.
*
- * @return Returns <code>PP_TRUE</code> if <code>resource</code> is
- * a <code>PPB_NetworkMonitor_Private</code>, <code>PP_FALSE</code>
- * otherwise.
+ * @return Returns <code>PP_TRUE</code> if <code>resource</code> is a
+ * <code>PPB_NetworkMonitor</code>, <code>PP_FALSE</code> otherwise.
*/
PP_Bool (*IsNetworkMonitor)(PP_Resource resource);
};
-typedef struct PPB_NetworkMonitor_Private_0_3 PPB_NetworkMonitor_Private;
+typedef struct PPB_NetworkMonitor_1_0 PPB_NetworkMonitor;
/**
* @}
*/
-#endif /* PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_ */
+#endif /* PPAPI_C_PPB_NETWORK_MONITOR_H_ */
diff --git a/ppapi/cpp/network_list.cc b/ppapi/cpp/network_list.cc
new file mode 100644
index 0000000..12c3bf4
--- /dev/null
+++ b/ppapi/cpp/network_list.cc
@@ -0,0 +1,94 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/cpp/network_list.h"
+
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/cpp/array_output.h"
+#include "ppapi/cpp/logging.h"
+#include "ppapi/cpp/module_impl.h"
+#include "ppapi/cpp/net_address.h"
+#include "ppapi/cpp/var.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_NetworkList_1_0>() {
+ return PPB_NETWORKLIST_INTERFACE_1_0;
+}
+
+} // namespace
+
+NetworkList::NetworkList() {
+}
+
+NetworkList::NetworkList(PassRef, PP_Resource resource)
+ : Resource(PASS_REF, resource) {
+}
+
+// static
+bool NetworkList::IsAvailable() {
+ return has_interface<PPB_NetworkList_1_0>();
+}
+
+uint32_t NetworkList::GetCount() const {
+ if (!has_interface<PPB_NetworkList_1_0>())
+ return 0;
+ return get_interface<PPB_NetworkList_1_0>()->GetCount(pp_resource());
+}
+
+std::string NetworkList::GetName(uint32_t index) const {
+ if (!has_interface<PPB_NetworkList_1_0>())
+ return std::string();
+ Var result(PASS_REF,
+ get_interface<PPB_NetworkList_1_0>()->GetName(
+ pp_resource(), index));
+ return result.is_string() ? result.AsString() : std::string();
+}
+
+PP_NetworkList_Type NetworkList::GetType(uint32_t index) const {
+ if (!has_interface<PPB_NetworkList_1_0>())
+ return PP_NETWORKLIST_TYPE_ETHERNET;
+ return get_interface<PPB_NetworkList_1_0>()->GetType(
+ pp_resource(), index);
+}
+
+PP_NetworkList_State NetworkList::GetState(uint32_t index) const {
+ if (!has_interface<PPB_NetworkList_1_0>())
+ return PP_NETWORKLIST_STATE_DOWN;
+ return get_interface<PPB_NetworkList_1_0>()->GetState(
+ pp_resource(), index);
+}
+
+int32_t NetworkList::GetIpAddresses(
+ uint32_t index,
+ std::vector<NetAddress>* addresses) const {
+ if (!has_interface<PPB_NetworkList_1_0>())
+ return PP_ERROR_NOINTERFACE;
+ if (!addresses)
+ return PP_ERROR_BADARGUMENT;
+
+ ResourceArrayOutputAdapter<NetAddress> adapter(addresses);
+ return get_interface<PPB_NetworkList_1_0>()->GetIpAddresses(
+ pp_resource(), index, adapter.pp_array_output());
+}
+
+std::string NetworkList::GetDisplayName(uint32_t index) const {
+ if (!has_interface<PPB_NetworkList_1_0>())
+ return std::string();
+ Var result(PASS_REF,
+ get_interface<PPB_NetworkList_1_0>()->GetDisplayName(
+ pp_resource(), index));
+ return result.is_string() ? result.AsString() : std::string();
+}
+
+uint32_t NetworkList::GetMTU(uint32_t index) const {
+ if (!has_interface<PPB_NetworkList_1_0>())
+ return 0;
+ return get_interface<PPB_NetworkList_1_0>()->GetMTU(
+ pp_resource(), index);
+}
+
+} // namespace pp
diff --git a/ppapi/cpp/private/network_list_private.h b/ppapi/cpp/network_list.h
index c338aa6..d479129 100644
--- a/ppapi/cpp/private/network_list_private.h
+++ b/ppapi/cpp/network_list.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_
-#define PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_
+#ifndef PPAPI_CPP_NETWORK_LIST_H_
+#define PPAPI_CPP_NETWORK_LIST_H_
#include <string>
#include <vector>
-#include "ppapi/c/private/ppb_network_list_private.h"
+#include "ppapi/c/ppb_network_list.h"
#include "ppapi/cpp/pass_ref.h"
#include "ppapi/cpp/resource.h"
@@ -16,10 +16,10 @@ namespace pp {
class NetAddress;
-class NetworkListPrivate : public Resource {
+class NetworkList : public Resource {
public:
- NetworkListPrivate();
- NetworkListPrivate(PassRef, PP_Resource resource);
+ NetworkList();
+ NetworkList(PassRef, PP_Resource resource);
/// Returns true if the required interface is available.
static bool IsAvailable();
@@ -34,11 +34,11 @@ class NetworkListPrivate : public Resource {
/// @return Returns the type of the network interface with the
/// specified <code>index</code>.
- PP_NetworkListType_Private GetType(uint32_t index) const;
+ PP_NetworkList_Type GetType(uint32_t index) const;
/// @return Returns the current state of the network interface with
/// the specified <code>index</code>.
- PP_NetworkListState_Private GetState(uint32_t index) const;
+ PP_NetworkList_State GetState(uint32_t index) const;
/// Gets the list of IP addresses for the network interface with the
/// specified <code>index</code> and stores them in
@@ -57,4 +57,4 @@ class NetworkListPrivate : public Resource {
} // namespace pp
-#endif // PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_
+#endif // PPAPI_CPP_NETWORK_LIST_H_
diff --git a/ppapi/cpp/network_monitor.cc b/ppapi/cpp/network_monitor.cc
new file mode 100644
index 0000000..b721e96
--- /dev/null
+++ b/ppapi/cpp/network_monitor.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/cpp/network_monitor.h"
+
+#include "ppapi/c/ppb_network_monitor.h"
+#include "ppapi/cpp/completion_callback.h"
+#include "ppapi/cpp/instance.h"
+#include "ppapi/cpp/module_impl.h"
+#include "ppapi/cpp/network_list.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_NetworkMonitor_1_0>() {
+ return PPB_NETWORKMONITOR_INTERFACE_1_0;
+}
+
+} // namespace
+
+NetworkMonitor::NetworkMonitor(const InstanceHandle& instance) {
+ if (has_interface<PPB_NetworkMonitor_1_0>()) {
+ PassRefFromConstructor(get_interface<PPB_NetworkMonitor_1_0>()->Create(
+ instance.pp_instance()));
+ }
+}
+
+int32_t NetworkMonitor::UpdateNetworkList(
+ const CompletionCallbackWithOutput<NetworkList>& callback) {
+ if (has_interface<PPB_NetworkMonitor_1_0>()) {
+ return get_interface<PPB_NetworkMonitor_1_0>()->UpdateNetworkList(
+ pp_resource(), callback.output(), callback.pp_completion_callback());
+ }
+ return callback.MayForce(PP_ERROR_NOINTERFACE);
+}
+
+// static
+bool NetworkMonitor::IsAvailable() {
+ return has_interface<PPB_NetworkMonitor_1_0>();
+}
+
+} // namespace pp
diff --git a/ppapi/cpp/private/network_monitor_private.h b/ppapi/cpp/network_monitor.h
index b8fbe0f..bce731d9 100644
--- a/ppapi/cpp/private/network_monitor_private.h
+++ b/ppapi/cpp/network_monitor.h
@@ -2,25 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef PPAPI_CPP_PRIVATE_NETWORK_MONITOR_PRIVATE_H_
-#define PPAPI_CPP_PRIVATE_NETWORK_MONITOR_PRIVATE_H_
+#ifndef PPAPI_CPP_NETWORK_MONITOR_H_
+#define PPAPI_CPP_NETWORK_MONITOR_H_
-#include "ppapi/cpp/resource.h"
#include "ppapi/cpp/instance_handle.h"
+#include "ppapi/cpp/resource.h"
namespace pp {
class Instance;
-class NetworkListPrivate;
+class NetworkList;
template <typename T> class CompletionCallbackWithOutput;
-class NetworkMonitorPrivate : public Resource {
+class NetworkMonitor : public Resource {
public:
- explicit NetworkMonitorPrivate(const InstanceHandle& instance);
+ explicit NetworkMonitor(const InstanceHandle& instance);
int32_t UpdateNetworkList(
- const CompletionCallbackWithOutput<NetworkListPrivate>& callback);
+ const CompletionCallbackWithOutput<NetworkList>& callback);
// Returns true if the required interface is available.
static bool IsAvailable();
@@ -28,4 +28,4 @@ class NetworkMonitorPrivate : public Resource {
} // namespace pp
-#endif // PPAPI_CPP_PRIVATE_NETWORK_MONITOR_PRIVATE_H_
+#endif // PPAPI_CPP_NETWORK_MONITOR_H_
diff --git a/ppapi/cpp/private/network_list_private.cc b/ppapi/cpp/private/network_list_private.cc
deleted file mode 100644
index 5a3a5be..0000000
--- a/ppapi/cpp/private/network_list_private.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ppapi/cpp/private/network_list_private.h"
-
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/cpp/array_output.h"
-#include "ppapi/cpp/logging.h"
-#include "ppapi/cpp/module_impl.h"
-#include "ppapi/cpp/net_address.h"
-#include "ppapi/cpp/var.h"
-
-namespace pp {
-
-namespace {
-
-template <> const char* interface_name<PPB_NetworkList_Private_0_3>() {
- return PPB_NETWORKLIST_PRIVATE_INTERFACE_0_3;
-}
-
-} // namespace
-
-NetworkListPrivate::NetworkListPrivate() {
-}
-
-NetworkListPrivate::NetworkListPrivate(PassRef, PP_Resource resource)
- : Resource(PASS_REF, resource) {
-}
-
-// static
-bool NetworkListPrivate::IsAvailable() {
- return has_interface<PPB_NetworkList_Private_0_3>();
-}
-
-uint32_t NetworkListPrivate::GetCount() const {
- if (!has_interface<PPB_NetworkList_Private_0_3>())
- return 0;
- return get_interface<PPB_NetworkList_Private_0_3>()->GetCount(pp_resource());
-}
-
-std::string NetworkListPrivate::GetName(uint32_t index) const {
- if (!has_interface<PPB_NetworkList_Private_0_3>())
- return std::string();
- Var result(PASS_REF,
- get_interface<PPB_NetworkList_Private_0_3>()->GetName(
- pp_resource(), index));
- return result.is_string() ? result.AsString() : std::string();
-}
-
-PP_NetworkListType_Private NetworkListPrivate::GetType(uint32_t index) const {
- if (!has_interface<PPB_NetworkList_Private_0_3>())
- return PP_NETWORKLIST_ETHERNET;
- return get_interface<PPB_NetworkList_Private_0_3>()->GetType(
- pp_resource(), index);
-}
-
-PP_NetworkListState_Private NetworkListPrivate::GetState(uint32_t index) const {
- if (!has_interface<PPB_NetworkList_Private_0_3>())
- return PP_NETWORKLIST_DOWN;
- return get_interface<PPB_NetworkList_Private_0_3>()->GetState(
- pp_resource(), index);
-}
-
-int32_t NetworkListPrivate::GetIpAddresses(
- uint32_t index,
- std::vector<NetAddress>* addresses) const {
- if (!has_interface<PPB_NetworkList_Private_0_3>())
- return PP_ERROR_NOINTERFACE;
- if (!addresses)
- return PP_ERROR_BADARGUMENT;
-
- ResourceArrayOutputAdapter<NetAddress> adapter(addresses);
- return get_interface<PPB_NetworkList_Private_0_3>()->GetIpAddresses(
- pp_resource(), index, adapter.pp_array_output());
-}
-
-std::string NetworkListPrivate::GetDisplayName(uint32_t index) const {
- if (!has_interface<PPB_NetworkList_Private_0_3>())
- return std::string();
- Var result(PASS_REF,
- get_interface<PPB_NetworkList_Private_0_3>()->GetDisplayName(
- pp_resource(), index));
- return result.is_string() ? result.AsString() : std::string();
-}
-
-uint32_t NetworkListPrivate::GetMTU(uint32_t index) const {
- if (!has_interface<PPB_NetworkList_Private_0_3>())
- return 0;
- return get_interface<PPB_NetworkList_Private_0_3>()->GetMTU(
- pp_resource(), index);
-}
-
-} // namespace pp
diff --git a/ppapi/cpp/private/network_monitor_private.cc b/ppapi/cpp/private/network_monitor_private.cc
deleted file mode 100644
index 7cef97f..0000000
--- a/ppapi/cpp/private/network_monitor_private.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ppapi/cpp/private/network_monitor_private.h"
-
-#include "ppapi/c/private/ppb_network_monitor_private.h"
-#include "ppapi/cpp/completion_callback.h"
-#include "ppapi/cpp/instance.h"
-#include "ppapi/cpp/module_impl.h"
-#include "ppapi/cpp/private/network_list_private.h"
-
-namespace pp {
-
-namespace {
-
-template <> const char* interface_name<PPB_NetworkMonitor_Private_0_3>() {
- return PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_3;
-}
-
-} // namespace
-
-NetworkMonitorPrivate::NetworkMonitorPrivate(const InstanceHandle& instance) {
- if (has_interface<PPB_NetworkMonitor_Private_0_3>()) {
- PassRefFromConstructor(get_interface<PPB_NetworkMonitor_Private_0_3>()->
- Create(instance.pp_instance()));
- }
-}
-
-int32_t NetworkMonitorPrivate::UpdateNetworkList(
- const CompletionCallbackWithOutput<NetworkListPrivate>& callback) {
- if (has_interface<PPB_NetworkMonitor_Private_0_3>()) {
- return get_interface<PPB_NetworkMonitor_Private_0_3>()->UpdateNetworkList(
- pp_resource(), callback.output(), callback.pp_completion_callback());
- }
- return callback.MayForce(PP_ERROR_NOINTERFACE);
-}
-
-// static
-bool NetworkMonitorPrivate::IsAvailable() {
- return has_interface<PPB_NetworkMonitor_Private_0_3>();
-}
-
-} // namespace pp
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 074bbbe..747d753 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
@@ -64,6 +64,8 @@
#include "ppapi/c/ppb_mouse_cursor.h"
#include "ppapi/c/ppb_mouse_lock.h"
#include "ppapi/c/ppb_net_address.h"
+#include "ppapi/c/ppb_network_list.h"
+#include "ppapi/c/ppb_network_monitor.h"
#include "ppapi/c/ppb_network_proxy.h"
#include "ppapi/c/ppb_tcp_socket.h"
#include "ppapi/c/ppb_text_input_controller.h"
@@ -99,8 +101,6 @@
#include "ppapi/c/private/ppb_instance_private.h"
#include "ppapi/c/private/ppb_nacl_private.h"
#include "ppapi/c/private/ppb_net_address_private.h"
-#include "ppapi/c/private/ppb_network_list_private.h"
-#include "ppapi/c/private/ppb_network_monitor_private.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/c/private/ppb_platform_verification_private.h"
#include "ppapi/c/private/ppb_talk_private.h"
@@ -156,6 +156,8 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_MessageLoop_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Messaging_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_MouseLock_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_1_0;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkList_1_0;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkMonitor_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkProxy_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_1_1;
@@ -211,8 +213,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NaCl_Private_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_1_1;
-static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3;
-static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkMonitor_Private_0_3;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_OutputProtection_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_PlatformVerification_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Talk_Private_1_0;
@@ -1016,6 +1016,69 @@ static PP_Bool Pnacl_M29_PPB_NetAddress_DescribeAsIPv6Address(PP_Resource addr,
/* End wrapper methods for PPB_NetAddress_1_0 */
+/* Begin wrapper methods for PPB_NetworkList_1_0 */
+
+static PP_Bool Pnacl_M31_PPB_NetworkList_IsNetworkList(PP_Resource resource) {
+ const struct PPB_NetworkList_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkList_1_0.real_iface;
+ return iface->IsNetworkList(resource);
+}
+
+static uint32_t Pnacl_M31_PPB_NetworkList_GetCount(PP_Resource resource) {
+ const struct PPB_NetworkList_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkList_1_0.real_iface;
+ return iface->GetCount(resource);
+}
+
+static void Pnacl_M31_PPB_NetworkList_GetName(struct PP_Var* _struct_result, PP_Resource resource, uint32_t index) {
+ const struct PPB_NetworkList_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkList_1_0.real_iface;
+ *_struct_result = iface->GetName(resource, index);
+}
+
+static PP_NetworkList_Type Pnacl_M31_PPB_NetworkList_GetType(PP_Resource resource, uint32_t index) {
+ const struct PPB_NetworkList_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkList_1_0.real_iface;
+ return iface->GetType(resource, index);
+}
+
+static PP_NetworkList_State Pnacl_M31_PPB_NetworkList_GetState(PP_Resource resource, uint32_t index) {
+ const struct PPB_NetworkList_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkList_1_0.real_iface;
+ return iface->GetState(resource, index);
+}
+
+static int32_t Pnacl_M31_PPB_NetworkList_GetIpAddresses(PP_Resource resource, uint32_t index, struct PP_ArrayOutput* output) {
+ const struct PPB_NetworkList_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkList_1_0.real_iface;
+ return iface->GetIpAddresses(resource, index, *output);
+}
+
+static void Pnacl_M31_PPB_NetworkList_GetDisplayName(struct PP_Var* _struct_result, PP_Resource resource, uint32_t index) {
+ const struct PPB_NetworkList_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkList_1_0.real_iface;
+ *_struct_result = iface->GetDisplayName(resource, index);
+}
+
+static uint32_t Pnacl_M31_PPB_NetworkList_GetMTU(PP_Resource resource, uint32_t index) {
+ const struct PPB_NetworkList_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkList_1_0.real_iface;
+ return iface->GetMTU(resource, index);
+}
+
+/* End wrapper methods for PPB_NetworkList_1_0 */
+
+/* Begin wrapper methods for PPB_NetworkMonitor_1_0 */
+
+static PP_Resource Pnacl_M31_PPB_NetworkMonitor_Create(PP_Instance instance) {
+ const struct PPB_NetworkMonitor_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkMonitor_1_0.real_iface;
+ return iface->Create(instance);
+}
+
+static int32_t Pnacl_M31_PPB_NetworkMonitor_UpdateNetworkList(PP_Resource network_monitor, PP_Resource* network_list, struct PP_CompletionCallback* callback) {
+ const struct PPB_NetworkMonitor_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkMonitor_1_0.real_iface;
+ return iface->UpdateNetworkList(network_monitor, network_list, *callback);
+}
+
+static PP_Bool Pnacl_M31_PPB_NetworkMonitor_IsNetworkMonitor(PP_Resource resource) {
+ const struct PPB_NetworkMonitor_1_0 *iface = Pnacl_WrapperInfo_PPB_NetworkMonitor_1_0.real_iface;
+ return iface->IsNetworkMonitor(resource);
+}
+
+/* End wrapper methods for PPB_NetworkMonitor_1_0 */
+
/* Begin wrapper methods for PPB_NetworkProxy_1_0 */
static int32_t Pnacl_M29_PPB_NetworkProxy_GetProxyForURL(PP_Instance instance, struct PP_Var* url, struct PP_Var* proxy_string, struct PP_CompletionCallback* callback) {
@@ -3145,69 +3208,6 @@ static void Pnacl_M19_1_PPB_NetAddress_Private_CreateFromIPv6Address(const uint8
/* End wrapper methods for PPB_NetAddress_Private_1_1 */
-/* Begin wrapper methods for PPB_NetworkList_Private_0_3 */
-
-static PP_Bool Pnacl_M31_PPB_NetworkList_Private_IsNetworkList(PP_Resource resource) {
- const struct PPB_NetworkList_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3.real_iface;
- return iface->IsNetworkList(resource);
-}
-
-static uint32_t Pnacl_M31_PPB_NetworkList_Private_GetCount(PP_Resource resource) {
- const struct PPB_NetworkList_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3.real_iface;
- return iface->GetCount(resource);
-}
-
-static void Pnacl_M31_PPB_NetworkList_Private_GetName(struct PP_Var* _struct_result, PP_Resource resource, uint32_t index) {
- const struct PPB_NetworkList_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3.real_iface;
- *_struct_result = iface->GetName(resource, index);
-}
-
-static PP_NetworkListType_Private Pnacl_M31_PPB_NetworkList_Private_GetType(PP_Resource resource, uint32_t index) {
- const struct PPB_NetworkList_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3.real_iface;
- return iface->GetType(resource, index);
-}
-
-static PP_NetworkListState_Private Pnacl_M31_PPB_NetworkList_Private_GetState(PP_Resource resource, uint32_t index) {
- const struct PPB_NetworkList_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3.real_iface;
- return iface->GetState(resource, index);
-}
-
-static int32_t Pnacl_M31_PPB_NetworkList_Private_GetIpAddresses(PP_Resource resource, uint32_t index, struct PP_ArrayOutput* output) {
- const struct PPB_NetworkList_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3.real_iface;
- return iface->GetIpAddresses(resource, index, *output);
-}
-
-static void Pnacl_M31_PPB_NetworkList_Private_GetDisplayName(struct PP_Var* _struct_result, PP_Resource resource, uint32_t index) {
- const struct PPB_NetworkList_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3.real_iface;
- *_struct_result = iface->GetDisplayName(resource, index);
-}
-
-static uint32_t Pnacl_M31_PPB_NetworkList_Private_GetMTU(PP_Resource resource, uint32_t index) {
- const struct PPB_NetworkList_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3.real_iface;
- return iface->GetMTU(resource, index);
-}
-
-/* End wrapper methods for PPB_NetworkList_Private_0_3 */
-
-/* Begin wrapper methods for PPB_NetworkMonitor_Private_0_3 */
-
-static PP_Resource Pnacl_M31_PPB_NetworkMonitor_Private_Create(PP_Instance instance) {
- const struct PPB_NetworkMonitor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkMonitor_Private_0_3.real_iface;
- return iface->Create(instance);
-}
-
-static int32_t Pnacl_M31_PPB_NetworkMonitor_Private_UpdateNetworkList(PP_Resource network_monitor, PP_Resource* network_list, struct PP_CompletionCallback* callback) {
- const struct PPB_NetworkMonitor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkMonitor_Private_0_3.real_iface;
- return iface->UpdateNetworkList(network_monitor, network_list, *callback);
-}
-
-static PP_Bool Pnacl_M31_PPB_NetworkMonitor_Private_IsNetworkMonitor(PP_Resource resource) {
- const struct PPB_NetworkMonitor_Private_0_3 *iface = Pnacl_WrapperInfo_PPB_NetworkMonitor_Private_0_3.real_iface;
- return iface->IsNetworkMonitor(resource);
-}
-
-/* End wrapper methods for PPB_NetworkMonitor_Private_0_3 */
-
/* Begin wrapper methods for PPB_OutputProtection_Private_0_1 */
static PP_Resource Pnacl_M31_PPB_OutputProtection_Private_Create(PP_Instance instance) {
@@ -4314,6 +4314,23 @@ struct PPB_NetAddress_1_0 Pnacl_Wrappers_PPB_NetAddress_1_0 = {
.DescribeAsIPv6Address = (PP_Bool (*)(PP_Resource addr, struct PP_NetAddress_IPv6* ipv6_addr))&Pnacl_M29_PPB_NetAddress_DescribeAsIPv6Address
};
+struct PPB_NetworkList_1_0 Pnacl_Wrappers_PPB_NetworkList_1_0 = {
+ .IsNetworkList = (PP_Bool (*)(PP_Resource resource))&Pnacl_M31_PPB_NetworkList_IsNetworkList,
+ .GetCount = (uint32_t (*)(PP_Resource resource))&Pnacl_M31_PPB_NetworkList_GetCount,
+ .GetName = (struct PP_Var (*)(PP_Resource resource, uint32_t index))&Pnacl_M31_PPB_NetworkList_GetName,
+ .GetType = (PP_NetworkList_Type (*)(PP_Resource resource, uint32_t index))&Pnacl_M31_PPB_NetworkList_GetType,
+ .GetState = (PP_NetworkList_State (*)(PP_Resource resource, uint32_t index))&Pnacl_M31_PPB_NetworkList_GetState,
+ .GetIpAddresses = (int32_t (*)(PP_Resource resource, uint32_t index, struct PP_ArrayOutput output))&Pnacl_M31_PPB_NetworkList_GetIpAddresses,
+ .GetDisplayName = (struct PP_Var (*)(PP_Resource resource, uint32_t index))&Pnacl_M31_PPB_NetworkList_GetDisplayName,
+ .GetMTU = (uint32_t (*)(PP_Resource resource, uint32_t index))&Pnacl_M31_PPB_NetworkList_GetMTU
+};
+
+struct PPB_NetworkMonitor_1_0 Pnacl_Wrappers_PPB_NetworkMonitor_1_0 = {
+ .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M31_PPB_NetworkMonitor_Create,
+ .UpdateNetworkList = (int32_t (*)(PP_Resource network_monitor, PP_Resource* network_list, struct PP_CompletionCallback callback))&Pnacl_M31_PPB_NetworkMonitor_UpdateNetworkList,
+ .IsNetworkMonitor = (PP_Bool (*)(PP_Resource resource))&Pnacl_M31_PPB_NetworkMonitor_IsNetworkMonitor
+};
+
struct PPB_NetworkProxy_1_0 Pnacl_Wrappers_PPB_NetworkProxy_1_0 = {
.GetProxyForURL = (int32_t (*)(PP_Instance instance, struct PP_Var url, struct PP_Var* proxy_string, struct PP_CompletionCallback callback))&Pnacl_M29_PPB_NetworkProxy_GetProxyForURL
};
@@ -4938,23 +4955,6 @@ struct PPB_NetAddress_Private_1_1 Pnacl_Wrappers_PPB_NetAddress_Private_1_1 = {
.CreateFromIPv6Address = (void (*)(const uint8_t ip[16], uint32_t scope_id, uint16_t port, struct PP_NetAddress_Private* addr_out))&Pnacl_M19_1_PPB_NetAddress_Private_CreateFromIPv6Address
};
-struct PPB_NetworkList_Private_0_3 Pnacl_Wrappers_PPB_NetworkList_Private_0_3 = {
- .IsNetworkList = (PP_Bool (*)(PP_Resource resource))&Pnacl_M31_PPB_NetworkList_Private_IsNetworkList,
- .GetCount = (uint32_t (*)(PP_Resource resource))&Pnacl_M31_PPB_NetworkList_Private_GetCount,
- .GetName = (struct PP_Var (*)(PP_Resource resource, uint32_t index))&Pnacl_M31_PPB_NetworkList_Private_GetName,
- .GetType = (PP_NetworkListType_Private (*)(PP_Resource resource, uint32_t index))&Pnacl_M31_PPB_NetworkList_Private_GetType,
- .GetState = (PP_NetworkListState_Private (*)(PP_Resource resource, uint32_t index))&Pnacl_M31_PPB_NetworkList_Private_GetState,
- .GetIpAddresses = (int32_t (*)(PP_Resource resource, uint32_t index, struct PP_ArrayOutput output))&Pnacl_M31_PPB_NetworkList_Private_GetIpAddresses,
- .GetDisplayName = (struct PP_Var (*)(PP_Resource resource, uint32_t index))&Pnacl_M31_PPB_NetworkList_Private_GetDisplayName,
- .GetMTU = (uint32_t (*)(PP_Resource resource, uint32_t index))&Pnacl_M31_PPB_NetworkList_Private_GetMTU
-};
-
-struct PPB_NetworkMonitor_Private_0_3 Pnacl_Wrappers_PPB_NetworkMonitor_Private_0_3 = {
- .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M31_PPB_NetworkMonitor_Private_Create,
- .UpdateNetworkList = (int32_t (*)(PP_Resource network_monitor, PP_Resource* network_list, struct PP_CompletionCallback callback))&Pnacl_M31_PPB_NetworkMonitor_Private_UpdateNetworkList,
- .IsNetworkMonitor = (PP_Bool (*)(PP_Resource resource))&Pnacl_M31_PPB_NetworkMonitor_Private_IsNetworkMonitor
-};
-
struct PPB_OutputProtection_Private_0_1 Pnacl_Wrappers_PPB_OutputProtection_Private_0_1 = {
.Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M31_PPB_OutputProtection_Private_Create,
.IsOutputProtection = (PP_Bool (*)(PP_Resource resource))&Pnacl_M31_PPB_OutputProtection_Private_IsOutputProtection,
@@ -5307,6 +5307,18 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_1_0 = {
.real_iface = NULL
};
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkList_1_0 = {
+ .iface_macro = PPB_NETWORKLIST_INTERFACE_1_0,
+ .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_NetworkList_1_0,
+ .real_iface = NULL
+};
+
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkMonitor_1_0 = {
+ .iface_macro = PPB_NETWORKMONITOR_INTERFACE_1_0,
+ .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_NetworkMonitor_1_0,
+ .real_iface = NULL
+};
+
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkProxy_1_0 = {
.iface_macro = PPB_NETWORKPROXY_INTERFACE_1_0,
.wrapped_iface = (void *) &Pnacl_Wrappers_PPB_NetworkProxy_1_0,
@@ -5637,18 +5649,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_1_1 =
.real_iface = NULL
};
-static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3 = {
- .iface_macro = PPB_NETWORKLIST_PRIVATE_INTERFACE_0_3,
- .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_NetworkList_Private_0_3,
- .real_iface = NULL
-};
-
-static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkMonitor_Private_0_3 = {
- .iface_macro = PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_3,
- .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_NetworkMonitor_Private_0_3,
- .real_iface = NULL
-};
-
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_OutputProtection_Private_0_1 = {
.iface_macro = PPB_OUTPUTPROTECTION_PRIVATE_INTERFACE_0_1,
.wrapped_iface = (void *) &Pnacl_Wrappers_PPB_OutputProtection_Private_0_1,
@@ -5803,6 +5803,8 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_Messaging_1_0,
&Pnacl_WrapperInfo_PPB_MouseLock_1_0,
&Pnacl_WrapperInfo_PPB_NetAddress_1_0,
+ &Pnacl_WrapperInfo_PPB_NetworkList_1_0,
+ &Pnacl_WrapperInfo_PPB_NetworkMonitor_1_0,
&Pnacl_WrapperInfo_PPB_NetworkProxy_1_0,
&Pnacl_WrapperInfo_PPB_TCPSocket_1_0,
&Pnacl_WrapperInfo_PPB_TCPSocket_1_1,
@@ -5856,8 +5858,6 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_NetAddress_Private_0_1,
&Pnacl_WrapperInfo_PPB_NetAddress_Private_1_0,
&Pnacl_WrapperInfo_PPB_NetAddress_Private_1_1,
- &Pnacl_WrapperInfo_PPB_NetworkList_Private_0_3,
- &Pnacl_WrapperInfo_PPB_NetworkMonitor_Private_0_3,
&Pnacl_WrapperInfo_PPB_OutputProtection_Private_0_1,
&Pnacl_WrapperInfo_PPB_PlatformVerification_Private_0_1,
&Pnacl_WrapperInfo_PPB_Talk_Private_1_0,
diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi
index 699f603..7edeb2f 100644
--- a/ppapi/ppapi_shared.gypi
+++ b/ppapi/ppapi_shared.gypi
@@ -208,9 +208,9 @@
'thunk/ppb_net_address_api.h',
'thunk/ppb_net_address_thunk.cc',
'thunk/ppb_network_list_api.h',
- 'thunk/ppb_network_list_private_thunk.cc',
+ 'thunk/ppb_network_list_thunk.cc',
'thunk/ppb_network_monitor_api.h',
- 'thunk/ppb_network_monitor_private_thunk.cc',
+ 'thunk/ppb_network_monitor_thunk.cc',
'thunk/ppb_network_proxy_api.h',
'thunk/ppb_network_proxy_thunk.cc',
'thunk/ppb_pdf_api.h',
@@ -325,8 +325,6 @@
'shared_impl/private/net_address_private_impl.cc',
'thunk/ppb_graphics_3d_thunk.cc',
'thunk/ppb_host_resolver_private_thunk.cc',
- 'thunk/ppb_network_list_private_thunk.cc',
- 'thunk/ppb_network_monitor_private_thunk.cc',
'thunk/ppb_tcp_server_socket_private_thunk.cc',
'thunk/ppb_tcp_socket_private_thunk.cc',
'thunk/ppb_udp_socket_private_thunk.cc',
diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi
index 8149b61..6ec54b7 100644
--- a/ppapi/ppapi_sources.gypi
+++ b/ppapi/ppapi_sources.gypi
@@ -44,7 +44,8 @@
'c/ppb_mouse_cursor.h',
'c/ppb_mouse_lock.h',
'c/ppb_net_address.h',
- 'c/ppb_network_proxy.h',
+ 'c/ppb_network_list.h',
+ 'c/ppb_network_monitor.h',
'c/ppb_network_proxy.h',
'c/ppb_opengles2.h',
'c/ppb_tcp_socket.h',
@@ -118,8 +119,6 @@
'c/private/ppb_platform_verification_private.h',
'c/private/ppb_proxy_private.h',
'c/private/ppp_instance_private.h',
- 'c/private/ppb_network_list_private.h',
- 'c/private/ppb_network_monitor_private.h',
'c/private/ppb_tcp_server_socket_private.h',
'c/private/ppb_tcp_socket_private.h',
'c/private/ppb_udp_socket_private.h',
@@ -194,6 +193,10 @@
'cpp/mouse_lock.h',
'cpp/net_address.cc',
'cpp/net_address.h',
+ 'cpp/network_list.cc',
+ 'cpp/network_list.h',
+ 'cpp/network_monitor.cc',
+ 'cpp/network_monitor.h',
'cpp/network_proxy.cc',
'cpp/network_proxy.h',
'cpp/output_traits.h',
@@ -318,10 +321,6 @@
'cpp/private/instance_private.h',
'cpp/private/net_address_private.cc',
'cpp/private/net_address_private.h',
- 'cpp/private/network_list_private.cc',
- 'cpp/private/network_list_private.h',
- 'cpp/private/network_monitor_private.cc',
- 'cpp/private/network_monitor_private.h',
'cpp/private/pass_file_handle.cc',
'cpp/private/pass_file_handle.h',
'cpp/private/pdf.cc',
@@ -447,8 +446,8 @@
'tests/test_net_address.h',
'tests/test_net_address_private_untrusted.cc',
'tests/test_net_address_private_untrusted.h',
- 'tests/test_network_monitor_private.cc',
- 'tests/test_network_monitor_private.h',
+ 'tests/test_network_monitor.cc',
+ 'tests/test_network_monitor.h',
'tests/test_network_proxy.cc',
'tests/test_network_proxy.h',
'tests/test_paint_aggregator.cc',
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index 0bf361e..9c810a3 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -48,6 +48,8 @@
#include "ppapi/c/ppb_messaging.h"
#include "ppapi/c/ppb_mouse_lock.h"
#include "ppapi/c/ppb_net_address.h"
+#include "ppapi/c/ppb_network_list.h"
+#include "ppapi/c/ppb_network_monitor.h"
#include "ppapi/c/ppb_network_proxy.h"
#include "ppapi/c/ppb_opengles2.h"
#include "ppapi/c/ppb_tcp_socket.h"
@@ -79,8 +81,6 @@
#include "ppapi/c/private/ppb_flash_print.h"
#include "ppapi/c/private/ppb_host_resolver_private.h"
#include "ppapi/c/private/ppb_net_address_private.h"
-#include "ppapi/c/private/ppb_network_list_private.h"
-#include "ppapi/c/private/ppb_network_monitor_private.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppb_platform_verification_private.h"
#include "ppapi/c/private/ppb_talk_private.h"
diff --git a/ppapi/proxy/network_list_resource.cc b/ppapi/proxy/network_list_resource.cc
index 62a342c..466e533 100644
--- a/ppapi/proxy/network_list_resource.cc
+++ b/ppapi/proxy/network_list_resource.cc
@@ -37,15 +37,15 @@ PP_Var NetworkListResource::GetName(uint32_t index) {
return StringVar::StringToPPVar(list_.at(index).name);
}
-PP_NetworkListType_Private NetworkListResource::GetType(uint32_t index) {
+PP_NetworkList_Type NetworkListResource::GetType(uint32_t index) {
if (index >= list_.size())
- return PP_NETWORKLIST_UNKNOWN;
+ return PP_NETWORKLIST_TYPE_UNKNOWN;
return list_.at(index).type;
}
-PP_NetworkListState_Private NetworkListResource::GetState(uint32_t index) {
+PP_NetworkList_State NetworkListResource::GetState(uint32_t index) {
if (index >= list_.size())
- return PP_NETWORKLIST_DOWN;
+ return PP_NETWORKLIST_STATE_DOWN;
return list_.at(index).state;
}
diff --git a/ppapi/proxy/network_list_resource.h b/ppapi/proxy/network_list_resource.h
index 9c078669..36c9877 100644
--- a/ppapi/proxy/network_list_resource.h
+++ b/ppapi/proxy/network_list_resource.h
@@ -33,8 +33,8 @@ class NetworkListResource
// PPB_NetworkList_API implementation.
virtual uint32_t GetCount() OVERRIDE;
virtual PP_Var GetName(uint32_t index) OVERRIDE;
- virtual PP_NetworkListType_Private GetType(uint32_t index) OVERRIDE;
- virtual PP_NetworkListState_Private GetState(uint32_t index) OVERRIDE;
+ virtual PP_NetworkList_Type GetType(uint32_t index) OVERRIDE;
+ virtual PP_NetworkList_State GetState(uint32_t index) OVERRIDE;
virtual int32_t GetIpAddresses(uint32_t index,
const PP_ArrayOutput& output) OVERRIDE;
virtual PP_Var GetDisplayName(uint32_t index) OVERRIDE;
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index 24beb03..0d378dd 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -90,8 +90,8 @@ IPC_ENUM_TRAITS(PP_InputEvent_MouseButton)
IPC_ENUM_TRAITS(PP_InputEvent_Type)
IPC_ENUM_TRAITS_MAX_VALUE(PP_NetAddressFamily_Private,
PP_NETADDRESSFAMILY_PRIVATE_IPV6)
-IPC_ENUM_TRAITS(PP_NetworkListState_Private)
-IPC_ENUM_TRAITS(PP_NetworkListType_Private)
+IPC_ENUM_TRAITS_MAX_VALUE(PP_NetworkList_State, PP_NETWORKLIST_STATE_UP)
+IPC_ENUM_TRAITS_MAX_VALUE(PP_NetworkList_Type, PP_NETWORKLIST_TYPE_CELLULAR)
IPC_ENUM_TRAITS(PP_PrintOrientation_Dev)
IPC_ENUM_TRAITS(PP_PrintOutputFormat_Dev)
IPC_ENUM_TRAITS(PP_PrintScalingOption_Dev)
diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc
index ea01f6e..d1b99ec 100644
--- a/ppapi/proxy/resource_creation_proxy.cc
+++ b/ppapi/proxy/resource_creation_proxy.cc
@@ -307,7 +307,7 @@ PP_Resource ResourceCreationProxy::CreateNetAddressFromNetAddressPrivate(
private_addr))->GetReference();
}
-PP_Resource ResourceCreationProxy::CreateNetworkMonitorPrivate(
+PP_Resource ResourceCreationProxy::CreateNetworkMonitor(
PP_Instance instance) {
return (new NetworkMonitorResource(GetConnection(), instance))->
GetReference();
diff --git a/ppapi/proxy/resource_creation_proxy.h b/ppapi/proxy/resource_creation_proxy.h
index 509b155..1507dc8 100644
--- a/ppapi/proxy/resource_creation_proxy.h
+++ b/ppapi/proxy/resource_creation_proxy.h
@@ -133,8 +133,7 @@ class ResourceCreationProxy : public InterfaceProxy,
virtual PP_Resource CreateNetAddressFromNetAddressPrivate(
PP_Instance instance,
const PP_NetAddress_Private& private_addr) OVERRIDE;
- virtual PP_Resource CreateNetworkMonitorPrivate(
- PP_Instance instance) OVERRIDE;
+ virtual PP_Resource CreateNetworkMonitor(PP_Instance instance) OVERRIDE;
virtual PP_Resource CreatePrinting(PP_Instance) OVERRIDE;
virtual PP_Resource CreateTCPServerSocketPrivate(
PP_Instance instance) OVERRIDE;
diff --git a/ppapi/proxy/serialized_structs.cc b/ppapi/proxy/serialized_structs.cc
index d645dd8..255865a 100644
--- a/ppapi/proxy/serialized_structs.cc
+++ b/ppapi/proxy/serialized_structs.cc
@@ -81,8 +81,8 @@ void SerializedFontDescription::SetToPPBrowserFontDescription(
}
SerializedNetworkInfo::SerializedNetworkInfo()
- : type(PP_NETWORKLIST_UNKNOWN),
- state(PP_NETWORKLIST_DOWN),
+ : type(PP_NETWORKLIST_TYPE_UNKNOWN),
+ state(PP_NETWORKLIST_STATE_DOWN),
mtu(0) {
}
diff --git a/ppapi/proxy/serialized_structs.h b/ppapi/proxy/serialized_structs.h
index 74525f3..fb93dd1 100644
--- a/ppapi/proxy/serialized_structs.h
+++ b/ppapi/proxy/serialized_structs.h
@@ -16,8 +16,8 @@
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_point.h"
#include "ppapi/c/pp_rect.h"
+#include "ppapi/c/ppb_network_list.h"
#include "ppapi/c/private/ppb_net_address_private.h"
-#include "ppapi/c/private/ppb_network_list_private.h"
#include "ppapi/proxy/ppapi_proxy_export.h"
#include "ppapi/shared_impl/host_resource.h"
@@ -64,8 +64,8 @@ struct PPAPI_PROXY_EXPORT SerializedNetworkInfo {
~SerializedNetworkInfo();
std::string name;
- PP_NetworkListType_Private type;
- PP_NetworkListState_Private state;
+ PP_NetworkList_Type type;
+ PP_NetworkList_State state;
std::vector<PP_NetAddress_Private> addresses;
std::string display_name;
int mtu;
diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h
index 4f8a77f..f6e3de0 100644
--- a/ppapi/tests/all_c_includes.h
+++ b/ppapi/tests/all_c_includes.h
@@ -83,6 +83,8 @@
#include "ppapi/c/ppb_messaging.h"
#include "ppapi/c/ppb_mouse_lock.h"
#include "ppapi/c/ppb_net_address.h"
+#include "ppapi/c/ppb_network_list.h"
+#include "ppapi/c/ppb_network_monitor.h"
#include "ppapi/c/ppb_network_proxy.h"
#include "ppapi/c/ppb_opengles2.h"
#include "ppapi/c/ppb_tcp_socket.h"
@@ -115,8 +117,6 @@
#include "ppapi/c/private/ppb_instance_private.h"
#include "ppapi/c/private/ppb_nacl_private.h"
#include "ppapi/c/private/ppb_net_address_private.h"
-#include "ppapi/c/private/ppb_network_list_private.h"
-#include "ppapi/c/private/ppb_network_monitor_private.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppb_platform_verification_private.h"
#include "ppapi/c/private/ppb_proxy_private.h"
diff --git a/ppapi/tests/test_network_monitor_private.cc b/ppapi/tests/test_network_monitor.cc
index 382cbe0..53b6bb2 100644
--- a/ppapi/tests/test_network_monitor_private.cc
+++ b/ppapi/tests/test_network_monitor.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ppapi/tests/test_network_monitor_private.h"
+#include "ppapi/tests/test_network_monitor.h"
#include <string.h>
@@ -10,19 +10,19 @@
#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/net_address.h"
-#include "ppapi/cpp/private/network_list_private.h"
-#include "ppapi/cpp/private/network_monitor_private.h"
-#include "ppapi/tests/testing_instance.h"
+#include "ppapi/cpp/network_list.h"
+#include "ppapi/cpp/network_monitor.h"
#include "ppapi/tests/test_utils.h"
+#include "ppapi/tests/testing_instance.h"
-REGISTER_TEST_CASE(NetworkMonitorPrivate);
+REGISTER_TEST_CASE(NetworkMonitor);
namespace {
class MonitorDeletionCallbackDelegate
: public TestCompletionCallback::Delegate {
public:
- explicit MonitorDeletionCallbackDelegate(pp::NetworkMonitorPrivate* monitor)
+ explicit MonitorDeletionCallbackDelegate(pp::NetworkMonitor* monitor)
: monitor_(monitor) {
}
@@ -32,30 +32,30 @@ class MonitorDeletionCallbackDelegate
}
private:
- pp::NetworkMonitorPrivate* monitor_;
+ pp::NetworkMonitor* monitor_;
};
} // namespace
-TestNetworkMonitorPrivate::TestNetworkMonitorPrivate(TestingInstance* instance)
+TestNetworkMonitor::TestNetworkMonitor(TestingInstance* instance)
: TestCase(instance) {
}
-bool TestNetworkMonitorPrivate::Init() {
- if (!pp::NetworkMonitorPrivate::IsAvailable())
+bool TestNetworkMonitor::Init() {
+ if (!pp::NetworkMonitor::IsAvailable())
return false;
return CheckTestingInterface();
}
-void TestNetworkMonitorPrivate::RunTests(const std::string& filter) {
+void TestNetworkMonitor::RunTests(const std::string& filter) {
RUN_TEST_FORCEASYNC_AND_NOT(Basic, filter);
RUN_TEST_FORCEASYNC_AND_NOT(2Monitors, filter);
RUN_TEST_FORCEASYNC_AND_NOT(DeleteInCallback, filter);
}
-std::string TestNetworkMonitorPrivate::VerifyNetworkList(
- const pp::NetworkListPrivate& network_list) {
+std::string TestNetworkMonitor::VerifyNetworkList(
+ const pp::NetworkList& network_list) {
// Verify that there is at least one network interface.
size_t count = network_list.GetCount();
ASSERT_TRUE(count >= 1U);
@@ -118,22 +118,22 @@ std::string TestNetworkMonitorPrivate::VerifyNetworkList(
ASSERT_FALSE(network_list.GetName(iface).empty());
ASSERT_FALSE(network_list.GetDisplayName(iface).empty());
- PP_NetworkListType_Private type = network_list.GetType(iface);
- ASSERT_TRUE(type >= PP_NETWORKLIST_UNKNOWN);
- ASSERT_TRUE(type <= PP_NETWORKLIST_CELLULAR);
+ PP_NetworkList_Type type = network_list.GetType(iface);
+ ASSERT_TRUE(type >= PP_NETWORKLIST_TYPE_UNKNOWN);
+ ASSERT_TRUE(type <= PP_NETWORKLIST_TYPE_CELLULAR);
- PP_NetworkListState_Private state = network_list.GetState(iface);
- ASSERT_TRUE(state >= PP_NETWORKLIST_DOWN);
- ASSERT_TRUE(state <= PP_NETWORKLIST_UP);
+ PP_NetworkList_State state = network_list.GetState(iface);
+ ASSERT_TRUE(state >= PP_NETWORKLIST_STATE_DOWN);
+ ASSERT_TRUE(state <= PP_NETWORKLIST_STATE_UP);
}
PASS();
}
-std::string TestNetworkMonitorPrivate::TestBasic() {
- TestCompletionCallbackWithOutput<pp::NetworkListPrivate> test_callback(
+std::string TestNetworkMonitor::TestBasic() {
+ TestCompletionCallbackWithOutput<pp::NetworkList> test_callback(
instance_->pp_instance());
- pp::NetworkMonitorPrivate network_monitor(instance_);
+ pp::NetworkMonitor network_monitor(instance_);
test_callback.WaitForResult(
network_monitor.UpdateNetworkList(test_callback.GetCallback()));
@@ -143,19 +143,19 @@ std::string TestNetworkMonitorPrivate::TestBasic() {
PASS();
}
-std::string TestNetworkMonitorPrivate::Test2Monitors() {
- TestCompletionCallbackWithOutput<pp::NetworkListPrivate> test_callback(
+std::string TestNetworkMonitor::Test2Monitors() {
+ TestCompletionCallbackWithOutput<pp::NetworkList> test_callback(
instance_->pp_instance());
- pp::NetworkMonitorPrivate network_monitor(instance_);
+ pp::NetworkMonitor network_monitor(instance_);
test_callback.WaitForResult(
network_monitor.UpdateNetworkList(test_callback.GetCallback()));
ASSERT_EQ(test_callback.result(), PP_OK);
ASSERT_SUBTEST_SUCCESS(VerifyNetworkList(test_callback.output()));
- TestCompletionCallbackWithOutput<pp::NetworkListPrivate> test_callback_2(
+ TestCompletionCallbackWithOutput<pp::NetworkList> test_callback_2(
instance_->pp_instance());
- pp::NetworkMonitorPrivate network_monitor_2(instance_);
+ pp::NetworkMonitor network_monitor_2(instance_);
test_callback_2.WaitForResult(
network_monitor_2.UpdateNetworkList(test_callback_2.GetCallback()));
@@ -165,11 +165,11 @@ std::string TestNetworkMonitorPrivate::Test2Monitors() {
PASS();
}
-std::string TestNetworkMonitorPrivate::TestDeleteInCallback() {
- pp::NetworkMonitorPrivate* network_monitor =
- new pp::NetworkMonitorPrivate(instance_);
+std::string TestNetworkMonitor::TestDeleteInCallback() {
+ pp::NetworkMonitor* network_monitor =
+ new pp::NetworkMonitor(instance_);
MonitorDeletionCallbackDelegate deletion_delegate(network_monitor);
- TestCompletionCallbackWithOutput<pp::NetworkListPrivate> test_callback(
+ TestCompletionCallbackWithOutput<pp::NetworkList> test_callback(
instance_->pp_instance());
test_callback.SetDelegate(&deletion_delegate);
test_callback.WaitForResult(
diff --git a/ppapi/tests/test_network_monitor_private.h b/ppapi/tests/test_network_monitor.h
index de5c115..13745c87 100644
--- a/ppapi/tests/test_network_monitor_private.h
+++ b/ppapi/tests/test_network_monitor.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef PAPPI_TESTS_TEST_NETWORK_MONITOR_PRIVATE_H_
-#define PAPPI_TESTS_TEST_NETWORK_MONITOR_PRIVATE_H_
+#ifndef PAPPI_TESTS_TEST_NETWORK_MONITOR_H_
+#define PAPPI_TESTS_TEST_NETWORK_MONITOR_H_
#include <string>
@@ -11,12 +11,12 @@
#include "ppapi/tests/test_case.h"
namespace pp {
-class NetworkListPrivate;
+class NetworkList;
} // namespace pp
-class TestNetworkMonitorPrivate : public TestCase {
+class TestNetworkMonitor : public TestCase {
public:
- explicit TestNetworkMonitorPrivate(TestingInstance* instance);
+ explicit TestNetworkMonitor(TestingInstance* instance);
// TestCase implementation.
virtual bool Init();
@@ -28,8 +28,8 @@ class TestNetworkMonitorPrivate : public TestCase {
std::string TestDeleteInCallback();
std::string VerifyNetworkListResource(PP_Resource network_resource);
- std::string VerifyNetworkList(const pp::NetworkListPrivate& network_list);
+ std::string VerifyNetworkList(const pp::NetworkList& network_list);
};
-#endif // PAPPI_TESTS_TEST_NETWORK_MONITOR_PRIVATE_H_
+#endif // PAPPI_TESTS_TEST_NETWORK_MONITOR_H_
diff --git a/ppapi/thunk/interfaces_ppb_private_no_permissions.h b/ppapi/thunk/interfaces_ppb_private_no_permissions.h
index de1faad..15e8043 100644
--- a/ppapi/thunk/interfaces_ppb_private_no_permissions.h
+++ b/ppapi/thunk/interfaces_ppb_private_no_permissions.h
@@ -35,10 +35,6 @@ PROXIED_IFACE(NoAPIName, PPB_NETADDRESS_PRIVATE_INTERFACE_1_0,
PPB_NetAddress_Private_1_0)
PROXIED_IFACE(NoAPIName, PPB_NETADDRESS_PRIVATE_INTERFACE_1_1,
PPB_NetAddress_Private_1_1)
-PROXIED_IFACE(NoAPIName, PPB_NETWORKLIST_PRIVATE_INTERFACE_0_3,
- PPB_NetworkList_Private_0_3)
-PROXIED_IFACE(NoAPIName, PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_3,
- PPB_NetworkMonitor_Private_0_3)
PROXIED_IFACE(NoAPIName, PPB_EXT_CRXFILESYSTEM_PRIVATE_INTERFACE_0_1,
PPB_Ext_CrxFileSystem_Private_0_1)
diff --git a/ppapi/thunk/interfaces_ppb_public_stable.h b/ppapi/thunk/interfaces_ppb_public_stable.h
index 7327cde..91e023a 100644
--- a/ppapi/thunk/interfaces_ppb_public_stable.h
+++ b/ppapi/thunk/interfaces_ppb_public_stable.h
@@ -76,6 +76,9 @@ PROXIED_IFACE(PPB_Instance, PPB_MESSAGING_INTERFACE_1_0, PPB_Messaging_1_0)
PROXIED_IFACE(PPB_Instance, PPB_MOUSECURSOR_INTERFACE_1_0, PPB_MouseCursor_1_0)
PROXIED_IFACE(PPB_Instance, PPB_MOUSELOCK_INTERFACE_1_0, PPB_MouseLock_1_0)
PROXIED_IFACE(NoAPIName, PPB_NETADDRESS_INTERFACE_1_0, PPB_NetAddress_1_0)
+PROXIED_IFACE(NoAPIName, PPB_NETWORKLIST_INTERFACE_1_0, PPB_NetworkList_1_0)
+PROXIED_IFACE(NoAPIName, PPB_NETWORKMONITOR_INTERFACE_1_0,
+ PPB_NetworkMonitor_1_0)
PROXIED_IFACE(NoAPIName, PPB_NETWORKPROXY_INTERFACE_1_0, PPB_NetworkProxy_1_0)
PROXIED_IFACE(NoAPIName, PPB_TCPSOCKET_INTERFACE_1_0, PPB_TCPSocket_1_0)
PROXIED_IFACE(NoAPIName, PPB_TCPSOCKET_INTERFACE_1_1, PPB_TCPSocket_1_1)
diff --git a/ppapi/thunk/ppb_network_list_api.h b/ppapi/thunk/ppb_network_list_api.h
index 661399a..df27a20 100644
--- a/ppapi/thunk/ppb_network_list_api.h
+++ b/ppapi/thunk/ppb_network_list_api.h
@@ -7,7 +7,7 @@
#include <vector>
-#include "ppapi/c/private/ppb_network_list_private.h"
+#include "ppapi/c/ppb_network_list.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
namespace ppapi {
@@ -20,8 +20,8 @@ class PPAPI_THUNK_EXPORT PPB_NetworkList_API {
// Private API
virtual uint32_t GetCount() = 0;
virtual PP_Var GetName(uint32_t index) = 0;
- virtual PP_NetworkListType_Private GetType(uint32_t index) = 0;
- virtual PP_NetworkListState_Private GetState(uint32_t index) = 0;
+ virtual PP_NetworkList_Type GetType(uint32_t index) = 0;
+ virtual PP_NetworkList_State GetState(uint32_t index) = 0;
virtual int32_t GetIpAddresses(uint32_t index,
const PP_ArrayOutput& output) = 0;
virtual PP_Var GetDisplayName(uint32_t index) = 0;
diff --git a/ppapi/thunk/ppb_network_list_private_thunk.cc b/ppapi/thunk/ppb_network_list_thunk.cc
index 1a372b3..393a752 100644
--- a/ppapi/thunk/ppb_network_list_private_thunk.cc
+++ b/ppapi/thunk/ppb_network_list_thunk.cc
@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// From private/ppb_network_list_private.idl,
-// modified Fri Aug 30 12:04:19 2013.
+// From ppb_network_list.idl modified Mon Sep 9 11:18:02 2013.
#include "ppapi/c/pp_errors.h"
-#include "ppapi/c/private/ppb_network_list_private.h"
+#include "ppapi/c/ppb_network_list.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_instance_api.h"
@@ -20,13 +19,13 @@ namespace thunk {
namespace {
PP_Bool IsNetworkList(PP_Resource resource) {
- VLOG(4) << "PPB_NetworkList_Private::IsNetworkList()";
+ VLOG(4) << "PPB_NetworkList::IsNetworkList()";
EnterResource<PPB_NetworkList_API> enter(resource, false);
return PP_FromBool(enter.succeeded());
}
uint32_t GetCount(PP_Resource resource) {
- VLOG(4) << "PPB_NetworkList_Private::GetCount()";
+ VLOG(4) << "PPB_NetworkList::GetCount()";
EnterResource<PPB_NetworkList_API> enter(resource, true);
if (enter.failed())
return 0;
@@ -34,33 +33,33 @@ uint32_t GetCount(PP_Resource resource) {
}
struct PP_Var GetName(PP_Resource resource, uint32_t index) {
- VLOG(4) << "PPB_NetworkList_Private::GetName()";
+ VLOG(4) << "PPB_NetworkList::GetName()";
EnterResource<PPB_NetworkList_API> enter(resource, true);
if (enter.failed())
return PP_MakeUndefined();
return enter.object()->GetName(index);
}
-PP_NetworkListType_Private GetType(PP_Resource resource, uint32_t index) {
- VLOG(4) << "PPB_NetworkList_Private::GetType()";
+PP_NetworkList_Type GetType(PP_Resource resource, uint32_t index) {
+ VLOG(4) << "PPB_NetworkList::GetType()";
EnterResource<PPB_NetworkList_API> enter(resource, true);
if (enter.failed())
- return PP_NETWORKLIST_UNKNOWN;
+ return PP_NETWORKLIST_TYPE_UNKNOWN;
return enter.object()->GetType(index);
}
-PP_NetworkListState_Private GetState(PP_Resource resource, uint32_t index) {
- VLOG(4) << "PPB_NetworkList_Private::GetState()";
+PP_NetworkList_State GetState(PP_Resource resource, uint32_t index) {
+ VLOG(4) << "PPB_NetworkList::GetState()";
EnterResource<PPB_NetworkList_API> enter(resource, true);
if (enter.failed())
- return PP_NETWORKLIST_DOWN;
+ return PP_NETWORKLIST_STATE_DOWN;
return enter.object()->GetState(index);
}
int32_t GetIpAddresses(PP_Resource resource,
uint32_t index,
struct PP_ArrayOutput output) {
- VLOG(4) << "PPB_NetworkList_Private::GetIpAddresses()";
+ VLOG(4) << "PPB_NetworkList::GetIpAddresses()";
EnterResource<PPB_NetworkList_API> enter(resource, true);
if (enter.failed())
return enter.retval();
@@ -68,7 +67,7 @@ int32_t GetIpAddresses(PP_Resource resource,
}
struct PP_Var GetDisplayName(PP_Resource resource, uint32_t index) {
- VLOG(4) << "PPB_NetworkList_Private::GetDisplayName()";
+ VLOG(4) << "PPB_NetworkList::GetDisplayName()";
EnterResource<PPB_NetworkList_API> enter(resource, true);
if (enter.failed())
return PP_MakeUndefined();
@@ -76,14 +75,14 @@ struct PP_Var GetDisplayName(PP_Resource resource, uint32_t index) {
}
uint32_t GetMTU(PP_Resource resource, uint32_t index) {
- VLOG(4) << "PPB_NetworkList_Private::GetMTU()";
+ VLOG(4) << "PPB_NetworkList::GetMTU()";
EnterResource<PPB_NetworkList_API> enter(resource, true);
if (enter.failed())
return 0;
return enter.object()->GetMTU(index);
}
-const PPB_NetworkList_Private_0_3 g_ppb_networklist_private_thunk_0_3 = {
+const PPB_NetworkList_1_0 g_ppb_networklist_thunk_1_0 = {
&IsNetworkList,
&GetCount,
&GetName,
@@ -96,8 +95,8 @@ const PPB_NetworkList_Private_0_3 g_ppb_networklist_private_thunk_0_3 = {
} // namespace
-const PPB_NetworkList_Private_0_3* GetPPB_NetworkList_Private_0_3_Thunk() {
- return &g_ppb_networklist_private_thunk_0_3;
+const PPB_NetworkList_1_0* GetPPB_NetworkList_1_0_Thunk() {
+ return &g_ppb_networklist_thunk_1_0;
}
} // namespace thunk
diff --git a/ppapi/thunk/ppb_network_monitor_api.h b/ppapi/thunk/ppb_network_monitor_api.h
index 49aa90d..c787324 100644
--- a/ppapi/thunk/ppb_network_monitor_api.h
+++ b/ppapi/thunk/ppb_network_monitor_api.h
@@ -5,7 +5,7 @@
#ifndef PPAPI_THUNK_PPB_NETWORK_MONITOR_API_H_
#define PPAPI_THUNK_PPB_NETWORK_MONITOR_API_H_
-#include "ppapi/c/private/ppb_network_monitor_private.h"
+#include "ppapi/c/ppb_network_monitor.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
namespace ppapi {
diff --git a/ppapi/thunk/ppb_network_monitor_private_thunk.cc b/ppapi/thunk/ppb_network_monitor_thunk.cc
index b467af6..089d783 100644
--- a/ppapi/thunk/ppb_network_monitor_private_thunk.cc
+++ b/ppapi/thunk/ppb_network_monitor_thunk.cc
@@ -2,12 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// From private/ppb_network_monitor_private.idl,
-// modified Wed Sep 4 14:16:07 2013.
+// From ppb_network_monitor.idl modified Thu Sep 5 12:10:00 2013.
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
-#include "ppapi/c/private/ppb_network_monitor_private.h"
+#include "ppapi/c/ppb_network_monitor.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_instance_api.h"
@@ -21,17 +20,17 @@ namespace thunk {
namespace {
PP_Resource Create(PP_Instance instance) {
- VLOG(4) << "PPB_NetworkMonitor_Private::Create()";
+ VLOG(4) << "PPB_NetworkMonitor::Create()";
EnterResourceCreation enter(instance);
if (enter.failed())
return 0;
- return enter.functions()->CreateNetworkMonitorPrivate(instance);
+ return enter.functions()->CreateNetworkMonitor(instance);
}
int32_t UpdateNetworkList(PP_Resource network_monitor,
PP_Resource* network_list,
struct PP_CompletionCallback callback) {
- VLOG(4) << "PPB_NetworkMonitor_Private::UpdateNetworkList()";
+ VLOG(4) << "PPB_NetworkMonitor::UpdateNetworkList()";
EnterResource<PPB_NetworkMonitor_API> enter(network_monitor, callback, true);
if (enter.failed())
return enter.retval();
@@ -40,12 +39,12 @@ int32_t UpdateNetworkList(PP_Resource network_monitor,
}
PP_Bool IsNetworkMonitor(PP_Resource resource) {
- VLOG(4) << "PPB_NetworkMonitor_Private::IsNetworkMonitor()";
+ VLOG(4) << "PPB_NetworkMonitor::IsNetworkMonitor()";
EnterResource<PPB_NetworkMonitor_API> enter(resource, false);
return PP_FromBool(enter.succeeded());
}
-const PPB_NetworkMonitor_Private_0_3 g_ppb_networkmonitor_private_thunk_0_3 = {
+const PPB_NetworkMonitor_1_0 g_ppb_networkmonitor_thunk_1_0 = {
&Create,
&UpdateNetworkList,
&IsNetworkMonitor
@@ -53,9 +52,8 @@ const PPB_NetworkMonitor_Private_0_3 g_ppb_networkmonitor_private_thunk_0_3 = {
} // namespace
-const PPB_NetworkMonitor_Private_0_3*
- GetPPB_NetworkMonitor_Private_0_3_Thunk() {
- return &g_ppb_networkmonitor_private_thunk_0_3;
+const PPB_NetworkMonitor_1_0* GetPPB_NetworkMonitor_1_0_Thunk() {
+ return &g_ppb_networkmonitor_thunk_1_0;
}
} // namespace thunk
diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h
index 16f3d6b..aa731cf 100644
--- a/ppapi/thunk/resource_creation_api.h
+++ b/ppapi/thunk/resource_creation_api.h
@@ -5,7 +5,9 @@
#ifndef PPAPI_THUNK_RESOURCE_CREATION_API_H_
#define PPAPI_THUNK_RESOURCE_CREATION_API_H_
+#include "ppapi/c/dev/pp_video_dev.h"
#include "ppapi/c/dev/ppb_file_chooser_dev.h"
+#include "ppapi/c/dev/ppb_truetype_font_dev.h"
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_resource.h"
@@ -15,11 +17,9 @@
#include "ppapi/c/ppb_graphics_3d.h"
#include "ppapi/c/ppb_image_data.h"
#include "ppapi/c/ppb_input_event.h"
+#include "ppapi/c/ppb_network_monitor.h"
#include "ppapi/c/ppb_websocket.h"
-#include "ppapi/c/dev/pp_video_dev.h"
-#include "ppapi/c/dev/ppb_truetype_font_dev.h"
#include "ppapi/c/private/pp_private_font_charset.h"
-#include "ppapi/c/private/ppb_network_monitor_private.h"
#include "ppapi/shared_impl/api_id.h"
#include "ppapi/shared_impl/ppb_image_data_shared.h"
@@ -145,7 +145,7 @@ class ResourceCreationAPI {
virtual PP_Resource CreateNetAddressFromNetAddressPrivate(
PP_Instance instance,
const PP_NetAddress_Private& private_addr) = 0;
- virtual PP_Resource CreateNetworkMonitorPrivate(PP_Instance instance) = 0;
+ virtual PP_Resource CreateNetworkMonitor(PP_Instance instance) = 0;
virtual PP_Resource CreatePrinting(PP_Instance instance) = 0;
virtual PP_Resource CreateTCPServerSocketPrivate(PP_Instance instance) = 0;
virtual PP_Resource CreateTCPSocket1_0(PP_Instance instace) = 0;