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

Side by Side Diff: base/observer_list_unittest.cc

Issue 1094903006: Update {virtual,override} to follow C++11 style in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « base/json/json_value_converter.h ('k') | base/prefs/pref_member.h » ('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/observer_list.h" 5 #include "base/observer_list.h"
6 #include "base/observer_list_threadsafe.h" 6 #include "base/observer_list_threadsafe.h"
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 template <typename ObserverListType> 65 template <typename ObserverListType>
66 class AddInObserve : public Foo { 66 class AddInObserve : public Foo {
67 public: 67 public:
68 explicit AddInObserve(ObserverListType* observer_list) 68 explicit AddInObserve(ObserverListType* observer_list)
69 : added(false), 69 : added(false),
70 observer_list(observer_list), 70 observer_list(observer_list),
71 adder(1) { 71 adder(1) {
72 } 72 }
73 73
74 virtual void Observe(int x) override { 74 void Observe(int x) override {
75 if (!added) { 75 if (!added) {
76 added = true; 76 added = true;
77 observer_list->AddObserver(&adder); 77 observer_list->AddObserver(&adder);
78 } 78 }
79 } 79 }
80 80
81 bool added; 81 bool added;
82 ObserverListType* observer_list; 82 ObserverListType* observer_list;
83 Adder adder; 83 Adder adder;
84 }; 84 };
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 ListDestructor a(observer_list); 534 ListDestructor a(observer_list);
535 observer_list->AddObserver(&a); 535 observer_list->AddObserver(&a);
536 536
537 FOR_EACH_OBSERVER(Foo, *observer_list, Observe(0)); 537 FOR_EACH_OBSERVER(Foo, *observer_list, Observe(0));
538 // If this test fails, there'll be Valgrind errors when this function goes out 538 // If this test fails, there'll be Valgrind errors when this function goes out
539 // of scope. 539 // of scope.
540 } 540 }
541 541
542 } // namespace 542 } // namespace
543 } // namespace base 543 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_value_converter.h ('k') | base/prefs/pref_member.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698