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

Side by Side Diff: base/run_loop.h

Issue 26308002: Fix some WeakPtrFactory members that aren't last (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix weak ptr initialization Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/run_loop.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 #ifndef BASE_RUN_LOOP_H_ 5 #ifndef BASE_RUN_LOOP_H_
6 #define BASE_RUN_LOOP_H_ 6 #define BASE_RUN_LOOP_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // BeforeRun directly. 87 // BeforeRun directly.
88 friend class base::MessagePumpUIApplication; 88 friend class base::MessagePumpUIApplication;
89 #endif 89 #endif
90 90
91 // Return false to abort the Run. 91 // Return false to abort the Run.
92 bool BeforeRun(); 92 bool BeforeRun();
93 void AfterRun(); 93 void AfterRun();
94 94
95 MessageLoop* loop_; 95 MessageLoop* loop_;
96 96
97 // WeakPtrFactory for QuitClosure safety.
98 base::WeakPtrFactory<RunLoop> weak_factory_;
99
100 // Parent RunLoop or NULL if this is the top-most RunLoop. 97 // Parent RunLoop or NULL if this is the top-most RunLoop.
101 RunLoop* previous_run_loop_; 98 RunLoop* previous_run_loop_;
102 99
103 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) && \ 100 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) && \
104 !defined(USE_GTK_MESSAGE_PUMP) 101 !defined(USE_GTK_MESSAGE_PUMP)
105 MessageLoop::Dispatcher* dispatcher_; 102 MessageLoop::Dispatcher* dispatcher_;
106 #endif 103 #endif
107 104
108 // Used to count how many nested Run() invocations are on the stack. 105 // Used to count how many nested Run() invocations are on the stack.
109 int run_depth_; 106 int run_depth_;
110 107
111 bool run_called_; 108 bool run_called_;
112 bool quit_called_; 109 bool quit_called_;
113 bool running_; 110 bool running_;
114 111
115 // Used to record that QuitWhenIdle() was called on the MessageLoop, meaning 112 // Used to record that QuitWhenIdle() was called on the MessageLoop, meaning
116 // that we should quit Run once it becomes idle. 113 // that we should quit Run once it becomes idle.
117 bool quit_when_idle_received_; 114 bool quit_when_idle_received_;
118 115
116 // WeakPtrFactory for QuitClosure safety.
117 base::WeakPtrFactory<RunLoop> weak_factory_;
118
119 DISALLOW_COPY_AND_ASSIGN(RunLoop); 119 DISALLOW_COPY_AND_ASSIGN(RunLoop);
120 }; 120 };
121 121
122 } // namespace base 122 } // namespace base
123 123
124 #endif // BASE_RUN_LOOP_H_ 124 #endif // BASE_RUN_LOOP_H_
OLDNEW
« no previous file with comments | « no previous file | base/run_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698