diff options
-rw-r--r-- | net/base/scoped_host_mapper.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/base/scoped_host_mapper.h b/net/base/scoped_host_mapper.h index 82b6c4e..836cb34 100644 --- a/net/base/scoped_host_mapper.h +++ b/net/base/scoped_host_mapper.h @@ -52,7 +52,9 @@ class ScopedHostMapper : public HostMapper { } ~ScopedHostMapper() { - SetHostMapper(previous_host_mapper_); + HostMapper* old_mapper = SetHostMapper(previous_host_mapper_); + // The lifetimes of multiple instances must be nested. + CHECK(old_mapper == this); } // Any hostname matching the given pattern will be replaced with the given |