Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Side by Side Diff: webkit/plugins/ppapi/host_globals.cc

Issue 10542150: Actually free plugin implement vars when running out of process when the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/shared_impl/var_tracker.h ('k') | webkit/plugins/ppapi/host_var_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "webkit/plugins/ppapi/host_globals.h" 5 #include "webkit/plugins/ppapi/host_globals.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 !instance->module()->ReserveInstanceID(new_instance)); 233 !instance->module()->ReserveInstanceID(new_instance));
234 234
235 instance_map_[new_instance] = instance; 235 instance_map_[new_instance] = instance;
236 236
237 resource_tracker_.DidCreateInstance(new_instance); 237 resource_tracker_.DidCreateInstance(new_instance);
238 return new_instance; 238 return new_instance;
239 } 239 }
240 240
241 void HostGlobals::InstanceDeleted(PP_Instance instance) { 241 void HostGlobals::InstanceDeleted(PP_Instance instance) {
242 resource_tracker_.DidDeleteInstance(instance); 242 resource_tracker_.DidDeleteInstance(instance);
243 host_var_tracker_.ForceFreeNPObjectsForInstance(instance); 243 host_var_tracker_.DidDeleteInstance(instance);
244 instance_map_.erase(instance); 244 instance_map_.erase(instance);
245 } 245 }
246 246
247 void HostGlobals::InstanceCrashed(PP_Instance instance) { 247 void HostGlobals::InstanceCrashed(PP_Instance instance) {
248 resource_tracker_.DidDeleteInstance(instance); 248 resource_tracker_.DidDeleteInstance(instance);
249 host_var_tracker_.ForceFreeNPObjectsForInstance(instance); 249 host_var_tracker_.DidDeleteInstance(instance);
250 } 250 }
251 251
252 PluginInstance* HostGlobals::GetInstance(PP_Instance instance) { 252 PluginInstance* HostGlobals::GetInstance(PP_Instance instance) {
253 DLOG_IF(ERROR, !CheckIdType(instance, ::ppapi::PP_ID_TYPE_INSTANCE)) 253 DLOG_IF(ERROR, !CheckIdType(instance, ::ppapi::PP_ID_TYPE_INSTANCE))
254 << instance << " is not a PP_Instance."; 254 << instance << " is not a PP_Instance.";
255 InstanceMap::iterator found = instance_map_.find(instance); 255 InstanceMap::iterator found = instance_map_.find(instance);
256 if (found == instance_map_.end()) 256 if (found == instance_map_.end())
257 return NULL; 257 return NULL;
258 return found->second; 258 return found->second;
259 } 259 }
260 260
261 bool HostGlobals::IsHostGlobals() const { 261 bool HostGlobals::IsHostGlobals() const {
262 return true; 262 return true;
263 } 263 }
264 264
265 } // namespace ppapi 265 } // namespace ppapi
266 } // namespace webkit 266 } // namespace webkit
OLDNEW
« no previous file with comments | « ppapi/shared_impl/var_tracker.h ('k') | webkit/plugins/ppapi/host_var_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698