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

Side by Side Diff: ppapi/proxy/plugin_var_tracker.cc

Issue 15806016: Update ppapi/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/proxy/plugin_globals.cc ('k') | ppapi/proxy/plugin_var_tracker_unittest.cc » ('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 "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
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
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
OLDNEW
« no previous file with comments | « ppapi/proxy/plugin_globals.cc ('k') | ppapi/proxy/plugin_var_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698