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

Side by Side Diff: ppapi/shared_impl/socket_option_data.cc

Issue 174213003: PPAPI: Use clang-format on ppapi/shared_impl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: remove DEPS Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « ppapi/shared_impl/socket_option_data.h ('k') | ppapi/shared_impl/test_globals.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/shared_impl/socket_option_data.h" 5 #include "ppapi/shared_impl/socket_option_data.h"
6 6
7 namespace ppapi { 7 namespace ppapi {
8 8
9 SocketOptionData::SocketOptionData() : type_(TYPE_INVALID), value_(0) { 9 SocketOptionData::SocketOptionData() : type_(TYPE_INVALID), value_(0) {}
10 }
11 10
12 SocketOptionData::~SocketOptionData() { 11 SocketOptionData::~SocketOptionData() {}
13 }
14 12
15 SocketOptionData::Type SocketOptionData::GetType() const { 13 SocketOptionData::Type SocketOptionData::GetType() const { return type_; }
16 return type_;
17 }
18 14
19 bool SocketOptionData::GetBool(bool* out_value) const { 15 bool SocketOptionData::GetBool(bool* out_value) const {
20 if (!out_value || type_ != TYPE_BOOL) 16 if (!out_value || type_ != TYPE_BOOL)
21 return false; 17 return false;
22 *out_value = value_ != 0; 18 *out_value = value_ != 0;
23 return true; 19 return true;
24 } 20 }
25 21
26 bool SocketOptionData::GetInt32(int32_t* out_value) const { 22 bool SocketOptionData::GetInt32(int32_t* out_value) const {
27 if (!out_value || type_ != TYPE_INT32) 23 if (!out_value || type_ != TYPE_INT32)
28 return false; 24 return false;
29 *out_value = value_; 25 *out_value = value_;
30 return true; 26 return true;
31 } 27 }
32 28
33 void SocketOptionData::SetBool(bool value) { 29 void SocketOptionData::SetBool(bool value) {
34 type_ = TYPE_BOOL; 30 type_ = TYPE_BOOL;
35 value_ = value ? 1 : 0; 31 value_ = value ? 1 : 0;
36 } 32 }
37 33
38 void SocketOptionData::SetInt32(int32_t value) { 34 void SocketOptionData::SetInt32(int32_t value) {
39 type_ = TYPE_INT32; 35 type_ = TYPE_INT32;
40 value_ = value; 36 value_ = value;
41 } 37 }
42 38
43 } // namespace ppapi 39 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/socket_option_data.h ('k') | ppapi/shared_impl/test_globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698