| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 sandbox_profile_resource_id = | 374 sandbox_profile_resource_id = |
| 375 kDefaultSandboxTypeToResourceIDMapping[i].sandbox_profile_resource_id; | 375 kDefaultSandboxTypeToResourceIDMapping[i].sandbox_profile_resource_id; |
| 376 break; | 376 break; |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 if (sandbox_profile_resource_id == -1) { | 379 if (sandbox_profile_resource_id == -1) { |
| 380 // Check if the embedder knows about this sandbox process type. | 380 // Check if the embedder knows about this sandbox process type. |
| 381 bool sandbox_type_found = | 381 bool sandbox_type_found = |
| 382 GetContentClient()->GetSandboxProfileForSandboxType( | 382 GetContentClient()->GetSandboxProfileForSandboxType( |
| 383 sandbox_type, &sandbox_profile_resource_id); | 383 sandbox_type, &sandbox_profile_resource_id); |
| 384 CHECK(sandbox_type_found) << "Unknown sandbox type " << sandbox_type; | 384 // Unknown sandbox type |sandbox_type| |
| 385 CHECK(sandbox_type_found); |
| 385 } | 386 } |
| 386 | 387 |
| 387 base::StringPiece sandbox_definition = | 388 base::StringPiece sandbox_definition = |
| 388 GetContentClient()->GetDataResource( | 389 GetContentClient()->GetDataResource( |
| 389 sandbox_profile_resource_id, ui::SCALE_FACTOR_NONE); | 390 sandbox_profile_resource_id, ui::SCALE_FACTOR_NONE); |
| 390 if (sandbox_definition.empty()) { | 391 if (sandbox_definition.empty()) { |
| 391 LOG(FATAL) << "Failed to load the sandbox profile (resource id " | 392 LOG(FATAL) << "Failed to load the sandbox profile (resource id " |
| 392 << sandbox_profile_resource_id << ")"; | 393 << sandbox_profile_resource_id << ")"; |
| 393 return nil; | 394 return nil; |
| 394 } | 395 } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { | 509 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { |
| 509 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 510 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
| 510 << path.value(); | 511 << path.value(); |
| 511 return path; | 512 return path; |
| 512 } | 513 } |
| 513 | 514 |
| 514 return base::FilePath(canonical_path); | 515 return base::FilePath(canonical_path); |
| 515 } | 516 } |
| 516 | 517 |
| 517 } // namespace content | 518 } // namespace content |
| OLD | NEW |