| 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/renderer_ppapi_host_impl.h" | 5 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "content/common/sandbox_util.h" | 10 #include "content/common/sandbox_util.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 | 195 |
| 196 WebKit::WebPluginContainer* RendererPpapiHostImpl::GetContainerForInstance( | 196 WebKit::WebPluginContainer* RendererPpapiHostImpl::GetContainerForInstance( |
| 197 PP_Instance instance) const { | 197 PP_Instance instance) const { |
| 198 PluginInstance* instance_object = GetAndValidateInstance(instance); | 198 PluginInstance* instance_object = GetAndValidateInstance(instance); |
| 199 if (!instance_object) | 199 if (!instance_object) |
| 200 return NULL; | 200 return NULL; |
| 201 return instance_object->container(); | 201 return instance_object->container(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 base::ProcessId RendererPpapiHostImpl::GetPluginPID() const { |
| 205 if (dispatcher_) |
| 206 return dispatcher_->channel()->peer_pid(); |
| 207 return base::kNullProcessId; |
| 208 } |
| 209 |
| 204 bool RendererPpapiHostImpl::HasUserGesture(PP_Instance instance) const { | 210 bool RendererPpapiHostImpl::HasUserGesture(PP_Instance instance) const { |
| 205 PluginInstance* instance_object = GetAndValidateInstance(instance); | 211 PluginInstance* instance_object = GetAndValidateInstance(instance); |
| 206 if (!instance_object) | 212 if (!instance_object) |
| 207 return false; | 213 return false; |
| 208 | 214 |
| 209 if (instance_object->module()->permissions().HasPermission( | 215 if (instance_object->module()->permissions().HasPermission( |
| 210 ppapi::PERMISSION_BYPASS_USER_GESTURE)) | 216 ppapi::PERMISSION_BYPASS_USER_GESTURE)) |
| 211 return true; | 217 return true; |
| 212 return instance_object->IsProcessingUserGesture(); | 218 return instance_object->IsProcessingUserGesture(); |
| 213 } | 219 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 PP_Instance pp_instance) const { | 275 PP_Instance pp_instance) const { |
| 270 PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance); | 276 PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance); |
| 271 if (!instance) | 277 if (!instance) |
| 272 return NULL; | 278 return NULL; |
| 273 if (!instance->IsValidInstanceOf(module_)) | 279 if (!instance->IsValidInstanceOf(module_)) |
| 274 return NULL; | 280 return NULL; |
| 275 return instance; | 281 return instance; |
| 276 } | 282 } |
| 277 | 283 |
| 278 } // namespace content | 284 } // namespace content |
| OLD | NEW |