Route calls to tcmalloc MallocExtension through allocator agnostic interface

Our various libraries should not be picking or depending on a particular
allocator choice - that should be an application level choice. This creates
a generic AllocatorExtension interface that can optionally be backed by
entry points to a particular allocator's MallocExtension interface if the
application chooses to.

BUG=125003
TEST=compiles, chrome://tcmalloc works


Review URL: http://codereview.chromium.org/10239012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134434 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/tcmalloc_internals_request_job.cc b/content/browser/tcmalloc_internals_request_job.cc
index db0c3dc..85e5ad00 100644
--- a/content/browser/tcmalloc_internals_request_job.cc
+++ b/content/browser/tcmalloc_internals_request_job.cc
@@ -4,16 +4,13 @@
 
 #include "content/browser/tcmalloc_internals_request_job.h"
 
+#include "base/allocator/allocator_extension.h"
 #include "content/common/child_process_messages.h"
 #include "content/public/browser/browser_child_process_host_iterator.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_process_host.h"
 #include "content/public/common/process_type.h"
 
-#if defined(USE_TCMALLOC)
-#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
-#endif
-
 namespace content {
 
 // static
@@ -88,7 +85,7 @@
   // Populate the collector with stats from the local browser process
   // and send off requests to all the renderer processes.
   char buffer[1024 * 32];
-  MallocExtension::instance()->GetStats(buffer, sizeof(buffer));
+  base::allocator::GetStats(buffer, sizeof(buffer));
   std::string browser("Browser");
   AboutTcmallocOutputs::GetInstance()->SetOutput(browser, buffer);