| 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/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/metrics/sparse_histogram.h" | 8 #include "base/metrics/sparse_histogram.h" |
| 9 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" | 9 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" |
| 10 #include "content/browser/tracing/trace_message_filter.h" | 10 #include "content/browser/tracing/trace_message_filter.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 if (data == nullptr) | 148 if (data == nullptr) |
| 149 return false; | 149 return false; |
| 150 return data->renderer_data.is_potentially_secure_plugin_context; | 150 return data->renderer_data.is_potentially_secure_plugin_context; |
| 151 } | 151 } |
| 152 | 152 |
| 153 void BrowserPpapiHostImpl::AddInstance( | 153 void BrowserPpapiHostImpl::AddInstance( |
| 154 PP_Instance instance, | 154 PP_Instance instance, |
| 155 const PepperRendererInstanceData& renderer_instance_data) { | 155 const PepperRendererInstanceData& renderer_instance_data) { |
| 156 DCHECK(!instance_map_.contains(instance)); | 156 DCHECK(!instance_map_.contains(instance)); |
| 157 instance_map_.add(instance, | 157 instance_map_.add(instance, |
| 158 base::WrapUnique(new InstanceData(renderer_instance_data))); | 158 base::MakeUnique<InstanceData>(renderer_instance_data)); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void BrowserPpapiHostImpl::DeleteInstance(PP_Instance instance) { | 161 void BrowserPpapiHostImpl::DeleteInstance(PP_Instance instance) { |
| 162 int erased = instance_map_.erase(instance); | 162 int erased = instance_map_.erase(instance); |
| 163 DCHECK_EQ(1, erased); | 163 DCHECK_EQ(1, erased); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void BrowserPpapiHostImpl::AddInstanceObserver(PP_Instance instance, | 166 void BrowserPpapiHostImpl::AddInstanceObserver(PP_Instance instance, |
| 167 InstanceObserver* observer) { | 167 InstanceObserver* observer) { |
| 168 instance_map_.get(instance)->observer_list.AddObserver(observer); | 168 instance_map_.get(instance)->observer_list.AddObserver(observer); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 instance->second->renderer_data.render_frame_id; | 265 instance->second->renderer_data.render_frame_id; |
| 266 instance_data[i].document_url = | 266 instance_data[i].document_url = |
| 267 instance->second->renderer_data.document_url; | 267 instance->second->renderer_data.document_url; |
| 268 ++instance; | 268 ++instance; |
| 269 ++i; | 269 ++i; |
| 270 } | 270 } |
| 271 on_keepalive_callback_.Run(instance_data, profile_data_directory_); | 271 on_keepalive_callback_.Run(instance_data, profile_data_directory_); |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace content | 274 } // namespace content |
| OLD | NEW |