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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 return PP_ERROR_NOACCESS; | 142 return PP_ERROR_NOACCESS; |
143 } | 143 } |
144 | 144 |
145 if (loader_.get()) | 145 if (loader_.get()) |
146 return PP_ERROR_INPROGRESS; | 146 return PP_ERROR_INPROGRESS; |
147 | 147 |
148 WebFrame* frame = GetFrameForResource(this); | 148 WebFrame* frame = GetFrameForResource(this); |
149 if (!frame) | 149 if (!frame) |
150 return PP_ERROR_FAILED; | 150 return PP_ERROR_FAILED; |
151 WebURLRequest web_request; | 151 WebURLRequest web_request; |
152 if (!CreateWebURLRequest(&filled_in_request_data, frame, &web_request)) | 152 if (!CreateWebURLRequest(pp_instance(), &filled_in_request_data, frame, |
| 153 &web_request)) |
153 return PP_ERROR_FAILED; | 154 return PP_ERROR_FAILED; |
154 web_request.setRequestorProcessID(requestor_pid); | 155 web_request.setRequestorProcessID(requestor_pid); |
155 | 156 |
156 // Save a copy of the request info so the plugin can continue to use and | 157 // Save a copy of the request info so the plugin can continue to use and |
157 // change it while we're doing the request without affecting us. We must do | 158 // change it while we're doing the request without affecting us. We must do |
158 // this after CreateWebURLRequest since that fills out the file refs. | 159 // this after CreateWebURLRequest since that fills out the file refs. |
159 request_data_ = filled_in_request_data; | 160 request_data_ = filled_in_request_data; |
160 | 161 |
161 WebURLLoaderOptions options; | 162 WebURLLoaderOptions options; |
162 if (has_universal_access_) { | 163 if (has_universal_access_) { |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 bool PPB_URLLoader_Impl::RecordDownloadProgress() const { | 539 bool PPB_URLLoader_Impl::RecordDownloadProgress() const { |
539 return request_data_.record_download_progress; | 540 return request_data_.record_download_progress; |
540 } | 541 } |
541 | 542 |
542 bool PPB_URLLoader_Impl::RecordUploadProgress() const { | 543 bool PPB_URLLoader_Impl::RecordUploadProgress() const { |
543 return request_data_.record_upload_progress; | 544 return request_data_.record_upload_progress; |
544 } | 545 } |
545 | 546 |
546 } // namespace ppapi | 547 } // namespace ppapi |
547 } // namespace webkit | 548 } // namespace webkit |
OLD | NEW |