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

Unified Diff: chrome/browser/renderer_host/resource_message_filter.cc

Issue 3431032: Change ChildProcessSecurityPolicy to store a list of allowed flags for... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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: chrome/browser/renderer_host/resource_message_filter.cc
===================================================================
--- chrome/browser/renderer_host/resource_message_filter.cc (revision 60709)
+++ chrome/browser/renderer_host/resource_message_filter.cc (working copy)
@@ -1449,7 +1449,7 @@
IPC::Message* reply_msg) {
// Get file size only when the child process has been granted permission to
// upload the file.
- if (!ChildProcessSecurityPolicy::GetInstance()->CanUploadFile(id(), path)) {
+ if (!ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) {
ViewHostMsg_GetFileSize::WriteReplyParams(
reply_msg, static_cast<int64>(-1));
Send(reply_msg);
@@ -1469,7 +1469,7 @@
IPC::Message* reply_msg) {
// Get file modification time only when the child process has been granted
// permission to upload the file.
- if (!ChildProcessSecurityPolicy::GetInstance()->CanUploadFile(id(), path)) {
+ if (!ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) {
ViewHostMsg_GetFileModificationTime::WriteReplyParams(reply_msg,
base::Time());
Send(reply_msg);
@@ -1508,7 +1508,7 @@
// Open the file only when the child process has been granted permission to
// upload the file.
// TODO(jianli): Do we need separate permission to control opening the file?
- if (!ChildProcessSecurityPolicy::GetInstance()->CanUploadFile(id(), path)) {
+ if (!ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) {
ViewHostMsg_OpenFile::WriteReplyParams(
reply_msg,
#if defined(OS_WIN)
@@ -1702,7 +1702,7 @@
int message_id) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
- if (!ChildProcessSecurityPolicy::GetInstance()->CanUploadFile(id(), path)) {
+ if (!ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) {
IPC::Message* reply = new ViewMsg_AsyncOpenFile_ACK(
msg.routing_id(), base::PLATFORM_FILE_ERROR_ACCESS_DENIED,
IPC::InvalidPlatformFileForTransit(), message_id);

Powered by Google App Engine
This is Rietveld 408576698