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 "base/metrics/sparse_histogram.h" | 7 #include "base/metrics/sparse_histogram.h" |
8 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" | 8 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" |
9 #include "content/browser/tracing/trace_message_filter.h" | 9 #include "content/browser/tracing/trace_message_filter.h" |
10 #include "content/common/pepper_renderer_instance_data.h" | 10 #include "content/common/pepper_renderer_instance_data.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 if (data == nullptr) | 134 if (data == nullptr) |
135 return GURL(); | 135 return GURL(); |
136 return data->renderer_data.plugin_url; | 136 return data->renderer_data.plugin_url; |
137 } | 137 } |
138 | 138 |
139 void BrowserPpapiHostImpl::SetOnKeepaliveCallback( | 139 void BrowserPpapiHostImpl::SetOnKeepaliveCallback( |
140 const BrowserPpapiHost::OnKeepaliveCallback& callback) { | 140 const BrowserPpapiHost::OnKeepaliveCallback& callback) { |
141 on_keepalive_callback_ = callback; | 141 on_keepalive_callback_ = callback; |
142 } | 142 } |
143 | 143 |
144 bool BrowserPpapiHostImpl::IsPotentiallySecurePluginContext( | |
145 PP_Instance instance) { | |
146 auto* data = instance_map_.get(instance); | |
Ryan Sleevi
2015/05/12 22:56:05
nit: why the auto*? Why not let auto bind to the a
dcheng
2015/05/12 23:56:20
(I'm not raymes@ but I personally prefer auto* whe
raymes
2015/05/13 00:07:19
I copied the code from other functions in here. I'
raymes
2015/05/13 00:08:00
based on dcheng's comment, I left it as-is :P but
| |
147 if (data == nullptr) | |
148 return false; | |
149 return data->renderer_data.is_potentially_secure_plugin_context; | |
150 } | |
151 | |
144 void BrowserPpapiHostImpl::AddInstance( | 152 void BrowserPpapiHostImpl::AddInstance( |
145 PP_Instance instance, | 153 PP_Instance instance, |
146 const PepperRendererInstanceData& renderer_instance_data) { | 154 const PepperRendererInstanceData& renderer_instance_data) { |
147 DCHECK(!instance_map_.contains(instance)); | 155 DCHECK(!instance_map_.contains(instance)); |
148 instance_map_.add(instance, | 156 instance_map_.add(instance, |
149 make_scoped_ptr(new InstanceData(renderer_instance_data))); | 157 make_scoped_ptr(new InstanceData(renderer_instance_data))); |
150 } | 158 } |
151 | 159 |
152 void BrowserPpapiHostImpl::DeleteInstance(PP_Instance instance) { | 160 void BrowserPpapiHostImpl::DeleteInstance(PP_Instance instance) { |
153 int erased = instance_map_.erase(instance); | 161 int erased = instance_map_.erase(instance); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 instance->second->renderer_data.render_frame_id; | 264 instance->second->renderer_data.render_frame_id; |
257 instance_data[i].document_url = | 265 instance_data[i].document_url = |
258 instance->second->renderer_data.document_url; | 266 instance->second->renderer_data.document_url; |
259 ++instance; | 267 ++instance; |
260 ++i; | 268 ++i; |
261 } | 269 } |
262 on_keepalive_callback_.Run(instance_data, profile_data_directory_); | 270 on_keepalive_callback_.Run(instance_data, profile_data_directory_); |
263 } | 271 } |
264 | 272 |
265 } // namespace content | 273 } // namespace content |
OLD | NEW |