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

Side by Side Diff: base/android/java/templates/ChromiumMultiDex.template

Issue 1451483002: [Android] Add gn support for multidex. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +comment in ChromiumMultiDex.template Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « base/BUILD.gn ('k') | base/base.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.base.multidex; 5 package org.chromium.base.multidex;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.Build; 8 import android.os.Build;
9 import android.os.Process; 9 import android.os.Process;
10 import android.support.multidex.MultiDex; 10 import android.support.multidex.MultiDex;
11 11
12 import org.chromium.base.Log; 12 import org.chromium.base.Log;
13 import org.chromium.base.VisibleForTesting; 13 import org.chromium.base.VisibleForTesting;
14 14
15 import java.lang.reflect.InvocationTargetException; 15 import java.lang.reflect.InvocationTargetException;
16 16
17 /** 17 /**
18 * Performs multidex installation for non-isolated processes. 18 * Performs multidex installation for non-isolated processes.
19 */ 19 */
20 public class ChromiumMultiDex { 20 public class ChromiumMultiDex {
21 21
22 private static final String TAG = "base_multidex"; 22 private static final String TAG = "base_multidex";
23 23
24 /** 24 /**
25 * Installs secondary dexes if possible. 25 * Installs secondary dexes if possible/necessary.
26 * 26 *
27 * Isolated processes (e.g. renderer processes) can't load secondary dex fi les on 27 * Isolated processes (e.g. renderer processes) can't load secondary dex fi les on
28 * K and below, so we don't even try in that case. 28 * K and below, so we don't even try in that case.
29 * 29 *
30 * In release builds, this is a no-op because:
31 * - multidex isn't necessary in release builds because we run proguard t here and
32 * thus aren't threatening to hit the dex limit; and
33 * - calling MultiDex.install, even in the absence of secondary dexes, ca uses a
34 * significant regression in start-up time (crbug.com/525695).
35 *
30 * @param context The application context. 36 * @param context The application context.
31 */ 37 */
32 @VisibleForTesting 38 @VisibleForTesting
33 #if defined(CONFIGURATION_NAME_Debug) 39 #if defined(MULTIDEX_CONFIGURATION_Debug)
34 public static void install(Context context) { 40 public static void install(Context context) {
35 try { 41 try {
36 // TODO(jbudorick): Back out this version check once support for K & below works. 42 // TODO(jbudorick): Back out this version check once support for K & below works.
37 // http://crbug.com/512357 43 // http://crbug.com/512357
38 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP && processI sIsolated()) { 44 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP && processI sIsolated()) {
39 Log.i(TAG, "Skipping multidex installation: inside isolated proc ess."); 45 Log.i(TAG, "Skipping multidex installation: inside isolated proc ess.");
40 } else { 46 } else {
41 MultiDex.install(context); 47 MultiDex.install(context);
42 Log.i(TAG, "Completed multidex installation."); 48 Log.i(TAG, "Completed multidex installation.");
43 } 49 }
(...skipping 10 matching lines...) Expand all
54 private static boolean processIsIsolated() 60 private static boolean processIsIsolated()
55 throws NoSuchMethodException, IllegalAccessException, InvocationTarg etException { 61 throws NoSuchMethodException, IllegalAccessException, InvocationTarg etException {
56 return (boolean) Process.class.getMethod("isIsolated").invoke(null); 62 return (boolean) Process.class.getMethod("isIsolated").invoke(null);
57 } 63 }
58 #else 64 #else
59 public static void install(Context context) { 65 public static void install(Context context) {
60 } 66 }
61 #endif 67 #endif
62 68
63 } 69 }
OLDNEW
« no previous file with comments | « base/BUILD.gn ('k') | base/base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698