| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 FilePath plugin_path(plugin_dll); | 395 FilePath plugin_path(plugin_dll); |
| 396 if (plugin_path.BaseName() != builtin_flash.BaseName()) | 396 if (plugin_path.BaseName() != builtin_flash.BaseName()) |
| 397 return false; | 397 return false; |
| 398 | 398 |
| 399 if (base::win::GetVersion() <= base::win::VERSION_XP || | 399 if (base::win::GetVersion() <= base::win::VERSION_XP || |
| 400 CommandLine::ForCurrentProcess()->HasSwitch( | 400 CommandLine::ForCurrentProcess()->HasSwitch( |
| 401 switches::kDisableFlashSandbox)) { | 401 switches::kDisableFlashSandbox)) { |
| 402 return false; | 402 return false; |
| 403 } | 403 } |
| 404 | 404 |
| 405 // Add policy for the plugin proxy window pump event |
| 406 // used by WebPluginDelegateProxy::HandleInputEvent(). |
| 407 if (policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES, |
| 408 sandbox::TargetPolicy::HANDLES_DUP_ANY, |
| 409 L"Event") != sandbox::SBOX_ALL_OK) { |
| 410 NOTREACHED(); |
| 411 return false; |
| 412 } |
| 413 |
| 405 // Add the policy for the pipes. | 414 // Add the policy for the pipes. |
| 406 if (policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, | 415 if (policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, |
| 407 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, | 416 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, |
| 408 L"\\\\.\\pipe\\chrome.*") != sandbox::SBOX_ALL_OK) { | 417 L"\\\\.\\pipe\\chrome.*") != sandbox::SBOX_ALL_OK) { |
| 409 NOTREACHED(); | 418 NOTREACHED(); |
| 410 return false; | 419 return false; |
| 411 } | 420 } |
| 412 | 421 |
| 413 // Spawn the flash broker and apply sandbox policy. | 422 // Spawn the flash broker and apply sandbox policy. |
| 414 if (LoadFlashBroker(plugin_path, command_line)) { | 423 if (LoadFlashBroker(plugin_path, command_line)) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 444 DCHECK(sandbox_profile_resource_id); | 453 DCHECK(sandbox_profile_resource_id); |
| 445 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { | 454 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { |
| 446 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 455 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
| 447 return true; | 456 return true; |
| 448 } | 457 } |
| 449 return false; | 458 return false; |
| 450 } | 459 } |
| 451 #endif | 460 #endif |
| 452 | 461 |
| 453 } // namespace chrome | 462 } // namespace chrome |
| OLD | NEW |