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

Side by Side Diff: ppapi/shared_impl/resource_tracker.h

Issue 26308002: Fix some WeakPtrFactory members that aren't last (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix weak ptr initialization Created 7 years, 2 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/ppb_var_deprecated_proxy.cc ('k') | no next file » | 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 #ifndef PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ 5 #ifndef PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_
6 #define PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ 6 #define PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // behalf of the plugin. When it drops to 0, we free that ref, keeping 119 // behalf of the plugin. When it drops to 0, we free that ref, keeping
120 // the resource in the list. 120 // the resource in the list.
121 // 121 //
122 // A resource will be in this list as long as the object is alive. 122 // A resource will be in this list as long as the object is alive.
123 typedef std::pair<Resource*, int> ResourceAndRefCount; 123 typedef std::pair<Resource*, int> ResourceAndRefCount;
124 typedef base::hash_map<PP_Resource, ResourceAndRefCount> ResourceMap; 124 typedef base::hash_map<PP_Resource, ResourceAndRefCount> ResourceMap;
125 ResourceMap live_resources_; 125 ResourceMap live_resources_;
126 126
127 int32 last_resource_value_; 127 int32 last_resource_value_;
128 128
129 base::WeakPtrFactory<ResourceTracker> weak_ptr_factory_;
130
131 // On the host side, we want to check that we are only called on the main 129 // On the host side, we want to check that we are only called on the main
132 // thread. This is to protect us from accidentally using the tracker from 130 // thread. This is to protect us from accidentally using the tracker from
133 // other threads (especially the IO thread). On the plugin side, the tracker 131 // other threads (especially the IO thread). On the plugin side, the tracker
134 // is protected by the proxy lock and is thread-safe, so this will be NULL. 132 // is protected by the proxy lock and is thread-safe, so this will be NULL.
135 scoped_ptr<base::ThreadChecker> thread_checker_; 133 scoped_ptr<base::ThreadChecker> thread_checker_;
136 134
135 base::WeakPtrFactory<ResourceTracker> weak_ptr_factory_;
136
137 DISALLOW_COPY_AND_ASSIGN(ResourceTracker); 137 DISALLOW_COPY_AND_ASSIGN(ResourceTracker);
138 }; 138 };
139 139
140 } // namespace ppapi 140 } // namespace ppapi
141 141
142 #endif // PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ 142 #endif // PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_var_deprecated_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698