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 | |
414 // Add the policy for the pipes. | 405 // Add the policy for the pipes. |
415 if (policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, | 406 if (policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, |
416 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, | 407 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, |
417 L"\\\\.\\pipe\\chrome.*") != sandbox::SBOX_ALL_OK) { | 408 L"\\\\.\\pipe\\chrome.*") != sandbox::SBOX_ALL_OK) { |
418 NOTREACHED(); | 409 NOTREACHED(); |
419 return false; | 410 return false; |
420 } | 411 } |
421 | 412 |
422 // Spawn the flash broker and apply sandbox policy. | 413 // Spawn the flash broker and apply sandbox policy. |
423 if (LoadFlashBroker(plugin_path, command_line)) { | 414 if (LoadFlashBroker(plugin_path, command_line)) { |
(...skipping 29 matching lines...) Expand all Loading... |
453 DCHECK(sandbox_profile_resource_id); | 444 DCHECK(sandbox_profile_resource_id); |
454 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { | 445 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { |
455 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 446 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
456 return true; | 447 return true; |
457 } | 448 } |
458 return false; | 449 return false; |
459 } | 450 } |
460 #endif | 451 #endif |
461 | 452 |
462 } // namespace chrome | 453 } // namespace chrome |
OLD | NEW |