Chromium Code Reviews| Index: ppapi/cpp/var.h |
| diff --git a/ppapi/cpp/var.h b/ppapi/cpp/var.h |
| index b0914be3de7f473c81cf76571ab9edce6d9f199e..b44e46aa3dcc23c94437824b5068d38f14b68d01 100644 |
| --- a/ppapi/cpp/var.h |
| +++ b/ppapi/cpp/var.h |
| @@ -57,7 +57,7 @@ class Var { |
| /// the reference count will not normally be incremented for you. |
| Var(PassRef, PP_Var var) { |
| var_ = var; |
| - needs_release_ = true; |
| + needs_management_ = true; |
| } |
| struct DontManage {}; |
| @@ -72,7 +72,7 @@ class Var { |
| /// @param[in] var A <code>Var</code>. |
| Var(DontManage, PP_Var var) { |
| var_ = var; |
| - needs_release_ = false; |
| + needs_management_ = false; |
| } |
| /// A constructor for copying a <code>Var</code>. |
| @@ -211,7 +211,7 @@ class Var { |
| PP_Var Detach() { |
| PP_Var ret = var_; |
| var_ = PP_MakeUndefined(); |
| - needs_release_ = false; |
| + needs_management_ = true; |
| return ret; |
| } |
| @@ -280,7 +280,10 @@ class Var { |
| protected: |
| PP_Var var_; |
| - bool needs_release_; |
| + |
| + // |needs_management_| indicates if the instance manages |var_|. |
| + // You need to check if |var_| is refcounted to call Release(). |
| + bool needs_management_; |
|
dmichael (off chromium)
2012/09/10 16:21:14
Good idea on the rename. How about is_managed_? A
Takashi Toyoshima
2012/09/11 08:38:15
Agreed.
|
| private: |
| // Prevent an arbitrary pointer argument from being implicitly converted to |