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/resource_creation_impl.h" | 5 #include "content/renderer/pepper/resource_creation_impl.h" |
6 | 6 |
| 7 #include "content/common/content_switches_internal.h" |
7 #include "content/renderer/pepper/ppb_audio_impl.h" | 8 #include "content/renderer/pepper/ppb_audio_impl.h" |
8 #include "content/renderer/pepper/ppb_broker_impl.h" | 9 #include "content/renderer/pepper/ppb_broker_impl.h" |
9 #include "content/renderer/pepper/ppb_buffer_impl.h" | 10 #include "content/renderer/pepper/ppb_buffer_impl.h" |
10 #include "content/renderer/pepper/ppb_flash_message_loop_impl.h" | 11 #include "content/renderer/pepper/ppb_flash_message_loop_impl.h" |
11 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" | 12 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
12 #include "content/renderer/pepper/ppb_image_data_impl.h" | 13 #include "content/renderer/pepper/ppb_image_data_impl.h" |
13 #include "content/renderer/pepper/ppb_scrollbar_impl.h" | 14 #include "content/renderer/pepper/ppb_scrollbar_impl.h" |
14 #include "content/renderer/pepper/ppb_video_decoder_impl.h" | 15 #include "content/renderer/pepper/ppb_video_decoder_impl.h" |
15 #include "ppapi/c/pp_bool.h" | 16 #include "ppapi/c/pp_bool.h" |
16 #include "ppapi/c/pp_size.h" | 17 #include "ppapi/c/pp_size.h" |
17 #include "ppapi/c/pp_var.h" | 18 #include "ppapi/c/pp_var.h" |
18 #include "ppapi/shared_impl/ppb_audio_config_shared.h" | 19 #include "ppapi/shared_impl/ppb_audio_config_shared.h" |
19 #include "ppapi/shared_impl/ppb_audio_shared.h" | 20 #include "ppapi/shared_impl/ppb_audio_shared.h" |
20 #include "ppapi/shared_impl/ppb_image_data_shared.h" | 21 #include "ppapi/shared_impl/ppb_image_data_shared.h" |
21 #include "ppapi/shared_impl/ppb_input_event_shared.h" | 22 #include "ppapi/shared_impl/ppb_input_event_shared.h" |
22 #include "ppapi/shared_impl/var.h" | 23 #include "ppapi/shared_impl/var.h" |
23 | 24 |
24 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
25 #include "base/command_line.h" | 26 #include "base/command_line.h" |
26 #include "base/win/windows_version.h" | 27 #include "base/win/windows_version.h" |
27 #include "content/public/common/content_switches.h" | |
28 #endif | 28 #endif |
29 | 29 |
30 using ppapi::InputEventData; | 30 using ppapi::InputEventData; |
31 using ppapi::PPB_InputEvent_Shared; | 31 using ppapi::PPB_InputEvent_Shared; |
32 using ppapi::StringVar; | 32 using ppapi::StringVar; |
33 | 33 |
34 namespace content { | 34 namespace content { |
35 | 35 |
36 ResourceCreationImpl::ResourceCreationImpl(PepperPluginInstanceImpl* instance) { | 36 ResourceCreationImpl::ResourceCreationImpl(PepperPluginInstanceImpl* instance) { |
37 } | 37 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 const PP_Size* size, | 133 const PP_Size* size, |
134 PP_Bool init_to_zero) { | 134 PP_Bool init_to_zero) { |
135 #if defined(OS_WIN) | 135 #if defined(OS_WIN) |
136 // If Win32K lockdown mitigations are enabled for Windows 8 and beyond, | 136 // If Win32K lockdown mitigations are enabled for Windows 8 and beyond, |
137 // we use the SIMPLE image data type as the PLATFORM image data type | 137 // we use the SIMPLE image data type as the PLATFORM image data type |
138 // calls GDI functions to create DIB sections etc which fail in Win32K | 138 // calls GDI functions to create DIB sections etc which fail in Win32K |
139 // lockdown mode. | 139 // lockdown mode. |
140 // TODO(ananta) | 140 // TODO(ananta) |
141 // Look into whether this causes a loss of functionality. From cursory | 141 // Look into whether this causes a loss of functionality. From cursory |
142 // testing things seem to work well. | 142 // testing things seem to work well. |
143 if (switches::IsWin32kRendererLockdownEnabled() && | 143 if (IsWin32kRendererLockdownEnabled()) |
144 base::win::GetVersion() >= base::win::VERSION_WIN8) { | |
145 return CreateImageDataSimple(instance, format, size, init_to_zero); | 144 return CreateImageDataSimple(instance, format, size, init_to_zero); |
146 } | |
147 #endif | 145 #endif |
148 return PPB_ImageData_Impl::Create(instance, | 146 return PPB_ImageData_Impl::Create(instance, |
149 ppapi::PPB_ImageData_Shared::PLATFORM, | 147 ppapi::PPB_ImageData_Shared::PLATFORM, |
150 format, | 148 format, |
151 *size, | 149 *size, |
152 init_to_zero); | 150 init_to_zero); |
153 } | 151 } |
154 | 152 |
155 PP_Resource ResourceCreationImpl::CreateImageDataSimple( | 153 PP_Resource ResourceCreationImpl::CreateImageDataSimple( |
156 PP_Instance instance, | 154 PP_Instance instance, |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 wheel_ticks, | 357 wheel_ticks, |
360 scroll_by_page); | 358 scroll_by_page); |
361 } | 359 } |
362 | 360 |
363 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( | 361 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( |
364 PP_Instance instance) { | 362 PP_Instance instance) { |
365 return 0; // Not supported in-process. | 363 return 0; // Not supported in-process. |
366 } | 364 } |
367 | 365 |
368 } // namespace content | 366 } // namespace content |
OLD | NEW |