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

Side by Side Diff: src/trusted/desc/nacl_desc_wrapper.cc

Issue 6937003: modified nacl_sync.h to have NACL_WUR for all functions that return a (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 7 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
« no previous file with comments | « src/shared/platform/nacl_sync_checked.c ('k') | src/trusted/service_runtime/fs/obj_proxy.c » ('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 (c) 2009 The Native Client Authors. All rights reserved. 1 // Copyright (c) 2011 The Native Client 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 <limits> 5 #include <limits>
6 #include <new> 6 #include <new>
7 #include "base/shared_memory.h" 7 #include "base/shared_memory.h"
8 #include "base/sync_socket.h" 8 #include "base/sync_socket.h"
9 #include "native_client/src/include/portability.h" 9 #include "native_client/src/include/portability.h"
10 #include "native_client/src/include/portability_string.h" 10 #include "native_client/src/include/portability_string.h"
11 #include "native_client/src/shared/imc/nacl_imc.h" 11 #include "native_client/src/shared/imc/nacl_imc.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 --ref_count_; 76 --ref_count_;
77 bool destroy = (0 == ref_count_); 77 bool destroy = (0 == ref_count_);
78 NaClXMutexUnlock(&ref_count_mu_); 78 NaClXMutexUnlock(&ref_count_mu_);
79 if (destroy) { 79 if (destroy) {
80 delete this; 80 delete this;
81 } 81 }
82 } 82 }
83 83
84 private: 84 private:
85 DescWrapperCommon() : is_initialized_(false), ref_count_(1) { 85 DescWrapperCommon() : is_initialized_(false), ref_count_(1) {
86 NaClMutexCtor(&ref_count_mu_); 86 NaClXMutexCtor(&ref_count_mu_);
87 } 87 }
88 ~DescWrapperCommon() { 88 ~DescWrapperCommon() {
89 if (is_initialized_) { 89 if (is_initialized_) {
90 effp()->vtbl->Dtor(effp()); 90 effp()->vtbl->Dtor(effp());
91 } 91 }
92 NaClMutexDtor(&ref_count_mu_); 92 NaClMutexDtor(&ref_count_mu_);
93 } 93 }
94 94
95 // Set up the state. Returns true on success. 95 // Set up the state. Returns true on success.
96 bool Init(); 96 bool Init();
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 return reinterpret_cast<struct NaClDescVtbl const *>(desc_->base.vtbl)-> 658 return reinterpret_cast<struct NaClDescVtbl const *>(desc_->base.vtbl)->
659 SemWait(desc_); 659 SemWait(desc_);
660 } 660 }
661 661
662 int DescWrapper::GetValue() { 662 int DescWrapper::GetValue() {
663 return reinterpret_cast<struct NaClDescVtbl const *>(desc_->base.vtbl)-> 663 return reinterpret_cast<struct NaClDescVtbl const *>(desc_->base.vtbl)->
664 GetValue(desc_); 664 GetValue(desc_);
665 } 665 }
666 666
667 } // namespace nacl 667 } // namespace nacl
OLDNEW
« no previous file with comments | « src/shared/platform/nacl_sync_checked.c ('k') | src/trusted/service_runtime/fs/obj_proxy.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698