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

Side by Side Diff: base/bind_unittest.cc

Issue 10004001: Add virtual and OVERRIDE to base/ implementation files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win Fix -> Missing header Created 8 years, 8 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 | « no previous file | base/debug/trace_event_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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/bind.h" 5 #include "base/bind.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 public: 59 public:
60 void AddRef(void) const {} 60 void AddRef(void) const {}
61 void Release(void) const {} 61 void Release(void) const {}
62 virtual void VirtualSet() { value = kParentValue; } 62 virtual void VirtualSet() { value = kParentValue; }
63 void NonVirtualSet() { value = kParentValue; } 63 void NonVirtualSet() { value = kParentValue; }
64 int value; 64 int value;
65 }; 65 };
66 66
67 class Child : public Parent { 67 class Child : public Parent {
68 public: 68 public:
69 virtual void VirtualSet() { value = kChildValue; } 69 virtual void VirtualSet() OVERRIDE { value = kChildValue; }
70 void NonVirtualSet() { value = kChildValue; } 70 void NonVirtualSet() { value = kChildValue; }
71 }; 71 };
72 72
73 class NoRefParent { 73 class NoRefParent {
74 public: 74 public:
75 virtual void VirtualSet() { value = kParentValue; } 75 virtual void VirtualSet() { value = kParentValue; }
76 void NonVirtualSet() { value = kParentValue; } 76 void NonVirtualSet() { value = kParentValue; }
77 int value; 77 int value;
78 }; 78 };
79 79
80 class NoRefChild : public NoRefParent { 80 class NoRefChild : public NoRefParent {
81 virtual void VirtualSet() { value = kChildValue; } 81 virtual void VirtualSet() OVERRIDE { value = kChildValue; }
82 void NonVirtualSet() { value = kChildValue; } 82 void NonVirtualSet() { value = kChildValue; }
83 }; 83 };
84 84
85 // Used for probing the number of copies that occur if a type must be coerced 85 // Used for probing the number of copies that occur if a type must be coerced
86 // during argument forwarding in the Run() methods. 86 // during argument forwarding in the Run() methods.
87 struct DerivedCopyCounter { 87 struct DerivedCopyCounter {
88 DerivedCopyCounter(int* copies, int* assigns) 88 DerivedCopyCounter(int* copies, int* assigns)
89 : copies_(copies), assigns_(assigns) { 89 : copies_(copies), assigns_(assigns) {
90 } 90 }
91 int* copies_; 91 int* copies_;
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 Callback<int(void)> fastcall_cb = Bind(&FastCallFunc, 1); 797 Callback<int(void)> fastcall_cb = Bind(&FastCallFunc, 1);
798 EXPECT_EQ(1, fastcall_cb.Run()); 798 EXPECT_EQ(1, fastcall_cb.Run());
799 799
800 Callback<int(void)> stdcall_cb = Bind(&StdCallFunc, 2); 800 Callback<int(void)> stdcall_cb = Bind(&StdCallFunc, 2);
801 EXPECT_EQ(2, stdcall_cb.Run()); 801 EXPECT_EQ(2, stdcall_cb.Run());
802 } 802 }
803 #endif 803 #endif
804 804
805 } // namespace 805 } // namespace
806 } // namespace base 806 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698