diff --git a/ppapi/proxy/plugin_var_tracker.cc b/ppapi/proxy/plugin_var_tracker.cc index c3a4c369f0d76..b8fcd568581d5 100644 --- a/ppapi/proxy/plugin_var_tracker.cc +++ b/ppapi/proxy/plugin_var_tracker.cc @@ -6,6 +6,8 @@ #include +#include + #include "base/memory/ref_counted.h" #include "base/memory/singleton.h" #include "ipc/ipc_message.h" @@ -79,6 +81,7 @@ PP_Var PluginVarTracker::ReceiveObjectPassRef(const PP_Var& host_var, SendReleaseObjectMsg(*object.get()); } info.ref_count++; + CHECK(info.ref_count != std::numeric_limits::max()); return ret; } diff --git a/ppapi/shared_impl/var_tracker.cc b/ppapi/shared_impl/var_tracker.cc index 0d777590bb5fd..40156b4895f05 100644 --- a/ppapi/shared_impl/var_tracker.cc +++ b/ppapi/shared_impl/var_tracker.cc @@ -83,6 +83,7 @@ bool VarTracker::AddRefVar(int32_t var_id) { // Basic refcount increment. info.ref_count++; + CHECK(info.ref_count != std::numeric_limits::max()); return true; }