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

Side by Side Diff: base/message_loop_proxy.h

Issue 2869024: Add virtual to some base classes that have virtual methods... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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
« no previous file with comments | « no previous file | net/base/transport_security_state.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_PROXY_H_ 5 #ifndef BASE_MESSAGE_LOOP_PROXY_H_
6 #define BASE_MESSAGE_LOOP_PROXY_H_ 6 #define BASE_MESSAGE_LOOP_PROXY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/ref_counted.h" 9 #include "base/ref_counted.h"
10 #include "base/task.h" 10 #include "base/task.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 T* object) { 48 T* object) {
49 return PostNonNestableTask(from_here, new ReleaseTask<T>(object)); 49 return PostNonNestableTask(from_here, new ReleaseTask<T>(object));
50 } 50 }
51 51
52 // Factory method for creating an implementation of MessageLoopProxy 52 // Factory method for creating an implementation of MessageLoopProxy
53 // for the current thread. 53 // for the current thread.
54 static scoped_refptr<MessageLoopProxy> CreateForCurrentThread(); 54 static scoped_refptr<MessageLoopProxy> CreateForCurrentThread();
55 55
56 protected: 56 protected:
57 friend struct MessageLoopProxyTraits; 57 friend struct MessageLoopProxyTraits;
58
59 virtual ~MessageLoopProxy() { }
60
58 // Called when the proxy is about to be deleted. Subclasses can override this 61 // Called when the proxy is about to be deleted. Subclasses can override this
59 // to provide deletion on specific threads. 62 // to provide deletion on specific threads.
60 virtual void OnDestruct() { 63 virtual void OnDestruct() {
61 delete this; 64 delete this;
62 } 65 }
63 }; 66 };
64 67
65 struct MessageLoopProxyTraits { 68 struct MessageLoopProxyTraits {
66 static void Destruct(MessageLoopProxy* proxy) { 69 static void Destruct(MessageLoopProxy* proxy) {
67 proxy->OnDestruct(); 70 proxy->OnDestruct();
68 } 71 }
69 }; 72 };
70 73
71 } // namespace base 74 } // namespace base
72 75
73 #endif // BASE_MESSAGE_LOOP_PROXY_H_ 76 #endif // BASE_MESSAGE_LOOP_PROXY_H_
74 77
OLDNEW
« no previous file with comments | « no previous file | net/base/transport_security_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698