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 "content/renderer/pepper/pepper_plugin_instance_impl.h" | 7 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
8 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 8 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
9 #include "content/renderer/pepper/url_request_info_util.h" | 9 #include "content/renderer/pepper/url_request_info_util.h" |
10 #include "content/renderer/pepper/url_response_info_util.h" | 10 #include "content/renderer/pepper/url_response_info_util.h" |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 pending_replies_.push_back(message); | 354 pending_replies_.push_back(message); |
355 } else { | 355 } else { |
356 host()->SendUnsolicitedReply(pp_resource(), *message); | 356 host()->SendUnsolicitedReply(pp_resource(), *message); |
357 delete message; | 357 delete message; |
358 } | 358 } |
359 } | 359 } |
360 | 360 |
361 void PepperURLLoaderHost::Close() { | 361 void PepperURLLoaderHost::Close() { |
362 if (loader_.get()) | 362 if (loader_.get()) |
363 loader_->cancel(); | 363 loader_->cancel(); |
364 else if (main_document_loader_) { | 364 else if (main_document_loader_) |
365 blink::WebFrame* frame = GetFrame(); | 365 GetFrame()->stopLoading(); |
366 if (frame) | |
367 frame->stopLoading(); | |
368 } | |
369 } | 366 } |
370 | 367 |
371 blink::WebLocalFrame* PepperURLLoaderHost::GetFrame() { | 368 blink::WebLocalFrame* PepperURLLoaderHost::GetFrame() { |
372 PepperPluginInstance* instance_object = | 369 PepperPluginInstance* instance_object = |
373 renderer_ppapi_host_->GetPluginInstance(pp_instance()); | 370 renderer_ppapi_host_->GetPluginInstance(pp_instance()); |
374 if (!instance_object) | 371 if (!instance_object) |
375 return NULL; | 372 return NULL; |
376 return instance_object->GetContainer()->element().document().frame(); | 373 return instance_object->GetContainer()->element().document().frame(); |
377 } | 374 } |
378 | 375 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 ppapi::proxy::ResourceMessageReplyParams params; | 420 ppapi::proxy::ResourceMessageReplyParams params; |
424 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( | 421 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( |
425 record_upload ? bytes_sent_ : -1, | 422 record_upload ? bytes_sent_ : -1, |
426 record_upload ? total_bytes_to_be_sent_ : -1, | 423 record_upload ? total_bytes_to_be_sent_ : -1, |
427 record_download ? bytes_received_ : -1, | 424 record_download ? bytes_received_ : -1, |
428 record_download ? total_bytes_to_be_received_ : -1)); | 425 record_download ? total_bytes_to_be_received_ : -1)); |
429 } | 426 } |
430 } | 427 } |
431 | 428 |
432 } // namespace content | 429 } // namespace content |
OLD | NEW |