OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/c/pp_completion_callback.h" | 8 #include "ppapi/c/pp_completion_callback.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/ppb_url_loader.h" | 10 #include "ppapi/c/ppb_url_loader.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 loader_.reset(); | 235 loader_.reset(); |
236 } | 236 } |
237 } | 237 } |
238 | 238 |
239 int32_t PPB_URLLoader_Impl::Open(PPB_URLRequestInfo_Impl* request, | 239 int32_t PPB_URLLoader_Impl::Open(PPB_URLRequestInfo_Impl* request, |
240 PP_CompletionCallback callback) { | 240 PP_CompletionCallback callback) { |
241 int32_t rv = ValidateCallback(callback); | 241 int32_t rv = ValidateCallback(callback); |
242 if (rv != PP_OK) | 242 if (rv != PP_OK) |
243 return rv; | 243 return rv; |
244 | 244 |
| 245 if (request->RequiresUniversalAccess() && !has_universal_access_) |
| 246 return PP_ERROR_BADARGUMENT; |
| 247 |
245 if (loader_.get()) | 248 if (loader_.get()) |
246 return PP_ERROR_INPROGRESS; | 249 return PP_ERROR_INPROGRESS; |
247 | 250 |
248 WebFrame* frame = GetFrame(instance()); | 251 WebFrame* frame = GetFrame(instance()); |
249 if (!frame) | 252 if (!frame) |
250 return PP_ERROR_FAILED; | 253 return PP_ERROR_FAILED; |
251 WebURLRequest web_request(request->ToWebURLRequest(frame)); | 254 WebURLRequest web_request(request->ToWebURLRequest(frame)); |
252 | 255 |
253 rv = CanRequest(frame, web_request.url()); | 256 rv = CanRequest(frame, web_request.url()); |
254 if (rv != PP_OK) | 257 if (rv != PP_OK) |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 bool PPB_URLLoader_Impl::RecordDownloadProgress() const { | 539 bool PPB_URLLoader_Impl::RecordDownloadProgress() const { |
537 return request_info_ && request_info_->record_download_progress(); | 540 return request_info_ && request_info_->record_download_progress(); |
538 } | 541 } |
539 | 542 |
540 bool PPB_URLLoader_Impl::RecordUploadProgress() const { | 543 bool PPB_URLLoader_Impl::RecordUploadProgress() const { |
541 return request_info_ && request_info_->record_upload_progress(); | 544 return request_info_ && request_info_->record_upload_progress(); |
542 } | 545 } |
543 | 546 |
544 } // namespace ppapi | 547 } // namespace ppapi |
545 } // namespace webkit | 548 } // namespace webkit |
OLD | NEW |