Chromium Code Reviews| 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_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
| 6 #define CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 6 #define CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
| 7 | 7 |
| 8 #pragma once | 8 #pragma once |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 void GrantRequestURL(int child_id, const GURL& url); | 71 void GrantRequestURL(int child_id, const GURL& url); |
| 72 | 72 |
| 73 // Grants the child process permission to enumerate all the files in | 73 // Grants the child process permission to enumerate all the files in |
| 74 // this directory and read those files. | 74 // this directory and read those files. |
| 75 void GrantReadDirectory(int child_id, const FilePath& directory); | 75 void GrantReadDirectory(int child_id, const FilePath& directory); |
| 76 | 76 |
| 77 // Revokes all permissions granted to the given file. | 77 // Revokes all permissions granted to the given file. |
| 78 void RevokeAllPermissionsForFile(int child_id, const FilePath& file); | 78 void RevokeAllPermissionsForFile(int child_id, const FilePath& file); |
| 79 | 79 |
| 80 // Grants access permission to the given filesystem_id. | 80 // Grants access permission to the given filesystem_id. |
| 81 void GrantAccessFileSystem(int child_id, const std::string& filesystem_id); | 81 virtual void GrantAccessFileSystem(int child_id, |
| 82 const std::string& filesystem_id) OVERRIDE; | |
|
Avi (use Gerrit)
2012/05/24 14:37:31
If this is a part of the ChildProcessSecurityPolic
benwells
2012/05/24 23:36:55
Done.
| |
| 82 | 83 |
| 83 // Grant the child process the ability to use Web UI Bindings. | 84 // Grant the child process the ability to use Web UI Bindings. |
| 84 void GrantWebUIBindings(int child_id); | 85 void GrantWebUIBindings(int child_id); |
| 85 | 86 |
| 86 // Grant the child process the ability to read raw cookies. | 87 // Grant the child process the ability to read raw cookies. |
| 87 void GrantReadRawCookies(int child_id); | 88 void GrantReadRawCookies(int child_id); |
| 88 | 89 |
| 89 // Revoke read raw cookies permission. | 90 // Revoke read raw cookies permission. |
| 90 void RevokeReadRawCookies(int child_id); | 91 void RevokeReadRawCookies(int child_id); |
| 91 | 92 |
| 92 // Before servicing a child process's request for a URL, the browser should | 93 // Before servicing a child process's request for a URL, the browser should |
| 93 // call this method to determine whether the process has the capability to | 94 // call this method to determine whether the process has the capability to |
| 94 // request the URL. | 95 // request the URL. |
| 95 bool CanRequestURL(int child_id, const GURL& url); | 96 bool CanRequestURL(int child_id, const GURL& url); |
| 96 | 97 |
| 97 // Before servicing a child process's request to upload a file to the web, the | 98 // Before servicing a child process's request to upload a file to the web, the |
| 98 // browser should call this method to determine whether the process has the | 99 // browser should call this method to determine whether the process has the |
| 99 // capability to upload the requested file. | 100 // capability to upload the requested file. |
| 100 bool CanReadFile(int child_id, const FilePath& file); | 101 virtual bool CanReadFile(int child_id, const FilePath& file) OVERRIDE; |
|
Avi (use Gerrit)
2012/05/24 14:37:31
ditto
benwells
2012/05/24 23:36:55
Done.
| |
| 101 | 102 |
| 102 // Before servicing a child process's request to enumerate a directory | 103 // Before servicing a child process's request to enumerate a directory |
| 103 // the browser should call this method to check for the capability. | 104 // the browser should call this method to check for the capability. |
| 104 bool CanReadDirectory(int child_id, const FilePath& directory); | 105 bool CanReadDirectory(int child_id, const FilePath& directory); |
| 105 | 106 |
| 106 // Determines if certain permissions were granted for a file. |permissions| | 107 // Determines if certain permissions were granted for a file. |permissions| |
| 107 // must be a bit-set of base::PlatformFileFlags. | 108 // must be a bit-set of base::PlatformFileFlags. |
| 108 bool HasPermissionsForFile(int child_id, | 109 bool HasPermissionsForFile(int child_id, |
| 109 const FilePath& file, | 110 const FilePath& file, |
| 110 int permissions); | 111 int permissions); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 SecurityStateMap security_state_; | 178 SecurityStateMap security_state_; |
| 178 | 179 |
| 179 // This maps keeps the record of which js worker thread child process | 180 // This maps keeps the record of which js worker thread child process |
| 180 // corresponds to which main js thread child process. | 181 // corresponds to which main js thread child process. |
| 181 WorkerToMainProcessMap worker_map_; | 182 WorkerToMainProcessMap worker_map_; |
| 182 | 183 |
| 183 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); | 184 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); |
| 184 }; | 185 }; |
| 185 | 186 |
| 186 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 187 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
| OLD | NEW |