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

Side by Side Diff: base/at_exit.h

Issue 2309153002: Remove RenderThreadImpl::Shutdown (Closed)
Patch Set: temp Created 3 years, 11 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 | « no previous file | base/at_exit.cc » ('j') | base/at_exit.cc » ('J')
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 #ifndef BASE_AT_EXIT_H_ 5 #ifndef BASE_AT_EXIT_H_
6 #define BASE_AT_EXIT_H_ 6 #define BASE_AT_EXIT_H_
7 7
8 #include <stack> 8 #include <stack>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // the callback function is void func(void*). 42 // the callback function is void func(void*).
43 static void RegisterCallback(AtExitCallbackType func, void* param); 43 static void RegisterCallback(AtExitCallbackType func, void* param);
44 44
45 // Registers the specified task to be called at exit. 45 // Registers the specified task to be called at exit.
46 static void RegisterTask(base::Closure task); 46 static void RegisterTask(base::Closure task);
47 47
48 // Calls the functions registered with RegisterCallback in LIFO order. It 48 // Calls the functions registered with RegisterCallback in LIFO order. It
49 // is possible to register new callbacks after calling this function. 49 // is possible to register new callbacks after calling this function.
50 static void ProcessCallbacksNow(); 50 static void ProcessCallbacksNow();
51 51
52 // Disable all registered at-exit callbacks. This is used only in a single-
53 // process mode. See a comment in ~ChildProcess().
54 static void DisableAllAtExitManagers();
55
52 protected: 56 protected:
53 // This constructor will allow this instance of AtExitManager to be created 57 // This constructor will allow this instance of AtExitManager to be created
54 // even if one already exists. This should only be used for testing! 58 // even if one already exists. This should only be used for testing!
55 // AtExitManagers are kept on a global stack, and it will be removed during 59 // AtExitManagers are kept on a global stack, and it will be removed during
56 // destruction. This allows you to shadow another AtExitManager. 60 // destruction. This allows you to shadow another AtExitManager.
57 explicit AtExitManager(bool shadow); 61 explicit AtExitManager(bool shadow);
58 62
59 private: 63 private:
60 base::Lock lock_; 64 base::Lock lock_;
61 std::stack<base::Closure> stack_; 65 std::stack<base::Closure> stack_;
62 bool processing_callbacks_; 66 bool processing_callbacks_;
63 AtExitManager* next_manager_; // Stack of managers to allow shadowing. 67 AtExitManager* next_manager_; // Stack of managers to allow shadowing.
64 68
65 DISALLOW_COPY_AND_ASSIGN(AtExitManager); 69 DISALLOW_COPY_AND_ASSIGN(AtExitManager);
66 }; 70 };
67 71
68 #if defined(UNIT_TEST) 72 #if defined(UNIT_TEST)
69 class ShadowingAtExitManager : public AtExitManager { 73 class ShadowingAtExitManager : public AtExitManager {
70 public: 74 public:
71 ShadowingAtExitManager() : AtExitManager(true) {} 75 ShadowingAtExitManager() : AtExitManager(true) {}
72 }; 76 };
73 #endif // defined(UNIT_TEST) 77 #endif // defined(UNIT_TEST)
74 78
75 } // namespace base 79 } // namespace base
76 80
77 #endif // BASE_AT_EXIT_H_ 81 #endif // BASE_AT_EXIT_H_
OLDNEW
« no previous file with comments | « no previous file | base/at_exit.cc » ('j') | base/at_exit.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698