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 // CFTimeZoneCopyZone() tries to read /etc and /private/etc/localtime - 10.8 |
| 313 // Needed by Media Galleries API Picasa - crbug.com/151701 |
| 314 CFTimeZoneCopySystem(); |
| 315 } |
| 316 |
310 if (sandbox_type == SANDBOX_TYPE_GPU) { | 317 if (sandbox_type == SANDBOX_TYPE_GPU) { |
311 // Preload either the desktop GL or the osmesa so, depending on the | 318 // Preload either the desktop GL or the osmesa so, depending on the |
312 // --use-gl flag. | 319 // --use-gl flag. |
313 gfx::GLSurface::InitializeOneOff(); | 320 gfx::GLSurface::InitializeOneOff(); |
314 } | 321 } |
315 } | 322 } |
316 | 323 |
317 // static | 324 // static |
318 NSString* Sandbox::BuildAllowDirectoryAccessSandboxString( | 325 NSString* Sandbox::BuildAllowDirectoryAccessSandboxString( |
319 const base::FilePath& allowed_dir, | 326 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) { | 608 if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { |
602 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 609 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
603 << path.value(); | 610 << path.value(); |
604 return path; | 611 return path; |
605 } | 612 } |
606 | 613 |
607 return base::FilePath(canonical_path); | 614 return base::FilePath(canonical_path); |
608 } | 615 } |
609 | 616 |
610 } // namespace content | 617 } // namespace content |
OLD | NEW |