1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ppapi/shared_impl/socket_option_data.h"
9 SocketOptionData::SocketOptionData() : type_(TYPE_INVALID
), value_(0) {
12 SocketOptionData::~SocketOptionData() {
15 SocketOptionData::Type
SocketOptionData::GetType() const {
19 bool SocketOptionData::GetBool(bool* out_value
) const {
20 if (!out_value
|| type_
!= TYPE_BOOL
)
22 *out_value
= value_
!= 0;
26 bool SocketOptionData::GetInt32(int32_t* out_value
) const {
27 if (!out_value
|| type_
!= TYPE_INT32
)
33 void SocketOptionData::SetBool(bool value
) {
35 value_
= value
? 1 : 0;
38 void SocketOptionData::SetInt32(int32_t value
) {