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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 return PP_OK_COMPLETIONPENDING; | 212 return PP_OK_COMPLETIONPENDING; |
213 } | 213 } |
214 | 214 |
215 void URLLoaderResource::Close() { | 215 void URLLoaderResource::Close() { |
216 mode_ = MODE_LOAD_COMPLETE; | 216 mode_ = MODE_LOAD_COMPLETE; |
217 done_status_ = PP_ERROR_ABORTED; | 217 done_status_ = PP_ERROR_ABORTED; |
218 | 218 |
219 Post(RENDERER, PpapiHostMsg_URLLoader_Close()); | 219 Post(RENDERER, PpapiHostMsg_URLLoader_Close()); |
220 | 220 |
221 // Abort the callbacks, the plugin doesn't want to be called back after this. | 221 // Abort the callbacks, the plugin doesn't want to be called back after this. |
222 // TODO(brettw) this should fix bug 69457, mark it fixed. ============ | |
223 if (TrackedCallback::IsPending(pending_callback_)) | 222 if (TrackedCallback::IsPending(pending_callback_)) |
224 pending_callback_->PostAbort(); | 223 pending_callback_->PostAbort(); |
225 } | 224 } |
226 | 225 |
227 void URLLoaderResource::GrantUniversalAccess() { | 226 void URLLoaderResource::GrantUniversalAccess() { |
228 Post(RENDERER, PpapiHostMsg_URLLoader_GrantUniversalAccess()); | 227 Post(RENDERER, PpapiHostMsg_URLLoader_GrantUniversalAccess()); |
229 } | 228 } |
230 | 229 |
231 void URLLoaderResource::RegisterStatusCallback( | 230 void URLLoaderResource::RegisterStatusCallback( |
232 PP_URLLoaderTrusted_StatusCallback callback) { | 231 PP_URLLoaderTrusted_StatusCallback callback) { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 } | 391 } |
393 | 392 |
394 // Reset for next time. | 393 // Reset for next time. |
395 user_buffer_ = NULL; | 394 user_buffer_ = NULL; |
396 user_buffer_size_ = 0; | 395 user_buffer_size_ = 0; |
397 return base::checked_cast<int32_t>(bytes_to_copy); | 396 return base::checked_cast<int32_t>(bytes_to_copy); |
398 } | 397 } |
399 | 398 |
400 } // namespace proxy | 399 } // namespace proxy |
401 } // namespace ppapi | 400 } // namespace ppapi |
OLD | NEW |