Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: content/browser/ppapi_plugin_process_host.cc

Issue 1609133002: Change Win32k PPAPI lockdown to use finch params for mime type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review changes Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
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 content::ContentBrowserClient* browser_client =
93 GetContentClient()->browser();
94
92 #if !defined(NACL_WIN64) 95 #if !defined(NACL_WIN64)
93 for (const auto& mime_type : info_.mime_types) { 96 if (IsWin32kRendererLockdownEnabled()) {
94 if (IsWin32kLockdownEnabledForMimeType(mime_type.mime_type)) { 97 for (const auto& mime_type : info_.mime_types) {
95 if (!AddWin32kLockdownPolicy(policy)) 98 if (browser_client->IsWin32kLockdownEnabledForMimeType(
96 return false; 99 mime_type.mime_type)) {
97 break; 100 if (!AddWin32kLockdownPolicy(policy))
101 return false;
102 break;
103 }
98 } 104 }
99 } 105 }
100 #endif 106 #endif
101 const base::string16& sid = 107 const base::string16& sid =
102 GetContentClient()->browser()->GetAppContainerSidForSandboxType( 108 browser_client->GetAppContainerSidForSandboxType(GetSandboxType());
103 GetSandboxType());
104 if (!sid.empty()) 109 if (!sid.empty())
105 AddAppContainerPolicy(policy, sid.c_str()); 110 AddAppContainerPolicy(policy, sid.c_str());
106 111
107 return true; 112 return true;
108 } 113 }
109 114
110 #elif defined(OS_POSIX) 115 #elif defined(OS_POSIX)
111 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 116 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
112 ZygoteHandle* GetZygote() override { 117 ZygoteHandle* GetZygote() override {
113 const base::CommandLine& browser_command_line = 118 const base::CommandLine& browser_command_line =
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 // sent_requests_ queue should be the one that the plugin just created. 539 // sent_requests_ queue should be the one that the plugin just created.
535 Client* client = sent_requests_.front(); 540 Client* client = sent_requests_.front();
536 sent_requests_.pop(); 541 sent_requests_.pop();
537 542
538 const ChildProcessData& data = process_->GetData(); 543 const ChildProcessData& data = process_->GetData();
539 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), 544 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle),
540 data.id); 545 data.id);
541 } 546 }
542 547
543 } // namespace content 548 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | content/common/content_switches_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698