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

Unified Diff: base/allocator/allocator_extension.cc

Issue 1487403002: Remove allocator_extension_thunks since this layer is not required (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hm, do not remove allocator_unittests. Created 5 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 | « base/allocator/allocator_extension.h ('k') | base/allocator/allocator_extension_thunks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/allocator_extension.cc
diff --git a/base/allocator/allocator_extension.cc b/base/allocator/allocator_extension.cc
index 75918d1c4a61b9222497bec548828a2f1ffcc8d1..a2b7088f7c8564bd4c3ff6325867e5960a1ec20a 100644
--- a/base/allocator/allocator_extension.cc
+++ b/base/allocator/allocator_extension.cc
@@ -9,25 +9,33 @@
namespace base {
namespace allocator {
+namespace {
+ReleaseFreeMemoryFunction g_release_free_memory_function = NULL;
Primiano Tucci (use gerrit) 2015/12/02 13:50:42 s/NULL/nullptr/ since you are touching this file y
ssid 2015/12/02 14:03:34 Done.
+GetNumericPropertyFunction g_get_numeric_property_function = NULL;
+}
+
void ReleaseFreeMemory() {
- thunks::ReleaseFreeMemoryFunction release_free_memory_function =
- thunks::GetReleaseFreeMemoryFunction();
- if (release_free_memory_function)
- release_free_memory_function();
+ if (g_release_free_memory_function)
+ g_release_free_memory_function();
+}
+
+bool GetNumericProperty(const char* name, size_t* value) {
+ return g_get_numeric_property_function != NULL &&
Primiano Tucci (use gerrit) 2015/12/02 13:50:42 s/!= NULL//
ssid 2015/12/02 14:03:34 Done.
+ g_get_numeric_property_function(name, value);
}
void SetReleaseFreeMemoryFunction(
- thunks::ReleaseFreeMemoryFunction release_free_memory_function) {
- DCHECK_EQ(thunks::GetReleaseFreeMemoryFunction(),
- reinterpret_cast<thunks::ReleaseFreeMemoryFunction>(NULL));
- thunks::SetReleaseFreeMemoryFunction(release_free_memory_function);
+ ReleaseFreeMemoryFunction release_free_memory_function) {
+ DCHECK_EQ(g_release_free_memory_function,
+ reinterpret_cast<ReleaseFreeMemoryFunction>(NULL));
+ g_release_free_memory_function = release_free_memory_function;
}
void SetGetNumericPropertyFunction(
- thunks::GetNumericPropertyFunction get_numeric_property_function) {
- DCHECK_EQ(thunks::GetGetNumericPropertyFunction(),
- reinterpret_cast<thunks::GetNumericPropertyFunction>(NULL));
- thunks::SetGetNumericPropertyFunction(get_numeric_property_function);
+ GetNumericPropertyFunction get_numeric_property_function) {
+ DCHECK_EQ(g_get_numeric_property_function,
+ reinterpret_cast<GetNumericPropertyFunction>(NULL));
+ g_get_numeric_property_function = get_numeric_property_function;
}
} // namespace allocator
« no previous file with comments | « base/allocator/allocator_extension.h ('k') | base/allocator/allocator_extension_thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698