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 #include <CoreFoundation/CFTimeZone.h> |
10 extern "C" { | 10 extern "C" { |
(...skipping 18 matching lines...) Expand all Loading... | |
29 #include "base/strings/stringprintf.h" | 29 #include "base/strings/stringprintf.h" |
30 #include "base/strings/sys_string_conversions.h" | 30 #include "base/strings/sys_string_conversions.h" |
31 #include "base/strings/utf_string_conversions.h" | 31 #include "base/strings/utf_string_conversions.h" |
32 #include "base/sys_info.h" | 32 #include "base/sys_info.h" |
33 #include "content/public/common/content_client.h" | 33 #include "content/public/common/content_client.h" |
34 #include "content/public/common/content_switches.h" | 34 #include "content/public/common/content_switches.h" |
35 #include "grit/content_resources.h" | 35 #include "grit/content_resources.h" |
36 #include "third_party/icu/source/common/unicode/uchar.h" | 36 #include "third_party/icu/source/common/unicode/uchar.h" |
37 #include "ui/base/layout.h" | 37 #include "ui/base/layout.h" |
38 #include "ui/gl/gl_surface.h" | 38 #include "ui/gl/gl_surface.h" |
39 #include "ui/gl/io_surface_support_mac.h" | |
39 | 40 |
40 namespace content { | 41 namespace content { |
41 namespace { | 42 namespace { |
42 | 43 |
43 // Is the sandbox currently active. | 44 // Is the sandbox currently active. |
44 bool gSandboxIsActive = false; | 45 bool gSandboxIsActive = false; |
45 | 46 |
46 struct SandboxTypeToResourceIDMapping { | 47 struct SandboxTypeToResourceIDMapping { |
47 SandboxType sandbox_type; | 48 SandboxType sandbox_type; |
48 int sandbox_profile_resource_id; | 49 int sandbox_profile_resource_id; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 base::ScopedCFTypeRef<CGImageSourceRef> img( | 301 base::ScopedCFTypeRef<CGImageSourceRef> img( |
301 CGImageSourceCreateWithData((CFDataRef)data, NULL)); | 302 CGImageSourceCreateWithData((CFDataRef)data, NULL)); |
302 CGImageSourceGetStatus(img); | 303 CGImageSourceGetStatus(img); |
303 } | 304 } |
304 | 305 |
305 { | 306 { |
306 // Allow access to /dev/urandom. | 307 // Allow access to /dev/urandom. |
307 base::GetUrandomFD(); | 308 base::GetUrandomFD(); |
308 } | 309 } |
309 | 310 |
311 { // IOSurfaceLookup() - 10.7 | |
jeremy
2013/11/27 08:26:09
Is there a bug you can link to?
Any idea how expe
reveman
2013/11/27 16:04:28
Done.
| |
312 IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); | |
313 if (io_surface_support) { | |
314 base::ScopedCFTypeRef<CFTypeRef> io_surface( | |
315 io_surface_support->IOSurfaceLookup(0)); | |
316 } | |
317 } | |
318 | |
310 // Process-type dependent warm-up. | 319 // Process-type dependent warm-up. |
311 if (sandbox_type == SANDBOX_TYPE_UTILITY) { | 320 if (sandbox_type == SANDBOX_TYPE_UTILITY) { |
312 // CFTimeZoneCopyZone() tries to read /etc and /private/etc/localtime - 10.8 | 321 // CFTimeZoneCopyZone() tries to read /etc and /private/etc/localtime - 10.8 |
313 // Needed by Media Galleries API Picasa - crbug.com/151701 | 322 // Needed by Media Galleries API Picasa - crbug.com/151701 |
314 CFTimeZoneCopySystem(); | 323 CFTimeZoneCopySystem(); |
315 } | 324 } |
316 | 325 |
317 if (sandbox_type == SANDBOX_TYPE_GPU) { | 326 if (sandbox_type == SANDBOX_TYPE_GPU) { |
318 // Preload either the desktop GL or the osmesa so, depending on the | 327 // Preload either the desktop GL or the osmesa so, depending on the |
319 // --use-gl flag. | 328 // --use-gl flag. |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
608 if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { | 617 if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { |
609 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 618 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
610 << path.value(); | 619 << path.value(); |
611 return path; | 620 return path; |
612 } | 621 } |
613 | 622 |
614 return base::FilePath(canonical_path); | 623 return base::FilePath(canonical_path); |
615 } | 624 } |
616 | 625 |
617 } // namespace content | 626 } // namespace content |
OLD | NEW |