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 "ppapi/proxy/plugin_var_tracker.h" | 5 #include "ppapi/proxy/plugin_var_tracker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 DCHECK(iter->second.ref_count == 0); | 400 DCHECK(iter->second.ref_count == 0); |
401 SendReleaseObjectMsg(*object); | 401 SendReleaseObjectMsg(*object); |
402 | 402 |
403 UserDataToPluginImplementedVarMap::iterator found = | 403 UserDataToPluginImplementedVarMap::iterator found = |
404 user_data_to_plugin_.find(object->user_data()); | 404 user_data_to_plugin_.find(object->user_data()); |
405 if (found != user_data_to_plugin_.end()) { | 405 if (found != user_data_to_plugin_.end()) { |
406 // This object is implemented in the plugin. | 406 // This object is implemented in the plugin. |
407 if (found->second.instance == 0) { | 407 if (found->second.instance == 0) { |
408 // Instance is destroyed. This means that we'll never get a Deallocate | 408 // Instance is destroyed. This means that we'll never get a Deallocate |
409 // call from the renderer and we should do so now. | 409 // call from the renderer and we should do so now. |
410 found->second.ppp_class->Deallocate(found->first); | 410 CallWhileUnlocked(found->second.ppp_class->Deallocate, found->first); |
411 user_data_to_plugin_.erase(found); | 411 user_data_to_plugin_.erase(found); |
412 } else { | 412 } else { |
413 // The plugin is releasing its last reference to an object it implements. | 413 // The plugin is releasing its last reference to an object it implements. |
414 // Clear the tracking data that links our "plugin implemented object" to | 414 // Clear the tracking data that links our "plugin implemented object" to |
415 // the var. If the instance is destroyed and there is no ID, we know that | 415 // the var. If the instance is destroyed and there is no ID, we know that |
416 // we should just call Deallocate on the object data. | 416 // we should just call Deallocate on the object data. |
417 // | 417 // |
418 // See the plugin_object_id declaration for more info. | 418 // See the plugin_object_id declaration for more info. |
419 found->second.plugin_object_id = 0; | 419 found->second.plugin_object_id = 0; |
420 } | 420 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 int id, | 507 int id, |
508 PP_Instance instance, | 508 PP_Instance instance, |
509 base::SharedMemoryHandle* handle, | 509 base::SharedMemoryHandle* handle, |
510 uint32_t* size_in_bytes) { | 510 uint32_t* size_in_bytes) { |
511 NOTREACHED(); | 511 NOTREACHED(); |
512 return false; | 512 return false; |
513 } | 513 } |
514 | 514 |
515 } // namesace proxy | 515 } // namesace proxy |
516 } // namespace ppapi | 516 } // namespace ppapi |
OLD | NEW |