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

Unified Diff: content/browser/renderer_host/render_view_host.cc

Issue 6623015: Add a path for a web page to request the enumeration of a directory. This, t... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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
« no previous file with comments | « content/browser/renderer_host/render_view_host.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_view_host.cc
===================================================================
--- content/browser/renderer_host/render_view_host.cc (revision 79702)
+++ content/browser/renderer_host/render_view_host.cc (working copy)
@@ -463,6 +463,10 @@
policy->GrantRequestURL(process()->id(),
net::FilePathToFileURL(path));
policy->GrantReadFile(process()->id(), path);
+
+ // Allow dragged directories to be enumerated by the child process.
+ // Note that we can't tell a file from a directory at this point.
+ policy->GrantReadDirectory(process()->id(), path);
}
Send(new DragMsg_TargetDragEnter(routing_id(), drop_data, client_pt,
screen_pt, operations_allowed));
@@ -685,6 +689,20 @@
Send(new ViewMsg_RunFileChooserResponse(routing_id(), files));
}
+void RenderViewHost::DirectoryEnumerationFinished(
+ int request_id,
+ const std::vector<FilePath>& files) {
+ // Grant the security access requested to the given files.
+ for (std::vector<FilePath>::const_iterator file = files.begin();
+ file != files.end(); ++file) {
+ ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(
+ process()->id(), *file);
+ }
+ Send(new ViewMsg_EnumerateDirectoryResponse(routing_id(),
+ request_id,
+ files));
+}
+
void RenderViewHost::LoadStateChanged(const GURL& url,
net::LoadState load_state,
uint64 upload_position,
« no previous file with comments | « content/browser/renderer_host/render_view_host.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698