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

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

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.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 DCHECK(CalledOnValidThread()); 68 DCHECK(CalledOnValidThread());
69 DCHECK(host_var.type == PP_VARTYPE_OBJECT); 69 DCHECK(host_var.type == PP_VARTYPE_OBJECT);
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 VarMap::iterator ret = live_vars_.find(found->second); 364 VarMap::iterator ret = live_vars_.find(found->second);
365 DCHECK(ret != live_vars_.end()); 365 DCHECK(ret != live_vars_.end());
366 366
367 // All objects should be proxy objects. 367 // All objects should be proxy objects.
368 DCHECK(ret->second.var->AsProxyObjectVar()); 368 DCHECK(ret->second.var->AsProxyObjectVar());
369 return scoped_refptr<ProxyObjectVar>(ret->second.var->AsProxyObjectVar()); 369 return scoped_refptr<ProxyObjectVar>(ret->second.var->AsProxyObjectVar());
370 } 370 }
371 371
372 } // namesace proxy 372 } // namesace proxy
373 } // namespace ppapi 373 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.cc ('k') | ppapi/proxy/plugin_var_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698