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 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 464 |
465 std::string quoted_home_dir; | 465 std::string quoted_home_dir; |
466 if (!QuotePlainString(home_dir_canonical.value(), "ed_home_dir)) { | 466 if (!QuotePlainString(home_dir_canonical.value(), "ed_home_dir)) { |
467 FatalStringQuoteException(home_dir_canonical.value()); | 467 FatalStringQuoteException(home_dir_canonical.value()); |
468 return false; | 468 return false; |
469 } | 469 } |
470 | 470 |
471 if (!compiler.InsertStringParam("USER_HOMEDIR_AS_LITERAL", quoted_home_dir)) | 471 if (!compiler.InsertStringParam("USER_HOMEDIR_AS_LITERAL", quoted_home_dir)) |
472 return false; | 472 return false; |
473 | 473 |
474 bool elcap_or_later = base::mac::IsOSElCapitanOrLater(); | 474 bool elcap_or_later = base::mac::IsAtLeastOS10_11(); |
475 if (!compiler.InsertBooleanParam("ELCAP_OR_LATER", elcap_or_later)) | 475 if (!compiler.InsertBooleanParam("ELCAP_OR_LATER", elcap_or_later)) |
476 return false; | 476 return false; |
477 | 477 |
478 // Initialize sandbox. | 478 // Initialize sandbox. |
479 std::string error_str; | 479 std::string error_str; |
480 bool success = compiler.CompileAndApplyProfile(&error_str); | 480 bool success = compiler.CompileAndApplyProfile(&error_str); |
481 DLOG_IF(FATAL, !success) << "Failed to initialize sandbox: " << error_str; | 481 DLOG_IF(FATAL, !success) << "Failed to initialize sandbox: " << error_str; |
482 gSandboxIsActive = success; | 482 gSandboxIsActive = success; |
483 return success; | 483 return success; |
484 } | 484 } |
(...skipping 16 matching lines...) Expand all Loading... |
501 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { | 501 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { |
502 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 502 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
503 << path.value(); | 503 << path.value(); |
504 return path; | 504 return path; |
505 } | 505 } |
506 | 506 |
507 return base::FilePath(canonical_path); | 507 return base::FilePath(canonical_path); |
508 } | 508 } |
509 | 509 |
510 } // namespace content | 510 } // namespace content |
OLD | NEW |