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

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

Issue 9006028: Coverity fixes for uninitialized vars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing braces Created 8 years, 11 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ppb_var.h" 9 #include "ppapi/c/ppb_var.h"
10 #include "ppapi/proxy/plugin_array_buffer_var.h" 10 #include "ppapi/proxy/plugin_array_buffer_var.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 PP_Var PluginVarTracker::GetOrCreateObjectVarID(ProxyObjectVar* object) { 228 PP_Var PluginVarTracker::GetOrCreateObjectVarID(ProxyObjectVar* object) {
229 // We can't use object->GetPPVar() because we don't want to affect the 229 // We can't use object->GetPPVar() because we don't want to affect the
230 // refcount, so we have to add everything manually here. 230 // refcount, so we have to add everything manually here.
231 int32 var_id = object->GetExistingVarID(); 231 int32 var_id = object->GetExistingVarID();
232 if (!var_id) { 232 if (!var_id) {
233 var_id = AddVarInternal(object, ADD_VAR_CREATE_WITH_NO_REFERENCE); 233 var_id = AddVarInternal(object, ADD_VAR_CREATE_WITH_NO_REFERENCE);
234 object->AssignVarID(var_id); 234 object->AssignVarID(var_id);
235 } 235 }
236 236
237 PP_Var ret; 237 PP_Var ret = { PP_VARTYPE_OBJECT };
238 ret.type = PP_VARTYPE_OBJECT;
239 ret.value.as_id = var_id; 238 ret.value.as_id = var_id;
240 return ret; 239 return ret;
241 } 240 }
242 241
243 void PluginVarTracker::SendAddRefObjectMsg( 242 void PluginVarTracker::SendAddRefObjectMsg(
244 const ProxyObjectVar& proxy_object) { 243 const ProxyObjectVar& proxy_object) {
245 int unused; 244 int unused;
246 proxy_object.dispatcher()->Send(new PpapiHostMsg_PPBVar_AddRefObject( 245 proxy_object.dispatcher()->Send(new PpapiHostMsg_PPBVar_AddRefObject(
247 API_ID_PPB_VAR_DEPRECATED, proxy_object.host_var_id(), &unused)); 246 API_ID_PPB_VAR_DEPRECATED, proxy_object.host_var_id(), &unused));
248 } 247 }
(...skipping 22 matching lines...) Expand all
271 VarMap::iterator ret = live_vars_.find(found->second); 270 VarMap::iterator ret = live_vars_.find(found->second);
272 DCHECK(ret != live_vars_.end()); 271 DCHECK(ret != live_vars_.end());
273 272
274 // All objects should be proxy objects. 273 // All objects should be proxy objects.
275 DCHECK(ret->second.var->AsProxyObjectVar()); 274 DCHECK(ret->second.var->AsProxyObjectVar());
276 return scoped_refptr<ProxyObjectVar>(ret->second.var->AsProxyObjectVar()); 275 return scoped_refptr<ProxyObjectVar>(ret->second.var->AsProxyObjectVar());
277 } 276 }
278 277
279 } // namesace proxy 278 } // namesace proxy
280 } // namespace ppapi 279 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/native_client/src/shared/ppapi_proxy/plugin_resource_tracker.cc ('k') | ppapi/proxy/ppb_var_deprecated_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698