| 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/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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 ppapi::PPB_ImageData_Shared::ImageDataType image_type = | 138 ppapi::PPB_ImageData_Shared::ImageDataType image_type = |
| 139 ppapi::PPB_ImageData_Shared::PLATFORM; | 139 ppapi::PPB_ImageData_Shared::PLATFORM; |
| 140 #if defined(OS_WIN) | 140 #if defined(OS_WIN) |
| 141 // If Win32K lockdown mitigations are enabled for Windows 8 and beyond | 141 // If Win32K lockdown mitigations are enabled for Windows 8 and beyond |
| 142 // we use the SIMPLE image data type as the PLATFORM image data type | 142 // we use the SIMPLE image data type as the PLATFORM image data type |
| 143 // calls GDI functions to create DIB sections etc which fail in Win32K | 143 // calls GDI functions to create DIB sections etc which fail in Win32K |
| 144 // lockdown mode. | 144 // lockdown mode. |
| 145 // TODO(ananta) | 145 // TODO(ananta) |
| 146 // Look into whether this causes a loss of functionality. From cursory | 146 // Look into whether this causes a loss of functionality. From cursory |
| 147 // testing things seem to work well. | 147 // testing things seem to work well. |
| 148 if (switches::IsWin32kRendererLockdownEnabled() && | 148 if (switches::IsWin32kRendererLockdownEnabled(false)) { |
| 149 base::win::GetVersion() >= base::win::VERSION_WIN8) { | |
| 150 image_type = ppapi::PPB_ImageData_Shared::SIMPLE; | 149 image_type = ppapi::PPB_ImageData_Shared::SIMPLE; |
| 151 } | 150 } |
| 152 #endif | 151 #endif |
| 153 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( | 152 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( |
| 154 instance, image_type)); | 153 instance, image_type)); |
| 155 return scoped_ptr<ResourceHost>(PepperGraphics2DHost::Create( | 154 return scoped_ptr<ResourceHost>(PepperGraphics2DHost::Create( |
| 156 host_, instance, resource, size, is_always_opaque, image_data)); | 155 host_, instance, resource, size, is_always_opaque, image_data)); |
| 157 } | 156 } |
| 158 case PpapiHostMsg_URLLoader_Create::ID: | 157 case PpapiHostMsg_URLLoader_Create::ID: |
| 159 return scoped_ptr<ResourceHost>( | 158 return scoped_ptr<ResourceHost>( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 204 |
| 206 return scoped_ptr<ResourceHost>(); | 205 return scoped_ptr<ResourceHost>(); |
| 207 } | 206 } |
| 208 | 207 |
| 209 const ppapi::PpapiPermissions& | 208 const ppapi::PpapiPermissions& |
| 210 ContentRendererPepperHostFactory::GetPermissions() const { | 209 ContentRendererPepperHostFactory::GetPermissions() const { |
| 211 return host_->GetPpapiHost()->permissions(); | 210 return host_->GetPpapiHost()->permissions(); |
| 212 } | 211 } |
| 213 | 212 |
| 214 } // namespace content | 213 } // namespace content |
| OLD | NEW |