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 #include "content/common/sandbox_mac.h" | 5 #include "content/common/sandbox_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include <CoreFoundation/CFTimeZone.h> | |
| 9 extern "C" { | 10 extern "C" { |
| 10 #include <sandbox.h> | 11 #include <sandbox.h> |
| 11 } | 12 } |
| 12 #include <signal.h> | 13 #include <signal.h> |
| 13 #include <sys/param.h> | 14 #include <sys/param.h> |
| 14 | 15 |
| 15 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 16 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 17 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 18 #include "base/file_util.h" | 19 #include "base/file_util.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 300 CGImageSourceCreateWithData((CFDataRef)data, NULL)); | 301 CGImageSourceCreateWithData((CFDataRef)data, NULL)); |
| 301 CGImageSourceGetStatus(img); | 302 CGImageSourceGetStatus(img); |
| 302 } | 303 } |
| 303 | 304 |
| 304 { | 305 { |
| 305 // Allow access to /dev/urandom. | 306 // Allow access to /dev/urandom. |
| 306 base::GetUrandomFD(); | 307 base::GetUrandomFD(); |
| 307 } | 308 } |
| 308 | 309 |
| 309 // Process-type dependent warm-up. | 310 // Process-type dependent warm-up. |
| 311 if (sandbox_type == SANDBOX_TYPE_UTILITY) { | |
| 312 // Allow access to local timezones. | |
|
jeremy
2013/08/30 23:02:51
Can you provide a much more detailed comment about
tommycli
2013/08/30 23:14:20
Done.
| |
| 313 CFTimeZoneCopySystem(); | |
| 314 } | |
| 315 | |
| 310 if (sandbox_type == SANDBOX_TYPE_GPU) { | 316 if (sandbox_type == SANDBOX_TYPE_GPU) { |
| 311 // Preload either the desktop GL or the osmesa so, depending on the | 317 // Preload either the desktop GL or the osmesa so, depending on the |
| 312 // --use-gl flag. | 318 // --use-gl flag. |
| 313 gfx::GLSurface::InitializeOneOff(); | 319 gfx::GLSurface::InitializeOneOff(); |
| 314 } | 320 } |
| 315 } | 321 } |
| 316 | 322 |
| 317 // static | 323 // static |
| 318 NSString* Sandbox::BuildAllowDirectoryAccessSandboxString( | 324 NSString* Sandbox::BuildAllowDirectoryAccessSandboxString( |
| 319 const base::FilePath& allowed_dir, | 325 const base::FilePath& allowed_dir, |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 601 if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { | 607 if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { |
| 602 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 608 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
| 603 << path.value(); | 609 << path.value(); |
| 604 return path; | 610 return path; |
| 605 } | 611 } |
| 606 | 612 |
| 607 return base::FilePath(canonical_path); | 613 return base::FilePath(canonical_path); |
| 608 } | 614 } |
| 609 | 615 |
| 610 } // namespace content | 616 } // namespace content |
| OLD | NEW |