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

Side by Side Diff: base/message_loop.h

Issue 7064033: Virtual destructors should have virtual keyword. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 7 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/message_pump_default.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) 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_MESSAGE_LOOP_H_ 5 #ifndef BASE_MESSAGE_LOOP_H_
6 #define BASE_MESSAGE_LOOP_H_ 6 #define BASE_MESSAGE_LOOP_H_
7 #pragma once 7 #pragma once
8 8
9 #include <queue> 9 #include <queue>
10 #include <string> 10 #include <string>
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // 104 //
105 enum Type { 105 enum Type {
106 TYPE_DEFAULT, 106 TYPE_DEFAULT,
107 TYPE_UI, 107 TYPE_UI,
108 TYPE_IO 108 TYPE_IO
109 }; 109 };
110 110
111 // Normally, it is not necessary to instantiate a MessageLoop. Instead, it 111 // Normally, it is not necessary to instantiate a MessageLoop. Instead, it
112 // is typical to make use of the current thread's MessageLoop instance. 112 // is typical to make use of the current thread's MessageLoop instance.
113 explicit MessageLoop(Type type = TYPE_DEFAULT); 113 explicit MessageLoop(Type type = TYPE_DEFAULT);
114 ~MessageLoop(); 114 virtual ~MessageLoop();
115 115
116 // Returns the MessageLoop object for the current thread, or null if none. 116 // Returns the MessageLoop object for the current thread, or null if none.
117 static MessageLoop* current(); 117 static MessageLoop* current();
118 118
119 static void EnableHistogrammer(bool enable_histogrammer); 119 static void EnableHistogrammer(bool enable_histogrammer);
120 120
121 // A DestructionObserver is notified when the current MessageLoop is being 121 // A DestructionObserver is notified when the current MessageLoop is being
122 // destroyed. These obsevers are notified prior to MessageLoop::current() 122 // destroyed. These obsevers are notified prior to MessageLoop::current()
123 // being changed to return NULL. This gives interested parties the chance to 123 // being changed to return NULL. This gives interested parties the chance to
124 // do final cleanup that depends on the MessageLoop. 124 // do final cleanup that depends on the MessageLoop.
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 #endif // defined(OS_POSIX) 690 #endif // defined(OS_POSIX)
691 }; 691 };
692 692
693 // Do not add any member variables to MessageLoopForIO! This is important b/c 693 // Do not add any member variables to MessageLoopForIO! This is important b/c
694 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra 694 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
695 // data that you need should be stored on the MessageLoop's pump_ instance. 695 // data that you need should be stored on the MessageLoop's pump_ instance.
696 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), 696 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO),
697 MessageLoopForIO_should_not_have_extra_member_variables); 697 MessageLoopForIO_should_not_have_extra_member_variables);
698 698
699 #endif // BASE_MESSAGE_LOOP_H_ 699 #endif // BASE_MESSAGE_LOOP_H_
OLDNEW
« no previous file with comments | « no previous file | base/message_pump_default.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698