| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 6 #define CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // Schemes listed as disabled take precedence over Web-safe schemes. | 46 // Schemes listed as disabled take precedence over Web-safe schemes. |
| 47 virtual void RegisterDisabledSchemes( | 47 virtual void RegisterDisabledSchemes( |
| 48 const std::set<std::string>& schemes) = 0; | 48 const std::set<std::string>& schemes) = 0; |
| 49 | 49 |
| 50 // Grants certain permissions to a file. |permissions| must be a bit-set of | 50 // Grants certain permissions to a file. |permissions| must be a bit-set of |
| 51 // base::PlatformFileFlags. | 51 // base::PlatformFileFlags. |
| 52 virtual void GrantPermissionsForFile(int child_id, | 52 virtual void GrantPermissionsForFile(int child_id, |
| 53 const FilePath& file, | 53 const FilePath& file, |
| 54 int permissions) = 0; | 54 int permissions) = 0; |
| 55 | 55 |
| 56 // Before servicing a child process's request to upload a file to the web, the |
| 57 // browser should call this method to determine whether the process has the |
| 58 // capability to upload the requested file. |
| 59 virtual bool CanReadFile(int child_id, const FilePath& file) = 0; |
| 60 |
| 56 // Whenever the user picks a file from a <input type="file"> element, the | 61 // Whenever the user picks a file from a <input type="file"> element, the |
| 57 // browser should call this function to grant the child process the capability | 62 // browser should call this function to grant the child process the capability |
| 58 // to upload the file to the web. | 63 // to upload the file to the web. |
| 59 virtual void GrantReadFile(int child_id, const FilePath& file) = 0; | 64 virtual void GrantReadFile(int child_id, const FilePath& file) = 0; |
| 60 | 65 |
| 66 // Grants access permission to the given filesystem_id. |
| 67 virtual void GrantAccessFileSystem(int child_id, |
| 68 const std::string& filesystem_id) = 0; |
| 69 |
| 61 // Grants the child process the capability to access URLs of the provided | 70 // Grants the child process the capability to access URLs of the provided |
| 62 // scheme. | 71 // scheme. |
| 63 virtual void GrantScheme(int child_id, const std::string& scheme) = 0; | 72 virtual void GrantScheme(int child_id, const std::string& scheme) = 0; |
| 64 }; | 73 }; |
| 65 | 74 |
| 66 }; // namespace content | 75 }; // namespace content |
| 67 | 76 |
| 68 #endif // CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 77 #endif // CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
| OLD | NEW |