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

Side by Side Diff: android/java/src/org/chromium/base/multidex/ChromiumMultiDex.java

Issue 2045303002: Update to Chromium //base at Chromium commit 3e81715e6d3a4324362635aea46ce1f1a163cca1. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/domokit/base@master
Patch Set: Created 4 years, 6 months 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.base.multidex;
6
7 import android.content.Context;
8 import android.os.Build;
9 import android.os.Process;
10 import android.support.multidex.MultiDex;
11
12 import org.chromium.base.Log;
13 import org.chromium.base.VisibleForTesting;
14
15 import java.lang.reflect.InvocationTargetException;
16
17 /**
18 * Performs multidex installation for non-isolated processes.
19 */
20 public class ChromiumMultiDex {
21 private static final String TAG = "cr.base.multidex";
22
23 /**
24 * Installs secondary dexes if possible.
25 *
26 * Isolated processes (e.g. renderer processes) can't load secondary dex fi les on
27 * K and below, so we don't even try in that case.
28 *
29 * @param context The application context.
30 */
31 @VisibleForTesting
32 public static void install(Context context) {
33 try {
34 // TODO(jbudorick): Back out this version check once support for K & below works.
35 // http://crbug.com/512357
36 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP && processI sIsolated()) {
37 Log.i(TAG, "Skipping multidex installation: inside isolated proc ess.");
38 } else {
39 MultiDex.install(context);
40 Log.i(TAG, "Completed multidex installation.");
41 }
42 } catch (NoSuchMethodException e) {
43 Log.wtf(TAG, "Failed multidex installation", e);
44 } catch (IllegalAccessException e) {
45 Log.wtf(TAG, "Failed multidex installation", e);
46 } catch (InvocationTargetException e) {
47 Log.wtf(TAG, "Failed multidex installation", e);
48 }
49 }
50
51 // Calls Process.isIsolated, a private Android API.
52 private static boolean processIsIsolated()
53 throws NoSuchMethodException, IllegalAccessException, InvocationTarg etException {
54 return (boolean) Process.class.getMethod("isIsolated").invoke(null);
55 }
56 }
OLDNEW
« no previous file with comments | « android/java/src/org/chromium/base/metrics/RecordHistogram.java ('k') | android/java_handler_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698