OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/plugins/ppapi/ppb_url_loader_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 user_buffer_(NULL), | 78 user_buffer_(NULL), |
79 user_buffer_size_(0), | 79 user_buffer_size_(0), |
80 done_status_(PP_OK_COMPLETIONPENDING), | 80 done_status_(PP_OK_COMPLETIONPENDING), |
81 is_streaming_to_file_(false), | 81 is_streaming_to_file_(false), |
82 is_asynchronous_load_suspended_(false), | 82 is_asynchronous_load_suspended_(false), |
83 has_universal_access_(false), | 83 has_universal_access_(false), |
84 status_callback_(NULL) { | 84 status_callback_(NULL) { |
85 } | 85 } |
86 | 86 |
87 PPB_URLLoader_Impl::~PPB_URLLoader_Impl() { | 87 PPB_URLLoader_Impl::~PPB_URLLoader_Impl() { |
| 88 // There is a path whereby the destructor for the loader_ member can |
| 89 // invoke InstanceWasDeleted() upon this PPB_URLLoader_Impl, thereby |
| 90 // re-entering the scoped_ptr destructor with the same scoped_ptr object |
| 91 // via loader_.reset(). Be sure that loader_ is first NULL then destroy |
| 92 // the scoped_ptr. See http://crbug.com/159429. |
| 93 scoped_ptr<WebKit::WebURLLoader> for_destruction_only(loader_.release()); |
88 } | 94 } |
89 | 95 |
90 PPB_URLLoader_API* PPB_URLLoader_Impl::AsPPB_URLLoader_API() { | 96 PPB_URLLoader_API* PPB_URLLoader_Impl::AsPPB_URLLoader_API() { |
91 return this; | 97 return this; |
92 } | 98 } |
93 | 99 |
94 void PPB_URLLoader_Impl::InstanceWasDeleted() { | 100 void PPB_URLLoader_Impl::InstanceWasDeleted() { |
95 Resource::InstanceWasDeleted(); | 101 Resource::InstanceWasDeleted(); |
96 loader_.reset(); | 102 loader_.reset(); |
97 } | 103 } |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 bool PPB_URLLoader_Impl::RecordDownloadProgress() const { | 503 bool PPB_URLLoader_Impl::RecordDownloadProgress() const { |
498 return request_data_.record_download_progress; | 504 return request_data_.record_download_progress; |
499 } | 505 } |
500 | 506 |
501 bool PPB_URLLoader_Impl::RecordUploadProgress() const { | 507 bool PPB_URLLoader_Impl::RecordUploadProgress() const { |
502 return request_data_.record_upload_progress; | 508 return request_data_.record_upload_progress; |
503 } | 509 } |
504 | 510 |
505 } // namespace ppapi | 511 } // namespace ppapi |
506 } // namespace webkit | 512 } // namespace webkit |
OLD | NEW |