Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2677)

Unified Diff: ppapi/proxy/net_address_resource.h

Issue 16331007: Introduce PPB_NetAddress_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/net_address_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/net_address_resource.h
diff --git a/ppapi/proxy/net_address_resource.h b/ppapi/proxy/net_address_resource.h
new file mode 100644
index 0000000000000000000000000000000000000000..f70723a2e5dcd48956039f6a4cdbc354f87da87b
--- /dev/null
+++ b/ppapi/proxy/net_address_resource.h
@@ -0,0 +1,56 @@
+// 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_NET_ADDRESS_RESOURCE_H_
+#define PPAPI_PROXY_NET_ADDRESS_RESOURCE_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "ppapi/c/private/ppb_net_address_private.h"
+#include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/proxy/ppapi_proxy_export.h"
+#include "ppapi/thunk/ppb_net_address_api.h"
+
+namespace ppapi {
+namespace proxy {
+
+class PPAPI_PROXY_EXPORT NetAddressResource : public PluginResource,
+ public thunk::PPB_NetAddress_API {
+ public:
+ NetAddressResource(Connection connection,
+ PP_Instance instance,
+ const PP_NetAddress_IPv4_Dev& ipv4_addr);
+ NetAddressResource(Connection connection,
+ PP_Instance instance,
+ const PP_NetAddress_IPv6_Dev& ipv6_addr);
+ NetAddressResource(Connection connection,
+ PP_Instance instance,
+ const PP_NetAddress_Private& private_addr);
+
+ virtual ~NetAddressResource();
+
+ // PluginResource implementation.
+ virtual thunk::PPB_NetAddress_API* AsPPB_NetAddress_API() OVERRIDE;
+
+ // PPB_NetAddress_API implementation.
+ virtual PP_NetAddress_Family_Dev GetFamily() OVERRIDE;
+ virtual PP_Var DescribeAsString(PP_Bool include_port) OVERRIDE;
+ virtual PP_Bool DescribeAsIPv4Address(
+ PP_NetAddress_IPv4_Dev* ipv4_addr) OVERRIDE;
+ virtual PP_Bool DescribeAsIPv6Address(
+ PP_NetAddress_IPv6_Dev* ipv6_addr) OVERRIDE;
+ virtual const PP_NetAddress_Private& GetNetAddressPrivate() OVERRIDE;
+
+ private:
+ // TODO(yzshen): Refactor the code so that PPB_NetAddress_Dev resource doesn't
+ // use PP_NetAddress_Private as storage type.
+ PP_NetAddress_Private address_;
+
+ DISALLOW_COPY_AND_ASSIGN(NetAddressResource);
+};
+
+} // namespace proxy
+} // namespace ppapi
+
+#endif // PPAPI_PROXY_NET_ADDRESS_RESOURCE_H_
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/net_address_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698