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

Side by Side Diff: webrtc/base/signalthread.h

Issue 1345433002: Add RTC_ prefix to contructormagic macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Formatting fix. Created 5 years, 3 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 | « webrtc/base/sharedexclusivelock.h ('k') | webrtc/base/signalthread_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 class Worker : public Thread { 106 class Worker : public Thread {
107 public: 107 public:
108 explicit Worker(SignalThread* parent) : parent_(parent) {} 108 explicit Worker(SignalThread* parent) : parent_(parent) {}
109 ~Worker() override; 109 ~Worker() override;
110 void Run() override; 110 void Run() override;
111 111
112 private: 112 private:
113 SignalThread* parent_; 113 SignalThread* parent_;
114 114
115 DISALLOW_IMPLICIT_CONSTRUCTORS(Worker); 115 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Worker);
116 }; 116 };
117 117
118 class SCOPED_LOCKABLE EnterExit { 118 class SCOPED_LOCKABLE EnterExit {
119 public: 119 public:
120 explicit EnterExit(SignalThread* t) EXCLUSIVE_LOCK_FUNCTION(t->cs_) 120 explicit EnterExit(SignalThread* t) EXCLUSIVE_LOCK_FUNCTION(t->cs_)
121 : t_(t) { 121 : t_(t) {
122 t_->cs_.Enter(); 122 t_->cs_.Enter();
123 // If refcount_ is zero then the object has already been deleted and we 123 // If refcount_ is zero then the object has already been deleted and we
124 // will be double-deleting it in ~EnterExit()! (shouldn't happen) 124 // will be double-deleting it in ~EnterExit()! (shouldn't happen)
125 ASSERT(t_->refcount_ != 0); 125 ASSERT(t_->refcount_ != 0);
126 ++t_->refcount_; 126 ++t_->refcount_;
127 } 127 }
128 ~EnterExit() UNLOCK_FUNCTION() { 128 ~EnterExit() UNLOCK_FUNCTION() {
129 bool d = (0 == --t_->refcount_); 129 bool d = (0 == --t_->refcount_);
130 t_->cs_.Leave(); 130 t_->cs_.Leave();
131 if (d) 131 if (d)
132 delete t_; 132 delete t_;
133 } 133 }
134 134
135 private: 135 private:
136 SignalThread* t_; 136 SignalThread* t_;
137 137
138 DISALLOW_IMPLICIT_CONSTRUCTORS(EnterExit); 138 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EnterExit);
139 }; 139 };
140 140
141 void Run(); 141 void Run();
142 void OnMainThreadDestroyed(); 142 void OnMainThreadDestroyed();
143 143
144 Thread* main_; 144 Thread* main_;
145 Worker worker_; 145 Worker worker_;
146 CriticalSection cs_; 146 CriticalSection cs_;
147 State state_; 147 State state_;
148 int refcount_; 148 int refcount_;
149 149
150 DISALLOW_COPY_AND_ASSIGN(SignalThread); 150 RTC_DISALLOW_COPY_AND_ASSIGN(SignalThread);
151 }; 151 };
152 152
153 /////////////////////////////////////////////////////////////////////////////// 153 ///////////////////////////////////////////////////////////////////////////////
154 154
155 } // namespace rtc 155 } // namespace rtc
156 156
157 #endif // WEBRTC_BASE_SIGNALTHREAD_H_ 157 #endif // WEBRTC_BASE_SIGNALTHREAD_H_
OLDNEW
« no previous file with comments | « webrtc/base/sharedexclusivelock.h ('k') | webrtc/base/signalthread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698