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

Unified Diff: ppapi/proxy/ppb_url_loader_proxy.cc

Issue 11094060: Exclude host-side code from the NaCl IRT proxy build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 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

Powered by Google App Engine
This is Rietveld 408576698