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

Unified Diff: ppapi/proxy/ppb_core_proxy.cc

Issue 10961045: PPAPI/NaCl: Sanitize CallOnMainThread delay parameter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_core_proxy.cc
diff --git a/ppapi/proxy/ppb_core_proxy.cc b/ppapi/proxy/ppb_core_proxy.cc
index ad8773bff600d0d3d207a8474ad721c420f1771d..6168f4989520a82337609700448f698947882459 100644
--- a/ppapi/proxy/ppb_core_proxy.cc
+++ b/ppapi/proxy/ppb_core_proxy.cc
@@ -54,6 +54,12 @@ void CallOnMainThread(int delay_in_ms,
PP_CompletionCallback callback,
int32_t result) {
DCHECK(callback.func);
+#if defined(OS_NACL)
+ // Some NaCl apps pass a negative delay, so we just sanitize to 0, to run as
+ // soon as possible. MessageLoop checks that the delay is non-negative.
+ if (delay_in_ms < 0)
+ delay_in_ms = 0;
+#endif
if (!callback.func)
return;
PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostDelayedTask(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698