Use use_allocator instead of android_use_tcmalloc to switch the allocator.

See https://crrev.com/177353002 and the bug for the details.

BUG=345554

Review URL: https://codereview.chromium.org/206413006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259894 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/build/common.gypi b/build/common.gypi
index 98e9ace..d68c423 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1177,11 +1177,12 @@
     'release_unwind_tables%': 1,
 
     # Enable TCMalloc.
-    # TODO(dmikurube): Change the default of use_allocator to "tcmalloc".
-    # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
+    # TODO(dmikurube): Change Linux default of use_allocator to "tcmalloc".
+    # TODO(dmikurube): Change Android default of use_allocator to "none".
+    # TODO(dmikurube): Kill {linux|android}_use_tcmalloc. http://crbug.com/345554
     # {linux|android}_use_tcmalloc are to be replaced with use_allocator.
     # They are now used only if use_allocator=="see_use_tcmalloc" (default).
-    # TODO(dmikurube): Assert when linux_use_tcmalloc is explicitly specified.
+    # TODO(dmikurube): Assert when {linux|android}_use_tcmalloc is explicitly specified.
     'linux_use_tcmalloc%': 1,
     'android_use_tcmalloc%': 0,
     'use_allocator%': 'see_use_tcmalloc',
@@ -3794,8 +3795,8 @@
               }],
             ],
           }],
-          # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
-          ['(use_allocator!="tcmalloc" and (use_allocator!="see_use_tcmalloc" or linux_use_tcmalloc==0)) and android_use_tcmalloc==0', {
+          # TODO(dmikurube): Kill {linux|android}_use_tcmalloc. http://crbug.com/345554
+          ['use_allocator!="tcmalloc" and (use_allocator!="see_use_tcmalloc" or ((OS=="linux" and linux_use_tcmalloc==0) or (OS=="android" and android_use_tcmalloc==0)))', {
             'defines': ['NO_TCMALLOC'],
           }],
           ['linux_use_gold_flags==1', {
diff --git a/chrome/chrome_android.gypi b/chrome/chrome_android.gypi
index 11093439..48e8cdb0 100644
--- a/chrome/chrome_android.gypi
+++ b/chrome/chrome_android.gypi
@@ -39,7 +39,8 @@
             }],
           ],
         }],
-        [ 'android_use_tcmalloc==1', {
+        # TODO(dmikurube): Kill android_use_tcmalloc. http://crbug.com/345554
+        [ '(use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and android_use_tcmalloc==1)', {
           'dependencies': [
             '../base/allocator/allocator.gyp:allocator', ],
         }],
diff --git a/content/content_shell.gypi b/content/content_shell.gypi
index 17cf944..b79e085 100644
--- a/content/content_shell.gypi
+++ b/content/content_shell.gypi
@@ -311,8 +311,8 @@
             '../components/components.gyp:breakpad_host',
           ],
         }],
-        # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
-        ['(os_posix==1 and use_aura==1 and ((use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1))) or (android_use_tcmalloc==1)', {
+        # TODO(dmikurube): Kill {linux|android}_use_tcmalloc. http://crbug.com/345554
+        ['(os_posix==1 and use_aura==1 and ((use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and ((OS=="linux" and linux_use_tcmalloc==1) or (OS=="android" and android_use_tcmalloc==1)))))', {
           'dependencies': [
             # This is needed by content/app/content_main_runner.cc
             '../base/allocator/allocator.gyp:allocator',