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

Side by Side Diff: content/browser/worker_host/worker_process_host.cc

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, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/child_process_security_policy_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "content/browser/worker_host/worker_process_host.h" 5 #include "content/browser/worker_host/worker_process_host.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 Launch( 172 Launch(
173 #if defined(OS_WIN) 173 #if defined(OS_WIN)
174 FilePath(), 174 FilePath(),
175 #elif defined(OS_POSIX) 175 #elif defined(OS_POSIX)
176 use_zygote, 176 use_zygote,
177 base::environment_vector(), 177 base::environment_vector(),
178 #endif 178 #endif
179 cmd_line); 179 cmd_line);
180 180
181 ChildProcessSecurityPolicy::GetInstance()->Add(id()); 181 ChildProcessSecurityPolicy::GetInstance()->AddWorker(
182 id(), render_process_id);
182 if (!CommandLine::ForCurrentProcess()->HasSwitch( 183 if (!CommandLine::ForCurrentProcess()->HasSwitch(
183 switches::kDisableFileSystem)) { 184 switches::kDisableFileSystem)) {
184 // Grant most file permissions to this worker. 185 // Grant most file permissions to this worker.
185 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and 186 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and
186 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API 187 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API
187 // requests them. 188 // requests them.
188 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( 189 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile(
189 id(), 190 id(),
190 resource_context_->file_system_context()-> 191 resource_context_->file_system_context()->
191 path_manager()->sandbox_provider()->base_path(), 192 path_manager()->sandbox_provider()->base_path(),
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 } 632 }
632 } 633 }
633 return false; 634 return false;
634 } 635 }
635 636
636 WorkerProcessHost::WorkerInstance::FilterInfo 637 WorkerProcessHost::WorkerInstance::FilterInfo
637 WorkerProcessHost::WorkerInstance::GetFilter() const { 638 WorkerProcessHost::WorkerInstance::GetFilter() const {
638 DCHECK(NumFilters() == 1); 639 DCHECK(NumFilters() == 1);
639 return *filters_.begin(); 640 return *filters_.begin();
640 } 641 }
OLDNEW
« no previous file with comments | « content/browser/child_process_security_policy_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698