| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/glue/plugins/pepper_url_loader.h" | 5 #include "webkit/glue/plugins/pepper_url_loader.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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // static | 207 // static |
| 208 const PPB_URLLoader* URLLoader::GetInterface() { | 208 const PPB_URLLoader* URLLoader::GetInterface() { |
| 209 return &ppb_urlloader; | 209 return &ppb_urlloader; |
| 210 } | 210 } |
| 211 | 211 |
| 212 // static | 212 // static |
| 213 const PPB_URLLoaderTrusted* URLLoader::GetTrustedInterface() { | 213 const PPB_URLLoaderTrusted* URLLoader::GetTrustedInterface() { |
| 214 return &ppb_urlloadertrusted; | 214 return &ppb_urlloadertrusted; |
| 215 } | 215 } |
| 216 | 216 |
| 217 URLLoader* URLLoader::AsURLLoader() { |
| 218 return this; |
| 219 } |
| 220 |
| 217 int32_t URLLoader::Open(URLRequestInfo* request, | 221 int32_t URLLoader::Open(URLRequestInfo* request, |
| 218 PP_CompletionCallback callback) { | 222 PP_CompletionCallback callback) { |
| 219 if (loader_.get()) | 223 if (loader_.get()) |
| 220 return PP_ERROR_INPROGRESS; | 224 return PP_ERROR_INPROGRESS; |
| 221 | 225 |
| 222 // We only support non-blocking calls. | 226 // We only support non-blocking calls. |
| 223 if (!callback.func) | 227 if (!callback.func) |
| 224 return PP_ERROR_BADARGUMENT; | 228 return PP_ERROR_BADARGUMENT; |
| 225 | 229 |
| 226 WebFrame* frame = GetFrame(instance_); | 230 WebFrame* frame = GetFrame(instance_); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 | 527 |
| 524 bool URLLoader::RecordDownloadProgress() const { | 528 bool URLLoader::RecordDownloadProgress() const { |
| 525 return request_info_ && request_info_->record_download_progress(); | 529 return request_info_ && request_info_->record_download_progress(); |
| 526 } | 530 } |
| 527 | 531 |
| 528 bool URLLoader::RecordUploadProgress() const { | 532 bool URLLoader::RecordUploadProgress() const { |
| 529 return request_info_ && request_info_->record_upload_progress(); | 533 return request_info_ && request_info_->record_upload_progress(); |
| 530 } | 534 } |
| 531 | 535 |
| 532 } // namespace pepper | 536 } // namespace pepper |
| OLD | NEW |