OLD | NEW |
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 CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 scoped_refptr<base::MessageLoopProxy> message_loop_proxy = | 144 scoped_refptr<base::MessageLoopProxy> message_loop_proxy = |
145 GetMessageLoopProxyForThread(identifier); | 145 GetMessageLoopProxyForThread(identifier); |
146 return base::PostTaskAndReplyWithResult<ReturnType>( | 146 return base::PostTaskAndReplyWithResult<ReturnType>( |
147 message_loop_proxy.get(), from_here, task, reply); | 147 message_loop_proxy.get(), from_here, task, reply); |
148 } | 148 } |
149 | 149 |
150 template <class T> | 150 template <class T> |
151 static bool DeleteSoon(ID identifier, | 151 static bool DeleteSoon(ID identifier, |
152 const tracked_objects::Location& from_here, | 152 const tracked_objects::Location& from_here, |
153 const T* object) { | 153 const T* object) { |
154 return GetMessageLoopProxyForThread(identifier)->DeleteSoon( | 154 scoped_refptr<base::MessageLoopProxy> message_loop_proxy = |
155 from_here, object); | 155 GetMessageLoopProxyForThread(identifier); |
| 156 if (!message_loop_proxy) |
| 157 return false; |
| 158 return message_loop_proxy->DeleteSoon(from_here, object); |
156 } | 159 } |
157 | 160 |
158 template <class T> | 161 template <class T> |
159 static bool ReleaseSoon(ID identifier, | 162 static bool ReleaseSoon(ID identifier, |
160 const tracked_objects::Location& from_here, | 163 const tracked_objects::Location& from_here, |
161 const T* object) { | 164 const T* object) { |
162 return GetMessageLoopProxyForThread(identifier)->ReleaseSoon( | 165 return GetMessageLoopProxyForThread(identifier)->ReleaseSoon( |
163 from_here, object); | 166 from_here, object); |
164 } | 167 } |
165 | 168 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 private: | 286 private: |
284 friend class BrowserThreadImpl; | 287 friend class BrowserThreadImpl; |
285 | 288 |
286 BrowserThread() {} | 289 BrowserThread() {} |
287 DISALLOW_COPY_AND_ASSIGN(BrowserThread); | 290 DISALLOW_COPY_AND_ASSIGN(BrowserThread); |
288 }; | 291 }; |
289 | 292 |
290 } // namespace content | 293 } // namespace content |
291 | 294 |
292 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ | 295 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ |
OLD | NEW |