| 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 "content/renderer/pepper/pepper_url_loader_host.h" | 5 #include "content/renderer/pepper/pepper_url_loader_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 9 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 10 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 10 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 DCHECK(instance_object->document_loader() == this); | 93 DCHECK(instance_object->document_loader() == this); |
| 94 instance_object->set_document_loader(NULL); | 94 instance_object->set_document_loader(NULL); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 // There is a path whereby the destructor for the loader_ member can | 98 // There is a path whereby the destructor for the loader_ member can |
| 99 // invoke InstanceWasDeleted() upon this URLLoaderResource, thereby | 99 // invoke InstanceWasDeleted() upon this URLLoaderResource, thereby |
| 100 // re-entering the scoped_ptr destructor with the same scoped_ptr object | 100 // re-entering the scoped_ptr destructor with the same scoped_ptr object |
| 101 // via loader_.reset(). Be sure that loader_ is first NULL then destroy | 101 // via loader_.reset(). Be sure that loader_ is first NULL then destroy |
| 102 // the scoped_ptr. See http://crbug.com/159429. | 102 // the scoped_ptr. See http://crbug.com/159429. |
| 103 scoped_ptr<blink::WebURLLoader> for_destruction_only(loader_.release()); | 103 std::unique_ptr<blink::WebURLLoader> for_destruction_only(loader_.release()); |
| 104 } | 104 } |
| 105 | 105 |
| 106 int32_t PepperURLLoaderHost::OnResourceMessageReceived( | 106 int32_t PepperURLLoaderHost::OnResourceMessageReceived( |
| 107 const IPC::Message& msg, | 107 const IPC::Message& msg, |
| 108 ppapi::host::HostMessageContext* context) { | 108 ppapi::host::HostMessageContext* context) { |
| 109 PPAPI_BEGIN_MESSAGE_MAP(PepperURLLoaderHost, msg) | 109 PPAPI_BEGIN_MESSAGE_MAP(PepperURLLoaderHost, msg) |
| 110 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_URLLoader_Open, | 110 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_URLLoader_Open, |
| 111 OnHostMsgOpen) | 111 OnHostMsgOpen) |
| 112 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_URLLoader_SetDeferLoading, | 112 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_URLLoader_SetDeferLoading, |
| 113 OnHostMsgSetDeferLoading) | 113 OnHostMsgSetDeferLoading) |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 ppapi::proxy::ResourceMessageReplyParams params; | 435 ppapi::proxy::ResourceMessageReplyParams params; |
| 436 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( | 436 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( |
| 437 record_upload ? bytes_sent_ : -1, | 437 record_upload ? bytes_sent_ : -1, |
| 438 record_upload ? total_bytes_to_be_sent_ : -1, | 438 record_upload ? total_bytes_to_be_sent_ : -1, |
| 439 record_download ? bytes_received_ : -1, | 439 record_download ? bytes_received_ : -1, |
| 440 record_download ? total_bytes_to_be_received_ : -1)); | 440 record_download ? total_bytes_to_be_received_ : -1)); |
| 441 } | 441 } |
| 442 } | 442 } |
| 443 | 443 |
| 444 } // namespace content | 444 } // namespace content |
| OLD | NEW |