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 "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 void URLLoaderResource::OnPluginMsgReceivedResponse( | 258 void URLLoaderResource::OnPluginMsgReceivedResponse( |
259 const ResourceMessageReplyParams& params, | 259 const ResourceMessageReplyParams& params, |
260 const URLResponseInfoData& data) { | 260 const URLResponseInfoData& data) { |
261 SaveResponseInfo(data); | 261 SaveResponseInfo(data); |
262 RunCallback(PP_OK); | 262 RunCallback(PP_OK); |
263 } | 263 } |
264 | 264 |
265 void URLLoaderResource::OnPluginMsgSendData( | 265 void URLLoaderResource::OnPluginMsgSendData( |
266 const ResourceMessageReplyParams& params, | 266 const ResourceMessageReplyParams& params, |
267 const IPC::Message& message) { | 267 const IPC::Message& message) { |
268 PickleIterator iter(message); | 268 base::PickleIterator iter(message); |
269 const char* data; | 269 const char* data; |
270 int data_length; | 270 int data_length; |
271 if (!iter.ReadData(&data, &data_length)) { | 271 if (!iter.ReadData(&data, &data_length)) { |
272 NOTREACHED() << "Expecting data"; | 272 NOTREACHED() << "Expecting data"; |
273 return; | 273 return; |
274 } | 274 } |
275 | 275 |
276 mode_ = MODE_STREAMING_DATA; | 276 mode_ = MODE_STREAMING_DATA; |
277 buffer_.insert(buffer_.end(), data, data + data_length); | 277 buffer_.insert(buffer_.end(), data, data + data_length); |
278 | 278 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 } | 392 } |
393 | 393 |
394 // Reset for next time. | 394 // Reset for next time. |
395 user_buffer_ = NULL; | 395 user_buffer_ = NULL; |
396 user_buffer_size_ = 0; | 396 user_buffer_size_ = 0; |
397 return base::checked_cast<int32_t>(bytes_to_copy); | 397 return base::checked_cast<int32_t>(bytes_to_copy); |
398 } | 398 } |
399 | 399 |
400 } // namespace proxy | 400 } // namespace proxy |
401 } // namespace ppapi | 401 } // namespace ppapi |
OLD | NEW |