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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/pepper_interface.cc

Issue 303223007: [NaCl SDK] nacl_io: Run clang-format over nacl_io sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "nacl_io/pepper_interface.h" 5 #include "nacl_io/pepper_interface.h"
6 #include <errno.h> 6 #include <errno.h>
7 #include <ppapi/c/pp_errors.h> 7 #include <ppapi/c/pp_errors.h>
8 8
9 namespace nacl_io { 9 namespace nacl_io {
10 10
11 void PepperInterface::AddRefResource(PP_Resource resource) { 11 void PepperInterface::AddRefResource(PP_Resource resource) {
12 GetCoreInterface()->AddRefResource(resource); 12 GetCoreInterface()->AddRefResource(resource);
13 } 13 }
14 14
15 void PepperInterface::ReleaseResource(PP_Resource resource) { 15 void PepperInterface::ReleaseResource(PP_Resource resource) {
16 GetCoreInterface()->ReleaseResource(resource); 16 GetCoreInterface()->ReleaseResource(resource);
17 } 17 }
18 18
19 ScopedResource::ScopedResource(PepperInterface* ppapi) 19 ScopedResource::ScopedResource(PepperInterface* ppapi)
20 : ppapi_(ppapi), resource_(0) {} 20 : ppapi_(ppapi), resource_(0) {
21 }
21 22
22 ScopedResource::ScopedResource(PepperInterface* ppapi, PP_Resource resource) 23 ScopedResource::ScopedResource(PepperInterface* ppapi, PP_Resource resource)
23 : ppapi_(ppapi), resource_(resource) {} 24 : ppapi_(ppapi), resource_(resource) {
25 }
24 26
25 ScopedResource::~ScopedResource() { 27 ScopedResource::~ScopedResource() {
26 if (resource_) 28 if (resource_)
27 ppapi_->ReleaseResource(resource_); 29 ppapi_->ReleaseResource(resource_);
28 } 30 }
29 31
30 void ScopedResource::Reset(PP_Resource resource) { 32 void ScopedResource::Reset(PP_Resource resource) {
31 if (resource_) 33 if (resource_)
32 ppapi_->ReleaseResource(resource_); 34 ppapi_->ReleaseResource(resource_);
33 35
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 case PP_ERROR_CONNECTION_FAILED: return ECONNREFUSED; 76 case PP_ERROR_CONNECTION_FAILED: return ECONNREFUSED;
75 case PP_ERROR_CONNECTION_TIMEDOUT: return ETIMEDOUT; 77 case PP_ERROR_CONNECTION_TIMEDOUT: return ETIMEDOUT;
76 case PP_ERROR_ADDRESS_UNREACHABLE: return ENETUNREACH; 78 case PP_ERROR_ADDRESS_UNREACHABLE: return ENETUNREACH;
77 case PP_ERROR_ADDRESS_IN_USE: return EADDRINUSE; 79 case PP_ERROR_ADDRESS_IN_USE: return EADDRINUSE;
78 } 80 }
79 81
80 return EINVAL; 82 return EINVAL;
81 } 83 }
82 84
83 } // namespace nacl_io 85 } // namespace nacl_io
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698