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 13 matching lines...) Expand all Loading... |
24 #include "base/mac/scoped_nsautorelease_pool.h" | 24 #include "base/mac/scoped_nsautorelease_pool.h" |
25 #include "base/mac/scoped_nsobject.h" | 25 #include "base/mac/scoped_nsobject.h" |
26 #include "base/rand_util.h" | 26 #include "base/rand_util.h" |
27 #include "base/strings/string16.h" | 27 #include "base/strings/string16.h" |
28 #include "base/strings/string_piece.h" | 28 #include "base/strings/string_piece.h" |
29 #include "base/strings/string_util.h" | 29 #include "base/strings/string_util.h" |
30 #include "base/strings/stringprintf.h" | 30 #include "base/strings/stringprintf.h" |
31 #include "base/strings/sys_string_conversions.h" | 31 #include "base/strings/sys_string_conversions.h" |
32 #include "base/strings/utf_string_conversions.h" | 32 #include "base/strings/utf_string_conversions.h" |
33 #include "base/sys_info.h" | 33 #include "base/sys_info.h" |
| 34 #include "content/common/gpu/media/vt_video_decode_accelerator.h" |
34 #include "content/grit/content_resources.h" | 35 #include "content/grit/content_resources.h" |
35 #include "content/public/common/content_client.h" | 36 #include "content/public/common/content_client.h" |
36 #include "content/public/common/content_switches.h" | 37 #include "content/public/common/content_switches.h" |
37 #include "third_party/icu/source/common/unicode/uchar.h" | 38 #include "third_party/icu/source/common/unicode/uchar.h" |
38 #include "ui/base/layout.h" | 39 #include "ui/base/layout.h" |
39 #include "ui/gl/gl_surface.h" | 40 #include "ui/gl/gl_surface.h" |
40 | 41 |
41 extern "C" { | 42 extern "C" { |
42 void CGSSetDenyWindowServerConnections(bool); | 43 void CGSSetDenyWindowServerConnections(bool); |
43 void CGSShutdownServerConnections(); | 44 void CGSShutdownServerConnections(); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 if (sandbox_type == SANDBOX_TYPE_UTILITY) { | 317 if (sandbox_type == SANDBOX_TYPE_UTILITY) { |
317 // CFTimeZoneCopyZone() tries to read /etc and /private/etc/localtime - 10.8 | 318 // CFTimeZoneCopyZone() tries to read /etc and /private/etc/localtime - 10.8 |
318 // Needed by Media Galleries API Picasa - crbug.com/151701 | 319 // Needed by Media Galleries API Picasa - crbug.com/151701 |
319 CFTimeZoneCopySystem(); | 320 CFTimeZoneCopySystem(); |
320 } | 321 } |
321 | 322 |
322 if (sandbox_type == SANDBOX_TYPE_GPU) { | 323 if (sandbox_type == SANDBOX_TYPE_GPU) { |
323 // Preload either the desktop GL or the osmesa so, depending on the | 324 // Preload either the desktop GL or the osmesa so, depending on the |
324 // --use-gl flag. | 325 // --use-gl flag. |
325 gfx::GLSurface::InitializeOneOff(); | 326 gfx::GLSurface::InitializeOneOff(); |
| 327 |
| 328 // Preload VideoToolbox. |
| 329 InitializeVideoToolbox(); |
326 } | 330 } |
327 | 331 |
328 if (sandbox_type == SANDBOX_TYPE_PPAPI) { | 332 if (sandbox_type == SANDBOX_TYPE_PPAPI) { |
329 // Preload AppKit color spaces used for Flash/ppapi. http://crbug.com/348304 | 333 // Preload AppKit color spaces used for Flash/ppapi. http://crbug.com/348304 |
330 NSColor* color = [NSColor controlTextColor]; | 334 NSColor* color = [NSColor controlTextColor]; |
331 [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; | 335 [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; |
332 } | 336 } |
333 | 337 |
334 if (sandbox_type == SANDBOX_TYPE_RENDERER && | 338 if (sandbox_type == SANDBOX_TYPE_RENDERER && |
335 base::mac::IsOSMountainLionOrLater()) { | 339 base::mac::IsOSMountainLionOrLater()) { |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { | 635 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { |
632 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 636 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
633 << path.value(); | 637 << path.value(); |
634 return path; | 638 return path; |
635 } | 639 } |
636 | 640 |
637 return base::FilePath(canonical_path); | 641 return base::FilePath(canonical_path); |
638 } | 642 } |
639 | 643 |
640 } // namespace content | 644 } // namespace content |
OLD | NEW |