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

Unified Diff: content/browser/child_process_security_policy.h

Issue 6893145: Ensured that worker thread renderer process file permissions are inherited from its main thread r... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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
Index: content/browser/child_process_security_policy.h
===================================================================
--- content/browser/child_process_security_policy.h (revision 83553)
+++ content/browser/child_process_security_policy.h (working copy)
@@ -66,6 +66,12 @@
// this method exactly once.
void Add(int child_id);
+ // Upon creation, worker thread child processes should register themselves by
+ // calling this this method exactly once. Workers that are not shared will
+ // inherit permissions from their parent renderer process identified with
+ // |main_render_process_id|.
+ void AddWorker(int worker_child_id, int main_render_process_id);
+
// Upon destruction, child processess should unregister themselves by caling
// this method exactly once.
void Remove(int child_id);
@@ -151,12 +157,22 @@
typedef std::set<std::string> SchemeSet;
typedef std::map<int, SecurityState*> SecurityStateMap;
+ typedef std::map<int, int> WorkerToMainProcessMap;
// Obtain an instance of ChildProcessSecurityPolicy via GetInstance().
ChildProcessSecurityPolicy();
friend struct DefaultSingletonTraits<ChildProcessSecurityPolicy>;
- // You must acquire this lock before reading or writing any members of this
+ // Adds child process during registration.
+ void AddChild(int child_id);
+
+ // Determines if certain permissions were granted for a file to given child
+ // process. |permissions| must be a bit-set of base::PlatformFileFlags.
+ bool ChildProcessHasPermissionsForFile(int child_id,
+ const FilePath& file,
+ int permissions);
+
+ // You must acquire this lock before reading or writing any members of this
// class. You must not block while holding this lock.
base::Lock lock_;
@@ -180,6 +196,10 @@
// not escape this class.
SecurityStateMap security_state_;
+ // This maps keeps the record of which js worker thread child process
+ // corresponds to which main js thread child process.
+ WorkerToMainProcessMap worker_map_;
+
DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicy);
};
« no previous file with comments | « no previous file | content/browser/child_process_security_policy.cc » ('j') | content/browser/child_process_security_policy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698