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

Side by Side Diff: base/at_exit.cc

Issue 10582012: For unit tests, track additions to AtExitManager and warn. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additional fixes. Created 8 years, 6 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
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/at_exit.h" 5 #include "base/at_exit.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <ostream> 8 #include <ostream>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 task.Run(); 72 task.Run();
73 g_top_manager->stack_.pop(); 73 g_top_manager->stack_.pop();
74 } 74 }
75 } 75 }
76 76
77 AtExitManager::AtExitManager(bool shadow) : next_manager_(g_top_manager) { 77 AtExitManager::AtExitManager(bool shadow) : next_manager_(g_top_manager) {
78 DCHECK(shadow || !g_top_manager); 78 DCHECK(shadow || !g_top_manager);
79 g_top_manager = this; 79 g_top_manager = this;
80 } 80 }
81 81
82 // static
83 AtExitManager* AtExitManager::current() {
84 return g_top_manager;
85 }
86
87 size_t AtExitManager::CallbackStackSize() const {
88 return stack_.size();
89 }
90
82 } // namespace base 91 } // namespace base
OLDNEW
« no previous file with comments | « base/at_exit.h ('k') | base/test/test_suite.h » ('j') | base/test/test_switches.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698