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

Unified Diff: ppapi/proxy/ppb_url_loader_proxy.cc

Issue 6899055: PPAPI: Force async callback invocation option. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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/proxy/ppb_url_loader_proxy.cc
===================================================================
--- ppapi/proxy/ppb_url_loader_proxy.cc (revision 88104)
+++ ppapi/proxy/ppb_url_loader_proxy.cc (working copy)
@@ -22,6 +22,7 @@
#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/ppb_url_response_info_proxy.h"
+#include "ppapi/thunk/common.h"
#if defined(OS_LINUX)
#include <sys/shm.h>
@@ -178,11 +179,11 @@
URLLoader* loader_object;
PluginDispatcher* dispatcher;
if (!RoutingDataFromURLLoader(loader_id, &loader_object, &dispatcher))
- return PP_ERROR_BADRESOURCE;
+ return ppapi::thunk::MayForceCallback(callback, PP_ERROR_BADRESOURCE);
PluginResource* request_object =
PluginResourceTracker::GetInstance()->GetResourceObject(request_id);
if (!request_object)
- return PP_ERROR_BADRESOURCE;
+ return ppapi::thunk::MayForceCallback(callback, PP_ERROR_BADRESOURCE);
dispatcher->Send(new PpapiHostMsg_PPBURLLoader_Open(
INTERFACE_ID_PPB_URL_LOADER, loader_object->host_resource(),
@@ -196,7 +197,7 @@
URLLoader* loader_object;
PluginDispatcher* dispatcher;
if (!RoutingDataFromURLLoader(loader_id, &loader_object, &dispatcher))
- return PP_ERROR_BADRESOURCE;
+ return ppapi::thunk::MayForceCallback(callback, PP_ERROR_BADRESOURCE);
dispatcher->Send(new PpapiHostMsg_PPBURLLoader_FollowRedirect(
INTERFACE_ID_PPB_URL_LOADER, loader_object->host_resource(),
@@ -246,23 +247,25 @@
URLLoader* object;
PluginDispatcher* dispatcher;
if (!RoutingDataFromURLLoader(loader_id, &object, &dispatcher))
- return PP_ERROR_BADRESOURCE;
+ return ppapi::thunk::MayForceCallback(callback, PP_ERROR_BADRESOURCE);
if (!buffer || bytes_to_read <= 0)
piman 2011/06/07 17:32:14 add braces around the next 2 lines
polina 2011/06/09 23:53:51 Done.
- return PP_ERROR_BADARGUMENT; // Must specify an output buffer.
+ // Must specify an output buffer.
+ return ppapi::thunk::MayForceCallback(callback, PP_ERROR_BADARGUMENT);
if (object->current_read_callback_.func)
piman 2011/06/07 17:32:14 add braces around the next 2 lines
polina 2011/06/09 23:53:51 Done.
- return PP_ERROR_INPROGRESS; // Can only have one request pending.
+ // Can only have one request pending.
+ return ppapi::thunk::MayForceCallback(callback, PP_ERROR_INPROGRESS);
// Currently we don't support sync calls to read. We'll need to revisit
// how this works when we allow blocking calls (from background threads).
if (!callback.func)
- return PP_ERROR_BADARGUMENT;
+ return ppapi::thunk::MayForceCallback(callback, PP_ERROR_BADARGUMENT);
if (static_cast<size_t>(bytes_to_read) <= object->buffer_.size()) {
// Special case: we've buffered enough data to be able to synchronously
// return data to the caller. Do so without making IPCs.
object->PopBuffer(buffer, bytes_to_read);
- return bytes_to_read;
+ return ppapi::thunk::MayForceCallback(callback, bytes_to_read);
}
object->current_read_callback_ = callback;
@@ -280,7 +283,7 @@
URLLoader* loader_object;
PluginDispatcher* dispatcher;
if (!RoutingDataFromURLLoader(loader_id, &loader_object, &dispatcher))
- return PP_ERROR_BADRESOURCE;
+ return ppapi::thunk::MayForceCallback(callback, PP_ERROR_BADRESOURCE);
dispatcher->Send(new PpapiHostMsg_PPBURLLoader_FinishStreamingToFile(
INTERFACE_ID_PPB_URL_LOADER, loader_object->host_resource(),

Powered by Google App Engine
This is Rietveld 408576698