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

Unified Diff: content/browser/fileapi/browser_file_system_helper.h

Issue 2830743004: Extracting and unittesting PrepareDropDataForChildProcess function. (Closed)
Patch Set: Readding a summary comment to PrepareDropDataForChildProcess as suggested in the CR feedback... (it… Created 3 years, 8 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 | « no previous file | content/browser/fileapi/browser_file_system_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/fileapi/browser_file_system_helper.h
diff --git a/content/browser/fileapi/browser_file_system_helper.h b/content/browser/fileapi/browser_file_system_helper.h
index c5702e73281631e88d65107a64ded88381796c68..b9679f9ea074e3b87c48b8a6c14d664976d3c1c8 100644
--- a/content/browser/fileapi/browser_file_system_helper.h
+++ b/content/browser/fileapi/browser_file_system_helper.h
@@ -17,6 +17,8 @@ class FileSystemURL;
namespace content {
class BrowserContext;
+class ChildProcessSecurityPolicyImpl;
+struct DropData;
// Helper method that returns FileSystemContext constructed for
// the browser process.
@@ -36,6 +38,24 @@ CONTENT_EXPORT void SyncGetPlatformPath(storage::FileSystemContext* context,
int process_id,
const GURL& path,
base::FilePath* platform_path);
+
+// Make it possible for a |drop_data|'s resources to be read by |child_id|'s
+// process -- by granting permissions, rewriting |drop_data|, or both.
+//
+// |drop_data| can include references to local files and filesystem files that
+// were accessible to the child process that is the source of the drag and drop,
+// but might not (yet) be accessible to the child process that is the target of
+// the drop. PrepareDropDataForChildProcess makes sure that |child_id| has
+// access to files referred to by |drop_data| - this method will 1) mutate
+// |drop_data| as needed (e.g. to refer to files in a new isolated filesystem,
+// rather than the original filesystem files) and 2) use |security_policy| to
+// grant |child_id| appropriate file access.
+CONTENT_EXPORT void PrepareDropDataForChildProcess(
+ DropData* drop_data,
+ ChildProcessSecurityPolicyImpl* security_policy,
+ int child_id,
+ const storage::FileSystemContext* file_system_context);
+
} // namespace content
#endif // CONTENT_BROWSER_FILEAPI_BROWSER_FILE_SYSTEM_HELPER_H_
« no previous file with comments | « no previous file | content/browser/fileapi/browser_file_system_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698