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

Unified Diff: ppapi/native_client/src/shared/ppapi_proxy/browser_callback.cc

Issue 9724007: WebSocket Pepper API: fix data corruption at ReceiveMessage in NaCl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: remove flaky prefix Created 8 years, 9 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
Index: ppapi/native_client/src/shared/ppapi_proxy/browser_callback.cc
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_callback.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_callback.cc
index 5f5e7c36e8df810bfb20b1b652f90d43c4fedf3e..6849a8e8db44acb42f1b1d264b7799c9a4492ee6 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_callback.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_callback.cc
@@ -136,6 +136,12 @@ struct PP_CompletionCallback MakeRemoteCompletionCallback(
if (var)
*var = &remote_callback->read_var;
+ // If caller requires to copy data at completion, the callback must be
+ // asynchronous. Because the copy is performed in RunRemoteCallback.
+ if ((bytes_to_read > 0 && buffer != NULL) || var)
+ return PP_MakeCompletionCallback(
+ RunRemoteCallback, remote_callback.release());
dmichael (off chromium) 2012/03/21 19:16:47 This is going to affect URLLoader::ReadResponseBod
+
return PP_MakeOptionalCompletionCallback(
RunRemoteCallback, remote_callback.release());
}
« no previous file with comments | « chrome/test/ui/ppapi_uitest.cc ('k') | ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_websocket_rpc_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698