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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 191 } |
192 | 192 |
193 WebKit::WebPluginContainer* RendererPpapiHostImpl::GetContainerForInstance( | 193 WebKit::WebPluginContainer* RendererPpapiHostImpl::GetContainerForInstance( |
194 PP_Instance instance) const { | 194 PP_Instance instance) const { |
195 PluginInstance* instance_object = GetAndValidateInstance(instance); | 195 PluginInstance* instance_object = GetAndValidateInstance(instance); |
196 if (!instance_object) | 196 if (!instance_object) |
197 return NULL; | 197 return NULL; |
198 return instance_object->container(); | 198 return instance_object->container(); |
199 } | 199 } |
200 | 200 |
| 201 base::ProcessId RendererPpapiHostImpl::GetPluginPID() const { |
| 202 if (dispatcher_) |
| 203 return dispatcher_->channel()->peer_pid(); |
| 204 return base::kNullProcessId; |
| 205 } |
| 206 |
201 bool RendererPpapiHostImpl::HasUserGesture(PP_Instance instance) const { | 207 bool RendererPpapiHostImpl::HasUserGesture(PP_Instance instance) const { |
202 PluginInstance* instance_object = GetAndValidateInstance(instance); | 208 PluginInstance* instance_object = GetAndValidateInstance(instance); |
203 if (!instance_object) | 209 if (!instance_object) |
204 return false; | 210 return false; |
205 | 211 |
206 if (instance_object->module()->permissions().HasPermission( | 212 if (instance_object->module()->permissions().HasPermission( |
207 ppapi::PERMISSION_BYPASS_USER_GESTURE)) | 213 ppapi::PERMISSION_BYPASS_USER_GESTURE)) |
208 return true; | 214 return true; |
209 return instance_object->IsProcessingUserGesture(); | 215 return instance_object->IsProcessingUserGesture(); |
210 } | 216 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 PP_Instance pp_instance) const { | 272 PP_Instance pp_instance) const { |
267 PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance); | 273 PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance); |
268 if (!instance) | 274 if (!instance) |
269 return NULL; | 275 return NULL; |
270 if (!instance->IsValidInstanceOf(module_)) | 276 if (!instance->IsValidInstanceOf(module_)) |
271 return NULL; | 277 return NULL; |
272 return instance; | 278 return instance; |
273 } | 279 } |
274 | 280 |
275 } // namespace content | 281 } // namespace content |
OLD | NEW |