OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/sandbox_mac.h" | 5 #include "chrome/common/sandbox_mac.h" |
6 | 6 |
7 #include "base/debug_util.h" | 7 #include "base/debug_util.h" |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 #import <OpenGL/OpenGL.h> | 10 #import <OpenGL/OpenGL.h> |
11 | 11 |
12 extern "C" { | 12 extern "C" { |
13 #include <sandbox.h> | 13 #include <sandbox.h> |
14 } | 14 } |
15 #include <signal.h> | 15 #include <signal.h> |
16 #include <sys/param.h> | 16 #include <sys/param.h> |
17 | 17 |
18 #include "app/gfx/gl/gl_context.h" | 18 #include "app/gfx/gl/gl_context.h" |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "base/chrome_application_mac.h" | |
21 #include "base/command_line.h" | 20 #include "base/command_line.h" |
22 #include "base/file_util.h" | 21 #include "base/file_util.h" |
23 #include "base/mac_util.h" | 22 #include "base/mac_util.h" |
24 #include "base/rand_util_c.h" | 23 #include "base/rand_util_c.h" |
25 #include "base/mac/scoped_cftyperef.h" | 24 #include "base/mac/scoped_cftyperef.h" |
26 #include "base/mac/scoped_nsautorelease_pool.h" | 25 #include "base/mac/scoped_nsautorelease_pool.h" |
27 #include "base/string16.h" | 26 #include "base/string16.h" |
28 #include "base/string_util.h" | 27 #include "base/string_util.h" |
29 #include "base/sys_info.h" | 28 #include "base/sys_info.h" |
30 #include "base/sys_string_conversions.h" | 29 #include "base/sys_string_conversions.h" |
31 #include "base/utf_string_conversions.h" | 30 #include "base/utf_string_conversions.h" |
| 31 #include "chrome/common/chrome_application_mac.h" |
32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
33 #include "unicode/uchar.h" | 33 #include "unicode/uchar.h" |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 // Try to escape |c| as a "SingleEscapeCharacter" (\n, etc). If successful, | 37 // Try to escape |c| as a "SingleEscapeCharacter" (\n, etc). If successful, |
38 // returns true and appends the escape sequence to |dst|. | 38 // returns true and appends the escape sequence to |dst|. |
39 bool EscapeSingleChar(char c, std::string* dst) { | 39 bool EscapeSingleChar(char c, std::string* dst) { |
40 const char *append = NULL; | 40 const char *append = NULL; |
41 switch (c) { | 41 switch (c) { |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { | 583 if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { |
584 PLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 584 PLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
585 << path->value(); | 585 << path->value(); |
586 return; | 586 return; |
587 } | 587 } |
588 | 588 |
589 *path = FilePath(canonical_path); | 589 *path = FilePath(canonical_path); |
590 } | 590 } |
591 | 591 |
592 } // namespace sandbox | 592 } // namespace sandbox |
OLD | NEW |