summaryrefslogtreecommitdiffstats
path: root/ppapi/shared_impl/socket_option_data.h
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-19 13:30:59 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-19 13:30:59 +0000
commit64a61fc8d5bf853de197097955092a2ec4e6b788 (patch)
treeb47e3fe8f5bf6cc0c8b2e129cde2a42939a1b449 /ppapi/shared_impl/socket_option_data.h
parent130bd3874718803d3ed55a5c09138a38de692f92 (diff)
downloadchromium_src-64a61fc8d5bf853de197097955092a2ec4e6b788.zip
chromium_src-64a61fc8d5bf853de197097955092a2ec4e6b788.tar.gz
chromium_src-64a61fc8d5bf853de197097955092a2ec4e6b788.tar.bz2
Implement PPB_UDPSocket_Dev: part 2
This CL: - adds apps permission check; - supports UDP socket options tht PPB_UDPSocket_Private doesn' support; - map net::Error to PP_Error. BUG=247225 TEST=None TBR=brettw@chromium.org (TBR Brett for renaming two files in content/content_browser.gypi) Review URL: https://chromiumcodereview.appspot.com/16959005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/shared_impl/socket_option_data.h')
-rw-r--r--ppapi/shared_impl/socket_option_data.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/ppapi/shared_impl/socket_option_data.h b/ppapi/shared_impl/socket_option_data.h
new file mode 100644
index 0000000..ec754a9
--- /dev/null
+++ b/ppapi/shared_impl/socket_option_data.h
@@ -0,0 +1,39 @@
+// 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.
+
+#ifndef PPAPI_SHARED_IMPL_SOCKET_OPTION_DATA_H_
+#define PPAPI_SHARED_IMPL_SOCKET_OPTION_DATA_H_
+
+#include "ppapi/c/pp_stdint.h"
+#include "ppapi/shared_impl/ppapi_shared_export.h"
+
+namespace ppapi {
+
+class PPAPI_SHARED_EXPORT SocketOptionData {
+ public:
+ enum Type {
+ TYPE_INVALID = 0,
+ TYPE_BOOL = 1,
+ TYPE_INT32 = 2
+ };
+
+ SocketOptionData();
+ ~SocketOptionData();
+
+ Type GetType() const;
+
+ bool GetBool(bool* out_value) const;
+ bool GetInt32(int32_t* out_value) const;
+
+ void SetBool(bool value);
+ void SetInt32(int32_t value);
+
+ private:
+ Type type_;
+ int32_t value_;
+};
+
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_SOCKET_OPTION_DATA_H_