Chromium Code Reviews| Index: content/renderer/pepper/pepper_file_io_host.cc |
| diff --git a/content/renderer/pepper/pepper_file_io_host.cc b/content/renderer/pepper/pepper_file_io_host.cc |
| index b96edf509826d4d4d202f2ba8dd1a70495666792..98c1ac823339ab6a6b2edeedb3e16fb3dc9a19eb 100644 |
| --- a/content/renderer/pepper/pepper_file_io_host.cc |
| +++ b/content/renderer/pepper/pepper_file_io_host.cc |
| @@ -112,6 +112,7 @@ PepperFileIOHost::PepperFileIOHost(RendererPpapiHost* host, |
| : ResourceHost(host->GetPpapiHost(), instance, resource), |
| file_(base::kInvalidPlatformFileValue), |
| file_system_type_(PP_FILESYSTEMTYPE_INVALID), |
| + quota_limit_type_(quota::kQuotaLimitTypeUnknown), |
| is_running_in_process_(host->IsRunningInProcess()), |
| weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| // TODO(victorhsieh): eliminate plugin_delegate_ as it's no longer needed. |
| @@ -454,13 +455,13 @@ int32_t PepperFileIOHost::OnHostMsgWillSetLength( |
| int32_t PepperFileIOHost::OnHostMsgRequestOSFileHandle( |
| ppapi::host::HostMessageContext* context) { |
| if (!is_running_in_process_ && |
| + quota_limit_type_ != quota::kQuotaLimitTypeUnlimited && |
| + // TODO(hamaji): Remove the whitelist once it turned out the |
| + // quota check is sufficient. http://crbug.com/226386 |
| !GetContentClient()->renderer()->IsRequestOSFileHandleAllowedForURL( |
| file_system_url_)) |
| return PP_ERROR_FAILED; |
| - // TODO(hamaji): Should fail if quota is not unlimited. |
| - // http://crbug.com/224123 |
| - |
| RendererPpapiHost* renderer_ppapi_host = |
| RendererPpapiHost::GetForPPInstance(pp_instance()); |
| @@ -533,9 +534,11 @@ void PepperFileIOHost::ExecutePlatformOpenFileSystemURLCallback( |
| ppapi::host::ReplyMessageContext reply_context, |
| base::PlatformFileError error_code, |
| base::PassPlatformFile file, |
| + quota::QuotaLimitType quota_limit_type, |
| const PluginDelegate::NotifyCloseFileCallback& callback) { |
| if (error_code == base::PLATFORM_FILE_OK) |
| notify_close_file_callback_ = callback; |
| + //quota_limit_type_ = quota_limit_type; |
|
kinuko
2013/04/04 11:01:42
need to comment this in?
hamaji
2013/04/04 11:50:12
Wow :) Done.
|
| ExecutePlatformOpenFileCallback(reply_context, error_code, file); |
| } |