Index: ppapi/proxy/ppb_url_loader_proxy.cc |
=================================================================== |
--- ppapi/proxy/ppb_url_loader_proxy.cc (revision 161132) |
+++ ppapi/proxy/ppb_url_loader_proxy.cc (working copy) |
@@ -48,6 +48,7 @@ |
// asked for a larger buffer. |
const int32_t kMaxReadBufferSize = 16777216; // 16MB |
+#if !defined(OS_NACL) |
// Called in the renderer when the byte counts have changed. We send a message |
// to the plugin to synchronize its counts so it can respond to status polls |
// from the plugin. |
@@ -57,7 +58,6 @@ |
int64 total_bytes_to_be_sent, |
int64 bytes_received, |
int64 total_bytes_to_be_received) { |
-#if !defined(OS_NACL) |
Dispatcher* dispatcher = HostDispatcher::GetForInstance(pp_instance); |
if (!dispatcher) |
return; |
@@ -71,8 +71,8 @@ |
params.total_bytes_to_be_received = total_bytes_to_be_received; |
dispatcher->Send(new PpapiMsg_PPBURLLoader_UpdateProgress( |
API_ID_PPB_URL_LOADER, params)); |
-#endif |
} |
+#endif // !defined(OS_NACL) |
InterfaceProxy* CreateURLLoaderProxy(Dispatcher* dispatcher) { |
return new PPB_URLLoader_Proxy(dispatcher); |
@@ -412,6 +412,7 @@ |
bool PPB_URLLoader_Proxy::OnMessageReceived(const IPC::Message& msg) { |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP(PPB_URLLoader_Proxy, msg) |
+#if !defined(OS_NACL) |
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLLoader_Create, |
OnMsgCreate) |
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLLoader_Open, |
@@ -430,6 +431,8 @@ |
OnMsgGrantUniversalAccess) |
IPC_MESSAGE_HANDLER(PpapiMsg_PPBURLLoader_UpdateProgress, |
OnMsgUpdateProgress) |
+#endif // !defined(OS_NACL) |
+ |
IPC_MESSAGE_HANDLER(PpapiMsg_PPBURLLoader_ReadResponseBody_Ack, |
OnMsgReadResponseBodyAck) |
IPC_MESSAGE_HANDLER(PpapiMsg_PPBURLLoader_CallbackComplete, |
@@ -440,6 +443,7 @@ |
return handled; |
} |
+#if !defined(OS_NACL) |
void PPB_URLLoader_Proxy::PrepareURLLoaderForSendingToPlugin( |
PP_Resource resource) { |
// So the plugin can query load status, we need to register our status |
@@ -554,6 +558,25 @@ |
enter.object()->GrantUniversalAccess(); |
} |
+void PPB_URLLoader_Proxy::OnReadCallback(int32_t result, |
+ IPC::Message* message) { |
+ int32_t bytes_read = 0; |
+ if (result > 0) |
+ bytes_read = result; // Positive results indicate bytes read. |
+ |
+ message->TrimWriteData(bytes_read); |
+ message->WriteInt(result); |
+ |
+ dispatcher()->Send(message); |
+} |
+ |
+void PPB_URLLoader_Proxy::OnCallback(int32_t result, |
+ const HostResource& resource) { |
+ dispatcher()->Send(new PpapiMsg_PPBURLLoader_CallbackComplete( |
+ API_ID_PPB_URL_LOADER, resource, result)); |
+} |
+#endif // !defined(OS_NACL) |
+ |
// Called in the Plugin. |
void PPB_URLLoader_Proxy::OnMsgUpdateProgress( |
const PPBURLLoader_UpdateProgress_Params& params) { |
@@ -602,23 +625,5 @@ |
static_cast<URLLoader*>(enter.object())->CallbackComplete(result); |
} |
-void PPB_URLLoader_Proxy::OnReadCallback(int32_t result, |
- IPC::Message* message) { |
- int32_t bytes_read = 0; |
- if (result > 0) |
- bytes_read = result; // Positive results indicate bytes read. |
- |
- message->TrimWriteData(bytes_read); |
- message->WriteInt(result); |
- |
- dispatcher()->Send(message); |
-} |
- |
-void PPB_URLLoader_Proxy::OnCallback(int32_t result, |
- const HostResource& resource) { |
- dispatcher()->Send(new PpapiMsg_PPBURLLoader_CallbackComplete( |
- API_ID_PPB_URL_LOADER, resource, result)); |
-} |
- |
} // namespace proxy |
} // namespace ppapi |