OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/proxy/url_loader_resource.h" | 5 #include "ppapi/proxy/url_loader_resource.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ppapi/c/pp_completion_callback.h" | 8 #include "ppapi/c/pp_completion_callback.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/ppb_url_loader.h" | 10 #include "ppapi/c/ppb_url_loader.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 228 } |
229 | 229 |
230 void URLLoaderResource::RegisterStatusCallback( | 230 void URLLoaderResource::RegisterStatusCallback( |
231 PP_URLLoaderTrusted_StatusCallback callback) { | 231 PP_URLLoaderTrusted_StatusCallback callback) { |
232 status_callback_ = callback; | 232 status_callback_ = callback; |
233 } | 233 } |
234 | 234 |
235 void URLLoaderResource::OnReplyReceived( | 235 void URLLoaderResource::OnReplyReceived( |
236 const ResourceMessageReplyParams& params, | 236 const ResourceMessageReplyParams& params, |
237 const IPC::Message& msg) { | 237 const IPC::Message& msg) { |
238 IPC_BEGIN_MESSAGE_MAP(URLLoaderResource, msg) | 238 PPAPI_BEGIN_MESSAGE_MAP(URLLoaderResource, msg) |
239 case PpapiPluginMsg_URLLoader_SendData::ID: | 239 case PpapiPluginMsg_URLLoader_SendData::ID: |
240 // Special message, manually dispatch since we don't want the automatic | 240 // Special message, manually dispatch since we don't want the automatic |
241 // unpickling. | 241 // unpickling. |
242 OnPluginMsgSendData(params, msg); | 242 OnPluginMsgSendData(params, msg); |
243 break; | 243 break; |
244 | 244 |
245 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( | 245 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( |
246 PpapiPluginMsg_URLLoader_ReceivedResponse, | 246 PpapiPluginMsg_URLLoader_ReceivedResponse, |
247 OnPluginMsgReceivedResponse) | 247 OnPluginMsgReceivedResponse) |
248 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( | 248 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( |
249 PpapiPluginMsg_URLLoader_FinishedLoading, | 249 PpapiPluginMsg_URLLoader_FinishedLoading, |
250 OnPluginMsgFinishedLoading) | 250 OnPluginMsgFinishedLoading) |
251 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( | 251 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( |
252 PpapiPluginMsg_URLLoader_UpdateProgress, | 252 PpapiPluginMsg_URLLoader_UpdateProgress, |
253 OnPluginMsgUpdateProgress) | 253 OnPluginMsgUpdateProgress) |
254 IPC_END_MESSAGE_MAP() | 254 PPAPI_END_MESSAGE_MAP() |
255 } | 255 } |
256 | 256 |
257 void URLLoaderResource::OnPluginMsgReceivedResponse( | 257 void URLLoaderResource::OnPluginMsgReceivedResponse( |
258 const ResourceMessageReplyParams& params, | 258 const ResourceMessageReplyParams& params, |
259 const URLResponseInfoData& data) { | 259 const URLResponseInfoData& data) { |
260 SaveResponseInfo(data); | 260 SaveResponseInfo(data); |
261 RunCallback(PP_OK); | 261 RunCallback(PP_OK); |
262 } | 262 } |
263 | 263 |
264 void URLLoaderResource::OnPluginMsgSendData( | 264 void URLLoaderResource::OnPluginMsgSendData( |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 } | 391 } |
392 | 392 |
393 // Reset for next time. | 393 // Reset for next time. |
394 user_buffer_ = NULL; | 394 user_buffer_ = NULL; |
395 user_buffer_size_ = 0; | 395 user_buffer_size_ = 0; |
396 return bytes_to_copy; | 396 return bytes_to_copy; |
397 } | 397 } |
398 | 398 |
399 } // namespace proxy | 399 } // namespace proxy |
400 } // namespace ppapi | 400 } // namespace ppapi |
OLD | NEW |