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

Side by Side Diff: base/threading/non_thread_safe_unittest.cc

Issue 611153004: replace OVERRIDE and FINAL with override and final in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CC_ -> BASE_ Created 6 years, 2 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 | « base/test/test_support_android.cc ('k') | base/threading/platform_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 // 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/threading/non_thread_safe.h" 8 #include "base/threading/non_thread_safe.h"
9 #include "base/threading/simple_thread.h" 9 #include "base/threading/simple_thread.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 }; 45 };
46 46
47 // Calls NonThreadSafeClass::DoStuff on another thread. 47 // Calls NonThreadSafeClass::DoStuff on another thread.
48 class CallDoStuffOnThread : public SimpleThread { 48 class CallDoStuffOnThread : public SimpleThread {
49 public: 49 public:
50 explicit CallDoStuffOnThread(NonThreadSafeClass* non_thread_safe_class) 50 explicit CallDoStuffOnThread(NonThreadSafeClass* non_thread_safe_class)
51 : SimpleThread("call_do_stuff_on_thread"), 51 : SimpleThread("call_do_stuff_on_thread"),
52 non_thread_safe_class_(non_thread_safe_class) { 52 non_thread_safe_class_(non_thread_safe_class) {
53 } 53 }
54 54
55 virtual void Run() OVERRIDE { 55 virtual void Run() override {
56 non_thread_safe_class_->DoStuff(); 56 non_thread_safe_class_->DoStuff();
57 } 57 }
58 58
59 private: 59 private:
60 NonThreadSafeClass* non_thread_safe_class_; 60 NonThreadSafeClass* non_thread_safe_class_;
61 61
62 DISALLOW_COPY_AND_ASSIGN(CallDoStuffOnThread); 62 DISALLOW_COPY_AND_ASSIGN(CallDoStuffOnThread);
63 }; 63 };
64 64
65 // Deletes NonThreadSafeClass on a different thread. 65 // Deletes NonThreadSafeClass on a different thread.
66 class DeleteNonThreadSafeClassOnThread : public SimpleThread { 66 class DeleteNonThreadSafeClassOnThread : public SimpleThread {
67 public: 67 public:
68 explicit DeleteNonThreadSafeClassOnThread( 68 explicit DeleteNonThreadSafeClassOnThread(
69 NonThreadSafeClass* non_thread_safe_class) 69 NonThreadSafeClass* non_thread_safe_class)
70 : SimpleThread("delete_non_thread_safe_class_on_thread"), 70 : SimpleThread("delete_non_thread_safe_class_on_thread"),
71 non_thread_safe_class_(non_thread_safe_class) { 71 non_thread_safe_class_(non_thread_safe_class) {
72 } 72 }
73 73
74 virtual void Run() OVERRIDE { 74 virtual void Run() override {
75 non_thread_safe_class_.reset(); 75 non_thread_safe_class_.reset();
76 } 76 }
77 77
78 private: 78 private:
79 scoped_ptr<NonThreadSafeClass> non_thread_safe_class_; 79 scoped_ptr<NonThreadSafeClass> non_thread_safe_class_;
80 80
81 DISALLOW_COPY_AND_ASSIGN(DeleteNonThreadSafeClassOnThread); 81 DISALLOW_COPY_AND_ASSIGN(DeleteNonThreadSafeClassOnThread);
82 }; 82 };
83 83
84 } // namespace 84 } // namespace
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 NonThreadSafeClass::DestructorOnDifferentThreadImpl(); 158 NonThreadSafeClass::DestructorOnDifferentThreadImpl();
159 } 159 }
160 #endif // ENABLE_NON_THREAD_SAFE 160 #endif // ENABLE_NON_THREAD_SAFE
161 161
162 #endif // GTEST_HAS_DEATH_TEST || !ENABLE_NON_THREAD_SAFE 162 #endif // GTEST_HAS_DEATH_TEST || !ENABLE_NON_THREAD_SAFE
163 163
164 // Just in case we ever get lumped together with other compilation units. 164 // Just in case we ever get lumped together with other compilation units.
165 #undef ENABLE_NON_THREAD_SAFE 165 #undef ENABLE_NON_THREAD_SAFE
166 166
167 } // namespace base 167 } // namespace base
OLDNEW
« no previous file with comments | « base/test/test_support_android.cc ('k') | base/threading/platform_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698