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

Side by Side Diff: ppapi/native_client/src/shared/ppapi_proxy/plugin_resource_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
« no previous file with comments | « gpu/command_buffer/service/command_buffer_service.cc ('k') | ppapi/proxy/plugin_var_tracker.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) 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 "native_client/src/shared/ppapi_proxy/plugin_resource_tracker.h" 5 #include "native_client/src/shared/ppapi_proxy/plugin_resource_tracker.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 22 matching lines...) Expand all
33 33
34 scoped_refptr<PluginResource> PluginResourceTracker::GetExistingResource( 34 scoped_refptr<PluginResource> PluginResourceTracker::GetExistingResource(
35 PP_Resource res) const { 35 PP_Resource res) const {
36 ResourceMap::const_iterator result = live_resources_.find(res); 36 ResourceMap::const_iterator result = live_resources_.find(res);
37 if (result == live_resources_.end()) 37 if (result == live_resources_.end())
38 return scoped_refptr<PluginResource>(); 38 return scoped_refptr<PluginResource>();
39 else 39 else
40 return result->second.resource; 40 return result->second.resource;
41 } 41 }
42 42
43 PluginResourceTracker::PluginResourceTracker() { 43 PluginResourceTracker::PluginResourceTracker() : last_id_(0) {
44 } 44 }
45 45
46 void PluginResourceTracker::AddResource(PluginResource* resource, 46 void PluginResourceTracker::AddResource(PluginResource* resource,
47 PP_Resource id, 47 PP_Resource id,
48 size_t browser_refcount) { 48 size_t browser_refcount) {
49 // Add the resource with plugin use-count 1. 49 // Add the resource with plugin use-count 1.
50 live_resources_.insert( 50 live_resources_.insert(
51 std::make_pair(id, ResourceAndRefCounts(resource, browser_refcount))); 51 std::make_pair(id, ResourceAndRefCounts(resource, browser_refcount)));
52 } 52 }
53 53
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // Release all browser references. 99 // Release all browser references.
100 if (res && (browser_refcount > 0)) { 100 if (res && (browser_refcount > 0)) {
101 NaClSrpcChannel* channel = ppapi_proxy::GetMainSrpcChannel(); 101 NaClSrpcChannel* channel = ppapi_proxy::GetMainSrpcChannel();
102 PpbCoreRpcClient::ReleaseResourceMultipleTimes(channel, res, 102 PpbCoreRpcClient::ReleaseResourceMultipleTimes(channel, res,
103 browser_refcount); 103 browser_refcount);
104 } 104 }
105 } 105 }
106 106
107 } // namespace ppapi_proxy 107 } // namespace ppapi_proxy
108 108
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/command_buffer_service.cc ('k') | ppapi/proxy/plugin_var_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698