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

Side by Side Diff: content/renderer/pepper/content_renderer_pepper_host_factory.cc

Issue 792873004: Win32k lockdown: move to chrome://flags, add UMA, add finch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add flags to LoginCustomFlags Created 6 years 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/renderer/pepper/content_renderer_pepper_host_factory.h" 5 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "content/public/common/content_client.h" 9 #include "content/public/common/content_client.h"
10 #include "content/public/renderer/content_renderer_client.h" 10 #include "content/public/renderer/content_renderer_client.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 ppapi::PPB_ImageData_Shared::ImageDataType image_type = 151 ppapi::PPB_ImageData_Shared::ImageDataType image_type =
152 ppapi::PPB_ImageData_Shared::PLATFORM; 152 ppapi::PPB_ImageData_Shared::PLATFORM;
153 #if defined(OS_WIN) 153 #if defined(OS_WIN)
154 // If Win32K lockdown mitigations are enabled for Windows 8 and beyond 154 // If Win32K lockdown mitigations are enabled for Windows 8 and beyond
155 // we use the SIMPLE image data type as the PLATFORM image data type 155 // we use the SIMPLE image data type as the PLATFORM image data type
156 // calls GDI functions to create DIB sections etc which fail in Win32K 156 // calls GDI functions to create DIB sections etc which fail in Win32K
157 // lockdown mode. 157 // lockdown mode.
158 // TODO(ananta) 158 // TODO(ananta)
159 // Look into whether this causes a loss of functionality. From cursory 159 // Look into whether this causes a loss of functionality. From cursory
160 // testing things seem to work well. 160 // testing things seem to work well.
161 if (CommandLine::ForCurrentProcess()->HasSwitch( 161 if (switches::Win32kRendererLockdownEnabled() &&
162 switches::kEnableWin32kRendererLockDown) &&
163 base::win::GetVersion() >= base::win::VERSION_WIN8) { 162 base::win::GetVersion() >= base::win::VERSION_WIN8) {
164 image_type = ppapi::PPB_ImageData_Shared::SIMPLE; 163 image_type = ppapi::PPB_ImageData_Shared::SIMPLE;
165 } 164 }
166 #endif 165 #endif
167 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( 166 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl(
168 instance, image_type)); 167 instance, image_type));
169 return scoped_ptr<ResourceHost>(PepperGraphics2DHost::Create( 168 return scoped_ptr<ResourceHost>(PepperGraphics2DHost::Create(
170 host_, instance, resource, size, is_always_opaque, image_data)); 169 host_, instance, resource, size, is_always_opaque, image_data));
171 } 170 }
172 case PpapiHostMsg_URLLoader_Create::ID: 171 case PpapiHostMsg_URLLoader_Create::ID:
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 221
223 return scoped_ptr<ResourceHost>(); 222 return scoped_ptr<ResourceHost>();
224 } 223 }
225 224
226 const ppapi::PpapiPermissions& 225 const ppapi::PpapiPermissions&
227 ContentRendererPepperHostFactory::GetPermissions() const { 226 ContentRendererPepperHostFactory::GetPermissions() const {
228 return host_->GetPpapiHost()->permissions(); 227 return host_->GetPpapiHost()->permissions();
229 } 228 }
230 229
231 } // namespace content 230 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698