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

Unified Diff: ppapi/shared_impl/var.h

Issue 8872065: Pepper: Var keeps invalid var_id if VarTracker release it and there is another reference (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove redundant comma Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ppapi/shared_impl/var_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/var.h
diff --git a/ppapi/shared_impl/var.h b/ppapi/shared_impl/var.h
index 988898a0b4c17476a5256479ac2da9da6c22b8e2..49b9272190f93fc4c15cd3f126288e3cbff5aa6e 100644
--- a/ppapi/shared_impl/var.h
+++ b/ppapi/shared_impl/var.h
@@ -17,6 +17,7 @@ namespace ppapi {
class NPObjectVar;
class ProxyObjectVar;
class StringVar;
+class VarTracker;
// Var -------------------------------------------------------------------------
@@ -48,6 +49,8 @@ class PPAPI_SHARED_EXPORT Var : public base::RefCounted<Var> {
int32 GetExistingVarID() const;
protected:
+ friend class VarTracker;
+
Var();
// Returns the unique ID associated with this string or object, creating it
@@ -62,6 +65,9 @@ class PPAPI_SHARED_EXPORT Var : public base::RefCounted<Var> {
// before. This is used in cases where the ID is generated externally.
void AssignVarID(int32 id);
+ // Reset the assigned object ID.
+ void ResetVarID() { var_id_ = 0; }
+
private:
// This will be 0 if no ID has been assigned (this happens lazily).
int32 var_id_;
« no previous file with comments | « no previous file | ppapi/shared_impl/var_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698