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 "chrome/common/chrome_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/cpu.h" | 8 #include "base/cpu.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 432 |
433 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes( | 433 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes( |
434 int resource_id) const { | 434 int resource_id) const { |
435 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); | 435 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); |
436 } | 436 } |
437 | 437 |
438 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const { | 438 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const { |
439 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | 439 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); |
440 } | 440 } |
441 | 441 |
442 #if defined(OS_MACOSX) && !defined(OS_IOS) | 442 #if defined(OS_WIN) |
| 443 void ChromeContentClient::AddPolicy(CommandLine* command_line, |
| 444 sandbox::TargetPolicy* policy) { |
| 445 // Allow the server side of a pipe restricted to the "chrome.nacl." |
| 446 // namespace so that it cannot impersonate other system or other chrome |
| 447 // service pipes. |
| 448 policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, |
| 449 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, |
| 450 L"\\\\.\\pipe\\chrome.nacl.*"); |
| 451 } |
| 452 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
443 bool ChromeContentClient::GetSandboxProfileForSandboxType( | 453 bool ChromeContentClient::GetSandboxProfileForSandboxType( |
444 int sandbox_type, | 454 int sandbox_type, |
445 int* sandbox_profile_resource_id) const { | 455 int* sandbox_profile_resource_id) const { |
446 DCHECK(sandbox_profile_resource_id); | 456 DCHECK(sandbox_profile_resource_id); |
447 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { | 457 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { |
448 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 458 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
449 return true; | 459 return true; |
450 } | 460 } |
451 return false; | 461 return false; |
452 } | 462 } |
453 | 463 |
454 std::string ChromeContentClient::GetCarbonInterposePath() const { | 464 std::string ChromeContentClient::GetCarbonInterposePath() const { |
455 return std::string(kInterposeLibraryPath); | 465 return std::string(kInterposeLibraryPath); |
456 } | 466 } |
457 #endif | 467 #endif |
458 | 468 |
459 } // namespace chrome | 469 } // namespace chrome |
OLD | NEW |