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

Side by Side Diff: base/message_loop_proxy.h

Issue 5347001: Fix shutdown crash in CertVerifier by using a MessageLoopProxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add lock.h Created 10 years, 1 month 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_loop_proxy_impl.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) 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 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/ref_counted.h" 10 #include "base/ref_counted.h"
11 #include "base/task.h" 11 #include "base/task.h"
12 12
13 namespace base { 13 namespace base {
14 14
15 struct MessageLoopProxyTraits; 15 struct MessageLoopProxyTraits;
16 16
17 // This class provides a thread-safe refcounted interface to the Post* methods 17 // This class provides a thread-safe refcounted interface to the Post* methods
18 // of a message loop. This class can outlive the target message loop. You can 18 // of a message loop. This class can outlive the target message loop. You can
19 // obtain a MessageLoopProxy via Thread::message_loop_proxy(). 19 // obtain a MessageLoopProxy via Thread::message_loop_proxy() or
20 // MessageLoopProxy::CreateForCurrentThread().
20 class MessageLoopProxy 21 class MessageLoopProxy
21 : public base::RefCountedThreadSafe<MessageLoopProxy, 22 : public base::RefCountedThreadSafe<MessageLoopProxy,
22 MessageLoopProxyTraits> { 23 MessageLoopProxyTraits> {
23 public: 24 public:
24 // These methods are the same as in message_loop.h, but are guaranteed to 25 // These methods are the same as in message_loop.h, but are guaranteed to
25 // either post the Task to the MessageLoop (if it's still alive), or to 26 // either post the Task to the MessageLoop (if it's still alive), or to
26 // delete the Task otherwise. 27 // delete the Task otherwise.
27 // They return true iff the thread existed and the task was posted. Note that 28 // They return true iff the thread existed and the task was posted. Note that
28 // even if the task is posted, there's no guarantee that it will run, since 29 // even if the task is posted, there's no guarantee that it will run, since
29 // the target thread may already have a Quit message in its queue. 30 // the target thread may already have a Quit message in its queue.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 70
70 struct MessageLoopProxyTraits { 71 struct MessageLoopProxyTraits {
71 static void Destruct(const MessageLoopProxy* proxy) { 72 static void Destruct(const MessageLoopProxy* proxy) {
72 proxy->OnDestruct(); 73 proxy->OnDestruct();
73 } 74 }
74 }; 75 };
75 76
76 } // namespace base 77 } // namespace base
77 78
78 #endif // BASE_MESSAGE_LOOP_PROXY_H_ 79 #endif // BASE_MESSAGE_LOOP_PROXY_H_
OLDNEW
« no previous file with comments | « no previous file | base/message_loop_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698