| 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/browser/renderer_host/pepper/browser_ppapi_host_impl.h" | 5 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" | 7 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" |
| 8 #include "content/browser/tracing/trace_message_filter.h" | 8 #include "content/browser/tracing/trace_message_filter.h" |
| 9 #include "content/common/pepper_renderer_instance_data.h" | 9 #include "content/common/pepper_renderer_instance_data.h" |
| 10 #include "content/public/common/process_type.h" | 10 #include "content/public/common/process_type.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 base::ProcessHandle BrowserPpapiHostImpl::GetPluginProcessHandle() const { | 77 base::ProcessHandle BrowserPpapiHostImpl::GetPluginProcessHandle() const { |
| 78 // Handle should previously have been set before use. | 78 // Handle should previously have been set before use. |
| 79 DCHECK(plugin_process_handle_ != base::kNullProcessHandle); | 79 DCHECK(plugin_process_handle_ != base::kNullProcessHandle); |
| 80 return plugin_process_handle_; | 80 return plugin_process_handle_; |
| 81 } | 81 } |
| 82 | 82 |
| 83 bool BrowserPpapiHostImpl::IsValidInstance(PP_Instance instance) const { | 83 bool BrowserPpapiHostImpl::IsValidInstance(PP_Instance instance) const { |
| 84 return instance_map_.find(instance) != instance_map_.end(); | 84 return instance_map_.find(instance) != instance_map_.end(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool BrowserPpapiHostImpl::GetRenderViewIDsForInstance( | 87 bool BrowserPpapiHostImpl::GetRenderFrameIDsForInstance( |
| 88 PP_Instance instance, | 88 PP_Instance instance, |
| 89 int* render_process_id, | 89 int* render_process_id, |
| 90 int* render_view_id) const { | 90 int* render_frame_id) const { |
| 91 InstanceMap::const_iterator found = instance_map_.find(instance); | 91 InstanceMap::const_iterator found = instance_map_.find(instance); |
| 92 if (found == instance_map_.end()) { | 92 if (found == instance_map_.end()) { |
| 93 *render_process_id = 0; | 93 *render_process_id = 0; |
| 94 *render_view_id = 0; | 94 *render_frame_id = 0; |
| 95 return false; | 95 return false; |
| 96 } | 96 } |
| 97 | 97 |
| 98 *render_process_id = found->second.render_process_id; | 98 *render_process_id = found->second.render_process_id; |
| 99 *render_view_id = found->second.render_view_id; | 99 *render_frame_id = found->second.render_frame_id; |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 const std::string& BrowserPpapiHostImpl::GetPluginName() { | 103 const std::string& BrowserPpapiHostImpl::GetPluginName() { |
| 104 return plugin_name_; | 104 return plugin_name_; |
| 105 } | 105 } |
| 106 | 106 |
| 107 const base::FilePath& BrowserPpapiHostImpl::GetPluginPath() { | 107 const base::FilePath& BrowserPpapiHostImpl::GetPluginPath() { |
| 108 return plugin_path_; | 108 return plugin_path_; |
| 109 } | 109 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 if (on_keepalive_callback_.is_null()) | 195 if (on_keepalive_callback_.is_null()) |
| 196 return; | 196 return; |
| 197 | 197 |
| 198 BrowserPpapiHost::OnKeepaliveInstanceData | 198 BrowserPpapiHost::OnKeepaliveInstanceData |
| 199 instance_data(instance_map_.size()); | 199 instance_data(instance_map_.size()); |
| 200 | 200 |
| 201 InstanceMap::iterator instance = instance_map_.begin(); | 201 InstanceMap::iterator instance = instance_map_.begin(); |
| 202 int i = 0; | 202 int i = 0; |
| 203 while (instance != instance_map_.end()) { | 203 while (instance != instance_map_.end()) { |
| 204 instance_data[i].render_process_id = instance->second.render_process_id; | 204 instance_data[i].render_process_id = instance->second.render_process_id; |
| 205 instance_data[i].render_view_id = instance->second.render_view_id; | 205 instance_data[i].render_frame_id = instance->second.render_frame_id; |
| 206 instance_data[i].document_url = instance->second.document_url; | 206 instance_data[i].document_url = instance->second.document_url; |
| 207 ++instance; | 207 ++instance; |
| 208 ++i; | 208 ++i; |
| 209 } | 209 } |
| 210 on_keepalive_callback_.Run(instance_data, profile_data_directory_); | 210 on_keepalive_callback_.Run(instance_data, profile_data_directory_); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace content | 213 } // namespace content |
| OLD | NEW |