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

Side by Side Diff: webrtc/base/thread_checker_unittest.cc

Issue 2718663005: Replace NULL with nullptr or null in webrtc/base/. (Closed)
Patch Set: Fixing Windows and formatting issues. Created 3 years, 9 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/thread.cc ('k') | webrtc/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 (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 private: 47 private:
48 RTC_DISALLOW_COPY_AND_ASSIGN(ThreadCheckerClass); 48 RTC_DISALLOW_COPY_AND_ASSIGN(ThreadCheckerClass);
49 }; 49 };
50 50
51 // Calls ThreadCheckerClass::DoStuff on another thread. 51 // Calls ThreadCheckerClass::DoStuff on another thread.
52 class CallDoStuffOnThread : public Thread { 52 class CallDoStuffOnThread : public Thread {
53 public: 53 public:
54 explicit CallDoStuffOnThread(ThreadCheckerClass* thread_checker_class) 54 explicit CallDoStuffOnThread(ThreadCheckerClass* thread_checker_class)
55 : Thread(), 55 : Thread(),
56 thread_checker_class_(thread_checker_class) { 56 thread_checker_class_(thread_checker_class) {
57 SetName("call_do_stuff_on_thread", NULL); 57 SetName("call_do_stuff_on_thread", nullptr);
58 } 58 }
59 59
60 void Run() override { thread_checker_class_->DoStuff(); } 60 void Run() override { thread_checker_class_->DoStuff(); }
61 61
62 // New method. Needed since Thread::Join is protected, and it is called by 62 // New method. Needed since Thread::Join is protected, and it is called by
63 // the TEST. 63 // the TEST.
64 void Join() { 64 void Join() {
65 Thread::Join(); 65 Thread::Join();
66 } 66 }
67 67
68 private: 68 private:
69 ThreadCheckerClass* thread_checker_class_; 69 ThreadCheckerClass* thread_checker_class_;
70 70
71 RTC_DISALLOW_COPY_AND_ASSIGN(CallDoStuffOnThread); 71 RTC_DISALLOW_COPY_AND_ASSIGN(CallDoStuffOnThread);
72 }; 72 };
73 73
74 // Deletes ThreadCheckerClass on a different thread. 74 // Deletes ThreadCheckerClass on a different thread.
75 class DeleteThreadCheckerClassOnThread : public Thread { 75 class DeleteThreadCheckerClassOnThread : public Thread {
76 public: 76 public:
77 explicit DeleteThreadCheckerClassOnThread( 77 explicit DeleteThreadCheckerClassOnThread(
78 ThreadCheckerClass* thread_checker_class) 78 ThreadCheckerClass* thread_checker_class)
79 : Thread(), 79 : Thread(),
80 thread_checker_class_(thread_checker_class) { 80 thread_checker_class_(thread_checker_class) {
81 SetName("delete_thread_checker_class_on_thread", NULL); 81 SetName("delete_thread_checker_class_on_thread", nullptr);
82 } 82 }
83 83
84 void Run() override { thread_checker_class_.reset(); } 84 void Run() override { thread_checker_class_.reset(); }
85 85
86 // New method. Needed since Thread::Join is protected, and it is called by 86 // New method. Needed since Thread::Join is protected, and it is called by
87 // the TEST. 87 // the TEST.
88 void Join() { 88 void Join() {
89 Thread::Join(); 89 Thread::Join();
90 } 90 }
91 91
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 243
244 int var_thread_ ACCESS_ON(thread_); 244 int var_thread_ ACCESS_ON(thread_);
245 int var_checker_ GUARDED_BY(checker_); 245 int var_checker_ GUARDED_BY(checker_);
246 int var_queue_ ACCESS_ON(queue_); 246 int var_queue_ ACCESS_ON(queue_);
247 }; 247 };
248 248
249 // Just in case we ever get lumped together with other compilation units. 249 // Just in case we ever get lumped together with other compilation units.
250 #undef ENABLE_THREAD_CHECKER 250 #undef ENABLE_THREAD_CHECKER
251 251
252 } // namespace rtc 252 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/thread.cc ('k') | webrtc/base/thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698