Chromium Code Reviews| 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/browser/ppapi_plugin_process_host.h" | 5 #include "content/browser/ppapi_plugin_process_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 // The Pepper process is as locked-down as a renderer except that it can | 83 // The Pepper process is as locked-down as a renderer except that it can |
| 84 // create the server side of Chrome pipes. | 84 // create the server side of Chrome pipes. |
| 85 sandbox::ResultCode result; | 85 sandbox::ResultCode result; |
| 86 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, | 86 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, |
| 87 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, | 87 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, |
| 88 L"\\\\.\\pipe\\chrome.*"); | 88 L"\\\\.\\pipe\\chrome.*"); |
| 89 if (result != sandbox::SBOX_ALL_OK) | 89 if (result != sandbox::SBOX_ALL_OK) |
| 90 return false; | 90 return false; |
| 91 | 91 |
| 92 #if !defined(NACL_WIN64) | 92 #if !defined(NACL_WIN64) |
| 93 for (const auto& mime_type : info_.mime_types) { | 93 if (IsWin32kRendererLockdownEnabled()) { |
| 94 if (IsWin32kLockdownEnabledForMimeType(mime_type.mime_type)) { | 94 for (const auto& mime_type : info_.mime_types) { |
| 95 if (!AddWin32kLockdownPolicy(policy)) | 95 if (GetContentClient()->browser()->IsWin32kLockdownEnabledForMimeType( |
|
Alexei Svitkine (slow)
2016/01/26 08:23:40
Nit: Store the result of GetContentClient()->brows
jam
2016/01/26 15:18:51
given that the list of mime types should be pretty
Will Harris
2016/01/26 22:57:54
GetContentClient() does seem to do a CALL and it's
| |
| 96 return false; | 96 mime_type.mime_type)) { |
| 97 break; | 97 if (!AddWin32kLockdownPolicy(policy)) |
| 98 return false; | |
| 99 break; | |
| 100 } | |
| 98 } | 101 } |
| 99 } | 102 } |
| 100 #endif | 103 #endif |
| 101 const base::string16& sid = | 104 const base::string16& sid = |
| 102 GetContentClient()->browser()->GetAppContainerSidForSandboxType( | 105 GetContentClient()->browser()->GetAppContainerSidForSandboxType( |
| 103 GetSandboxType()); | 106 GetSandboxType()); |
| 104 if (!sid.empty()) | 107 if (!sid.empty()) |
| 105 AddAppContainerPolicy(policy, sid.c_str()); | 108 AddAppContainerPolicy(policy, sid.c_str()); |
| 106 | 109 |
| 107 return true; | 110 return true; |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 534 // sent_requests_ queue should be the one that the plugin just created. | 537 // sent_requests_ queue should be the one that the plugin just created. |
| 535 Client* client = sent_requests_.front(); | 538 Client* client = sent_requests_.front(); |
| 536 sent_requests_.pop(); | 539 sent_requests_.pop(); |
| 537 | 540 |
| 538 const ChildProcessData& data = process_->GetData(); | 541 const ChildProcessData& data = process_->GetData(); |
| 539 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 542 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
| 540 data.id); | 543 data.id); |
| 541 } | 544 } |
| 542 | 545 |
| 543 } // namespace content | 546 } // namespace content |
| OLD | NEW |