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 // CFTimeZoneCopySystem() - 10.8 | |
313 // Allows access to the system time zone. Media Galleries uses the sandboxed | |
314 // utility process to read Picasa databases containing local times. | |
315 CFTimeZoneCopySystem(); | |
jeremy
2013/08/30 23:26:26
How about:
CFTimeZoneCopyZone() tries to read /et
tommycli
2013/08/30 23:36:56
Done.
| |
316 } | |
317 | |
310 if (sandbox_type == SANDBOX_TYPE_GPU) { | 318 if (sandbox_type == SANDBOX_TYPE_GPU) { |
311 // Preload either the desktop GL or the osmesa so, depending on the | 319 // Preload either the desktop GL or the osmesa so, depending on the |
312 // --use-gl flag. | 320 // --use-gl flag. |
313 gfx::GLSurface::InitializeOneOff(); | 321 gfx::GLSurface::InitializeOneOff(); |
314 } | 322 } |
315 } | 323 } |
316 | 324 |
317 // static | 325 // static |
318 NSString* Sandbox::BuildAllowDirectoryAccessSandboxString( | 326 NSString* Sandbox::BuildAllowDirectoryAccessSandboxString( |
319 const base::FilePath& allowed_dir, | 327 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) { | 609 if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { |
602 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 610 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
603 << path.value(); | 611 << path.value(); |
604 return path; | 612 return path; |
605 } | 613 } |
606 | 614 |
607 return base::FilePath(canonical_path); | 615 return base::FilePath(canonical_path); |
608 } | 616 } |
609 | 617 |
610 } // namespace content | 618 } // namespace content |
OLD | NEW |