Chromium Code Reviews| Index: base/allocator/allocator_extension.cc |
| diff --git a/base/allocator/allocator_extension.cc b/base/allocator/allocator_extension.cc |
| index 7ae11da3e301121f328b265dac2bf489d3c5b52e..d19f51d78fc03ee55e967ae3ebd3a620ef8ace12 100644 |
| --- a/base/allocator/allocator_extension.cc |
| +++ b/base/allocator/allocator_extension.cc |
| @@ -9,6 +9,14 @@ |
| namespace base { |
| namespace allocator { |
| +bool GetProperty(const char* name, size_t* value) { |
| + if (thunks::GetPropertyFunction* get_property_function = |
| + base::allocator::thunks::GetGetPropertyFunction()) |
|
jar (doing other things)
2012/08/11 03:39:46
nit: No reason to put a declaration in an if.... s
alexeif
2012/08/11 11:19:55
I don't like assignments inside 'if' either. I jus
|
| + return get_property_function(name, value); |
| + else |
|
jar (doing other things)
2012/08/11 03:39:46
nit: no need for else... as you're returning.
alexeif
2012/08/11 11:19:55
Done.
|
| + return false; |
| +} |
| + |
| void GetStats(char* buffer, int buffer_length) { |
| DCHECK_GT(buffer_length, 0); |
| if (thunks::GetStatsFunction* get_stats_function = |
| @@ -24,6 +32,13 @@ void ReleaseFreeMemory() { |
| release_free_memory_function(); |
| } |
| +void SetGetPropertyFunction( |
| + thunks::GetPropertyFunction* get_property_function) { |
| + DCHECK_EQ(base::allocator::thunks::GetGetPropertyFunction(), |
| + reinterpret_cast<thunks::GetPropertyFunction*>(NULL)); |
| + base::allocator::thunks::SetGetPropertyFunction(get_property_function); |
| +} |
| + |
| void SetGetStatsFunction(thunks::GetStatsFunction* get_stats_function) { |
| DCHECK_EQ(base::allocator::thunks::GetGetStatsFunction(), |
| reinterpret_cast<thunks::GetStatsFunction*>(NULL)); |