Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: content/common/sandbox_mac.mm

Issue 303293002: Initialize the bootstrap sandbox in the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: NPAPI workaround Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 },
60 }; 61 };
61 62
62 COMPILE_ASSERT(arraysize(kDefaultSandboxTypeToResourceIDMapping) == \ 63 COMPILE_ASSERT(arraysize(kDefaultSandboxTypeToResourceIDMapping) == \
63 size_t(SANDBOX_TYPE_AFTER_LAST_TYPE), \ 64 size_t(SANDBOX_TYPE_AFTER_LAST_TYPE), \
64 sandbox_type_to_resource_id_mapping_incorrect); 65 sandbox_type_to_resource_id_mapping_incorrect);
65 66
66 // Try to escape |c| as a "SingleEscapeCharacter" (\n, etc). If successful, 67 // Try to escape |c| as a "SingleEscapeCharacter" (\n, etc). If successful,
67 // returns true and appends the escape sequence to |dst|. 68 // returns true and appends the escape sequence to |dst|.
68 bool EscapeSingleChar(char c, std::string* dst) { 69 bool EscapeSingleChar(char c, std::string* dst) {
69 const char *append = NULL; 70 const char *append = NULL;
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { 615 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) {
615 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " 616 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: "
616 << path.value(); 617 << path.value();
617 return path; 618 return path;
618 } 619 }
619 620
620 return base::FilePath(canonical_path); 621 return base::FilePath(canonical_path);
621 } 622 }
622 623
623 } // namespace content 624 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698