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 GetFrame()->stopLoading(); | 365 blink::WebFrame* frame = GetFrame(); |
| 366 if (frame) |
| 367 frame->stopLoading(); |
| 368 } |
366 } | 369 } |
367 | 370 |
368 blink::WebLocalFrame* PepperURLLoaderHost::GetFrame() { | 371 blink::WebLocalFrame* PepperURLLoaderHost::GetFrame() { |
369 PepperPluginInstance* instance_object = | 372 PepperPluginInstance* instance_object = |
370 renderer_ppapi_host_->GetPluginInstance(pp_instance()); | 373 renderer_ppapi_host_->GetPluginInstance(pp_instance()); |
371 if (!instance_object) | 374 if (!instance_object) |
372 return NULL; | 375 return NULL; |
373 return instance_object->GetContainer()->element().document().frame(); | 376 return instance_object->GetContainer()->element().document().frame(); |
374 } | 377 } |
375 | 378 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 ppapi::proxy::ResourceMessageReplyParams params; | 423 ppapi::proxy::ResourceMessageReplyParams params; |
421 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( | 424 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( |
422 record_upload ? bytes_sent_ : -1, | 425 record_upload ? bytes_sent_ : -1, |
423 record_upload ? total_bytes_to_be_sent_ : -1, | 426 record_upload ? total_bytes_to_be_sent_ : -1, |
424 record_download ? bytes_received_ : -1, | 427 record_download ? bytes_received_ : -1, |
425 record_download ? total_bytes_to_be_received_ : -1)); | 428 record_download ? total_bytes_to_be_received_ : -1)); |
426 } | 429 } |
427 } | 430 } |
428 | 431 |
429 } // namespace content | 432 } // namespace content |
OLD | NEW |