| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 // Mapping from sandbox process types to resource IDs containing the sandbox | 52 // Mapping from sandbox process types to resource IDs containing the sandbox |
| 53 // profile for all process types known to content. | 53 // profile for all process types known to content. |
| 54 SandboxTypeToResourceIDMapping kDefaultSandboxTypeToResourceIDMapping[] = { | 54 SandboxTypeToResourceIDMapping kDefaultSandboxTypeToResourceIDMapping[] = { |
| 55 { SANDBOX_TYPE_RENDERER, IDR_RENDERER_SANDBOX_PROFILE }, | 55 { SANDBOX_TYPE_RENDERER, IDR_RENDERER_SANDBOX_PROFILE }, |
| 56 { SANDBOX_TYPE_WORKER, IDR_WORKER_SANDBOX_PROFILE }, | 56 { SANDBOX_TYPE_WORKER, IDR_WORKER_SANDBOX_PROFILE }, |
| 57 { SANDBOX_TYPE_UTILITY, IDR_UTILITY_SANDBOX_PROFILE }, | 57 { SANDBOX_TYPE_UTILITY, IDR_UTILITY_SANDBOX_PROFILE }, |
| 58 { SANDBOX_TYPE_GPU, IDR_GPU_SANDBOX_PROFILE }, | 58 { SANDBOX_TYPE_GPU, IDR_GPU_SANDBOX_PROFILE }, |
| 59 { SANDBOX_TYPE_PPAPI, IDR_PPAPI_SANDBOX_PROFILE }, | 59 { SANDBOX_TYPE_PPAPI, IDR_PPAPI_SANDBOX_PROFILE }, |
| 60 { SANDBOX_TYPE_NPAPI, -1 }, | |
| 61 }; | 60 }; |
| 62 | 61 |
| 63 COMPILE_ASSERT(arraysize(kDefaultSandboxTypeToResourceIDMapping) == \ | 62 COMPILE_ASSERT(arraysize(kDefaultSandboxTypeToResourceIDMapping) == \ |
| 64 size_t(SANDBOX_TYPE_AFTER_LAST_TYPE), \ | 63 size_t(SANDBOX_TYPE_AFTER_LAST_TYPE), \ |
| 65 sandbox_type_to_resource_id_mapping_incorrect); | 64 sandbox_type_to_resource_id_mapping_incorrect); |
| 66 | 65 |
| 67 // Try to escape |c| as a "SingleEscapeCharacter" (\n, etc). If successful, | 66 // Try to escape |c| as a "SingleEscapeCharacter" (\n, etc). If successful, |
| 68 // returns true and appends the escape sequence to |dst|. | 67 // returns true and appends the escape sequence to |dst|. |
| 69 bool EscapeSingleChar(char c, std::string* dst) { | 68 bool EscapeSingleChar(char c, std::string* dst) { |
| 70 const char *append = NULL; | 69 const char *append = NULL; |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { | 614 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { |
| 616 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 615 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
| 617 << path.value(); | 616 << path.value(); |
| 618 return path; | 617 return path; |
| 619 } | 618 } |
| 620 | 619 |
| 621 return base::FilePath(canonical_path); | 620 return base::FilePath(canonical_path); |
| 622 } | 621 } |
| 623 | 622 |
| 624 } // namespace content | 623 } // namespace content |
| OLD | NEW |