| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 sandbox_data = [sandbox_data | 519 sandbox_data = [sandbox_data |
| 520 stringByReplacingOccurrencesOfString:@";ENABLE_DIRECTORY_ACCESS" | 520 stringByReplacingOccurrencesOfString:@";ENABLE_DIRECTORY_ACCESS" |
| 521 withString:allowed_dir_sandbox_command]; | 521 withString:allowed_dir_sandbox_command]; |
| 522 } | 522 } |
| 523 } | 523 } |
| 524 | 524 |
| 525 NSMutableArray* tokens_to_remove = [NSMutableArray array]; | 525 NSMutableArray* tokens_to_remove = [NSMutableArray array]; |
| 526 | 526 |
| 527 // Enable verbose logging if enabled on the command line. (See common.sb | 527 // Enable verbose logging if enabled on the command line. (See common.sb |
| 528 // for details). | 528 // for details). |
| 529 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 529 const base::CommandLine* command_line = |
| 530 base::CommandLine::ForCurrentProcess(); |
| 530 bool enable_logging = | 531 bool enable_logging = |
| 531 command_line->HasSwitch(switches::kEnableSandboxLogging);; | 532 command_line->HasSwitch(switches::kEnableSandboxLogging);; |
| 532 if (enable_logging) { | 533 if (enable_logging) { |
| 533 [tokens_to_remove addObject:@";ENABLE_LOGGING"]; | 534 [tokens_to_remove addObject:@";ENABLE_LOGGING"]; |
| 534 } | 535 } |
| 535 | 536 |
| 536 bool lion_or_later = base::mac::IsOSLionOrLater(); | 537 bool lion_or_later = base::mac::IsOSLionOrLater(); |
| 537 | 538 |
| 538 // Without this, the sandbox will print a message to the system log every | 539 // Without this, the sandbox will print a message to the system log every |
| 539 // time it denies a request. This floods the console with useless spew. | 540 // time it denies a request. This floods the console with useless spew. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |