Chromium Code Reviews| Index: ppapi/proxy/ppb_core_proxy.cc |
| diff --git a/ppapi/proxy/ppb_core_proxy.cc b/ppapi/proxy/ppb_core_proxy.cc |
| index 4c0b372fe94b3b1415469444bc7c84ff248a9558..80c057278b15f00dcfea4722ec58e08344651ebc 100644 |
| --- a/ppapi/proxy/ppb_core_proxy.cc |
| +++ b/ppapi/proxy/ppb_core_proxy.cc |
| @@ -63,6 +63,13 @@ void CallOnMainThread(int delay_in_ms, |
| if (!callback.func) |
| return; |
| ProxyAutoLock lock; |
| + |
| + // If the plugin attempts to call CallOnMainThread from a background thread |
| + // at shutdown, it's possible that the globals or the main loop has been |
|
bbudge
2015/03/25 20:54:45
nit: s/has/have
dmichael (off chromium)
2015/03/25 21:33:06
I was treating both parts of the "or" as singular.
|
| + // destroyed. |
| + if (!PpapiGlobals::Get() || !PpapiGlobals::Get()->GetMainThreadMessageLoop()) |
| + return; |
| + |
| PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostDelayedTask( |
| FROM_HERE, |
| RunWhileLocked(base::Bind(&CallbackWrapper, callback, result)), |