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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0( | 116 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0( |
117 PpapiHostMsg_URLLoader_GrantUniversalAccess, | 117 PpapiHostMsg_URLLoader_GrantUniversalAccess, |
118 OnHostMsgGrantUniversalAccess) | 118 OnHostMsgGrantUniversalAccess) |
119 PPAPI_END_MESSAGE_MAP() | 119 PPAPI_END_MESSAGE_MAP() |
120 return PP_ERROR_FAILED; | 120 return PP_ERROR_FAILED; |
121 } | 121 } |
122 | 122 |
123 void PepperURLLoaderHost::willFollowRedirect( | 123 void PepperURLLoaderHost::willFollowRedirect( |
124 WebURLLoader* loader, | 124 WebURLLoader* loader, |
125 WebURLRequest& new_request, | 125 WebURLRequest& new_request, |
126 const WebURLResponse& redirect_response) { | 126 const WebURLResponse& redirect_response, |
127 int64_t encodedDataLength) { | |
kinuko
2016/06/28 15:35:07
encoded_data_length
Adam Rice
2016/06/29 09:52:15
Done.
| |
127 DCHECK(out_of_order_replies_.empty()); | 128 DCHECK(out_of_order_replies_.empty()); |
128 if (!request_data_.follow_redirects) { | 129 if (!request_data_.follow_redirects) { |
129 SaveResponse(redirect_response); | 130 SaveResponse(redirect_response); |
130 SetDefersLoading(true); | 131 SetDefersLoading(true); |
131 } | 132 } |
132 } | 133 } |
133 | 134 |
134 void PepperURLLoaderHost::didSendData( | 135 void PepperURLLoaderHost::didSendData( |
135 WebURLLoader* loader, | 136 WebURLLoader* loader, |
136 unsigned long long bytes_sent, | 137 unsigned long long bytes_sent, |
(...skipping 16 matching lines...) Expand all Loading... | |
153 void PepperURLLoaderHost::didDownloadData(WebURLLoader* loader, | 154 void PepperURLLoaderHost::didDownloadData(WebURLLoader* loader, |
154 int data_length, | 155 int data_length, |
155 int encoded_data_length) { | 156 int encoded_data_length) { |
156 bytes_received_ += data_length; | 157 bytes_received_ += data_length; |
157 UpdateProgress(); | 158 UpdateProgress(); |
158 } | 159 } |
159 | 160 |
160 void PepperURLLoaderHost::didReceiveData(WebURLLoader* loader, | 161 void PepperURLLoaderHost::didReceiveData(WebURLLoader* loader, |
161 const char* data, | 162 const char* data, |
162 int data_length, | 163 int data_length, |
163 int encoded_data_length) { | 164 int encoded_data_length, |
165 int encoded_body_length) { | |
164 // Note that |loader| will be NULL for document loads. | 166 // Note that |loader| will be NULL for document loads. |
165 bytes_received_ += data_length; | 167 bytes_received_ += data_length; |
166 UpdateProgress(); | 168 UpdateProgress(); |
167 | 169 |
168 PpapiPluginMsg_URLLoader_SendData* message = | 170 PpapiPluginMsg_URLLoader_SendData* message = |
169 new PpapiPluginMsg_URLLoader_SendData; | 171 new PpapiPluginMsg_URLLoader_SendData; |
170 message->WriteData(data, data_length); | 172 message->WriteData(data, data_length); |
171 SendUpdateToPlugin(message); | 173 SendUpdateToPlugin(message); |
172 } | 174 } |
173 | 175 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
435 ppapi::proxy::ResourceMessageReplyParams params; | 437 ppapi::proxy::ResourceMessageReplyParams params; |
436 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( | 438 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( |
437 record_upload ? bytes_sent_ : -1, | 439 record_upload ? bytes_sent_ : -1, |
438 record_upload ? total_bytes_to_be_sent_ : -1, | 440 record_upload ? total_bytes_to_be_sent_ : -1, |
439 record_download ? bytes_received_ : -1, | 441 record_download ? bytes_received_ : -1, |
440 record_download ? total_bytes_to_be_received_ : -1)); | 442 record_download ? total_bytes_to_be_received_ : -1)); |
441 } | 443 } |
442 } | 444 } |
443 | 445 |
444 } // namespace content | 446 } // namespace content |
OLD | NEW |