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

Side by Side Diff: webrtc/rtc_base/thread.h

Issue 2981623002: Make the default ctor of rtc::Thread, protected (Closed)
Patch Set: Format Created 3 years, 5 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/rtc_base/socket_unittest.cc ('k') | webrtc/rtc_base/thread_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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 protected: 94 protected:
95 Runnable() {} 95 Runnable() {}
96 96
97 private: 97 private:
98 RTC_DISALLOW_COPY_AND_ASSIGN(Runnable); 98 RTC_DISALLOW_COPY_AND_ASSIGN(Runnable);
99 }; 99 };
100 100
101 // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). 101 // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread().
102 102
103 class LOCKABLE Thread : public MessageQueue { 103 class LOCKABLE Thread : public MessageQueue {
104 protected:
105 Thread();
106
104 public: 107 public:
105 // Create a new Thread and optionally assign it to the passed SocketServer.
106 Thread();
107 explicit Thread(SocketServer* ss); 108 explicit Thread(SocketServer* ss);
108 explicit Thread(std::unique_ptr<SocketServer> ss); 109 explicit Thread(std::unique_ptr<SocketServer> ss);
109 110
110 // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or 111 // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or
111 // guarantee Stop() is explicitly called before the subclass is destroyed). 112 // guarantee Stop() is explicitly called before the subclass is destroyed).
112 // This is required to avoid a data race between the destructor modifying the 113 // This is required to avoid a data race between the destructor modifying the
113 // vtable, and the Thread::PreRun calling the virtual method Run(). 114 // vtable, and the Thread::PreRun calling the virtual method Run().
114 ~Thread() override; 115 ~Thread() override;
115 116
116 static std::unique_ptr<Thread> CreateWithSocketServer(); 117 static std::unique_ptr<Thread> CreateWithSocketServer();
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 324
324 private: 325 private:
325 rtc::Thread* old_thread_; 326 rtc::Thread* old_thread_;
326 327
327 RTC_DISALLOW_COPY_AND_ASSIGN(AutoSocketServerThread); 328 RTC_DISALLOW_COPY_AND_ASSIGN(AutoSocketServerThread);
328 }; 329 };
329 330
330 } // namespace rtc 331 } // namespace rtc
331 332
332 #endif // WEBRTC_RTC_BASE_THREAD_H_ 333 #endif // WEBRTC_RTC_BASE_THREAD_H_
OLDNEW
« no previous file with comments | « webrtc/rtc_base/socket_unittest.cc ('k') | webrtc/rtc_base/thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698