| 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 "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "ppapi/c/dev/ppp_class_deprecated.h" | 9 #include "ppapi/c/dev/ppp_class_deprecated.h" |
| 10 #include "ppapi/c/ppb_var.h" | 10 #include "ppapi/c/ppb_var.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // Actually create the PP_Var, this will add all the tracking info but not | 49 // Actually create the PP_Var, this will add all the tracking info but not |
| 50 // adjust any refcounts. | 50 // adjust any refcounts. |
| 51 PP_Var ret = GetOrCreateObjectVarID(object.get()); | 51 PP_Var ret = GetOrCreateObjectVarID(object.get()); |
| 52 | 52 |
| 53 VarInfo& info = GetLiveVar(ret)->second; | 53 VarInfo& info = GetLiveVar(ret)->second; |
| 54 if (info.ref_count > 0) { | 54 if (info.ref_count > 0) { |
| 55 // We already had a reference to it before. That means the renderer now has | 55 // We already had a reference to it before. That means the renderer now has |
| 56 // two references on our behalf. We want to transfer that extra reference | 56 // two references on our behalf. We want to transfer that extra reference |
| 57 // to our list. This means we addref in the plugin, and release the extra | 57 // to our list. This means we addref in the plugin, and release the extra |
| 58 // one in the renderer. | 58 // one in the renderer. |
| 59 SendReleaseObjectMsg(*object); | 59 SendReleaseObjectMsg(*object.get()); |
| 60 } | 60 } |
| 61 info.ref_count++; | 61 info.ref_count++; |
| 62 return ret; | 62 return ret; |
| 63 } | 63 } |
| 64 | 64 |
| 65 PP_Var PluginVarTracker::TrackObjectWithNoReference( | 65 PP_Var PluginVarTracker::TrackObjectWithNoReference( |
| 66 const PP_Var& host_var, | 66 const PP_Var& host_var, |
| 67 PluginDispatcher* dispatcher) { | 67 PluginDispatcher* dispatcher) { |
| 68 CheckThreadingPreconditions(); | 68 CheckThreadingPreconditions(); |
| 69 DCHECK(host_var.type == PP_VARTYPE_OBJECT); | 69 DCHECK(host_var.type == PP_VARTYPE_OBJECT); |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 int id, | 400 int id, |
| 401 PP_Instance instance, | 401 PP_Instance instance, |
| 402 base::SharedMemoryHandle* handle, | 402 base::SharedMemoryHandle* handle, |
| 403 uint32* size_in_bytes) { | 403 uint32* size_in_bytes) { |
| 404 NOTREACHED(); | 404 NOTREACHED(); |
| 405 return false; | 405 return false; |
| 406 } | 406 } |
| 407 | 407 |
| 408 } // namesace proxy | 408 } // namesace proxy |
| 409 } // namespace ppapi | 409 } // namespace ppapi |
| OLD | NEW |