Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(647)

Unified Diff: content/browser/renderer_host/pepper/pepper_external_file_ref_backend.cc

Issue 19770009: PepperFileRefHost: Port to use explicit permission grants in ChildProcessSecurityPolicy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0044-write-support-remove-child-process-security-policy-bitmask-usage
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/pepper/pepper_external_file_ref_backend.cc
diff --git a/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.cc b/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.cc
index 6b12a32ddf424940aa38c64b651548a887236d0d..a5191cf82d3ec784cba2982a5dd02e9da0811bd2 100644
--- a/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.cc
+++ b/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.cc
@@ -105,10 +105,26 @@ base::FilePath PepperExternalFileRefBackend::GetExternalPath() const {
return path_;
}
-int32_t PepperExternalFileRefBackend::HasPermissions(
- int permissions) const {
- if (!ChildProcessSecurityPolicyImpl::GetInstance()->HasPermissionsForFile(
- render_process_id_, path_, permissions)) {
+
Tom Sepez 2013/07/19 18:39:28 nit: extra blank line.
tommycli 2013/07/23 21:12:35 Done.
+int32_t PepperExternalFileRefBackend::CanRead() const {
+ if (!ChildProcessSecurityPolicyImpl::GetInstance()->
+ CanReadFile(render_process_id_, path_)) {
+ return PP_ERROR_NOACCESS;
+ }
+ return PP_OK;
+}
+
+int32_t PepperExternalFileRefBackend::CanWrite() const {
+ if (!ChildProcessSecurityPolicyImpl::GetInstance()->
+ CanWriteFile(render_process_id_, path_)) {
+ return PP_ERROR_NOACCESS;
+ }
+ return PP_OK;
+}
+
+int32_t PepperExternalFileRefBackend::CanCreate() const {
+ if (!ChildProcessSecurityPolicyImpl::GetInstance()->
+ CanCreateFile(render_process_id_, path_)) {
return PP_ERROR_NOACCESS;
}
return PP_OK;

Powered by Google App Engine
This is Rietveld 408576698