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

Side by Side Diff: build/android/incremental_install/java/org/chromium/incrementalinstall/Reflect.java

Issue 1729973002: Reland of Add increment install native libraries first in lookup paths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed Created 4 years, 10 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
« no previous file with comments | « build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java ('k') | no next file » | 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.incrementalinstall; 5 package org.chromium.incrementalinstall;
6 6
7 import java.lang.reflect.Array; 7 import java.lang.reflect.Array;
8 import java.lang.reflect.Constructor; 8 import java.lang.reflect.Constructor;
9 import java.lang.reflect.Field; 9 import java.lang.reflect.Field;
10 import java.lang.reflect.Method; 10 import java.lang.reflect.Method;
(...skipping 28 matching lines...) Expand all
39 static Object getField(Object instance, String name) throws ReflectiveOperat ionException { 39 static Object getField(Object instance, String name) throws ReflectiveOperat ionException {
40 Field field = findField(instance, name); 40 Field field = findField(instance, name);
41 field.setAccessible(true); 41 field.setAccessible(true);
42 return field.get(instance); 42 return field.get(instance);
43 } 43 }
44 44
45 /** 45 /**
46 * Concatenates two arrays into a new array. The arrays must be of the same 46 * Concatenates two arrays into a new array. The arrays must be of the same
47 * type. 47 * type.
48 */ 48 */
49 static Object[] concatArrays(Object[] left, Object[] right) { 49 static Object[] concatArrays(Object[] arrType, Object[] left, Object[] right ) {
50 Object[] result = (Object[]) Array.newInstance( 50 Object[] result = (Object[]) Array.newInstance(
51 left.getClass().getComponentType(), left.length + right.length); 51 arrType.getClass().getComponentType(), left.length + right.lengt h);
52 System.arraycopy(left, 0, result, 0, left.length); 52 System.arraycopy(left, 0, result, 0, left.length);
53 System.arraycopy(right, 0, result, left.length, right.length); 53 System.arraycopy(right, 0, result, left.length, right.length);
54 return result; 54 return result;
55 } 55 }
56 56
57 /** 57 /**
58 * Invokes a method with zero or more parameters. For static methods, use th e Class as the 58 * Invokes a method with zero or more parameters. For static methods, use th e Class as the
59 * instance. 59 * instance.
60 */ 60 */
61 static Object invokeMethod(Object instance, String name, Object... params) 61 static Object invokeMethod(Object instance, String name, Object... params)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 Class<?> rightClazz = right.getClass(); 134 Class<?> rightClazz = right.getClass();
135 if (left.isPrimitive()) { 135 if (left.isPrimitive()) {
136 // TODO(agrieve): Fill in the rest as needed. 136 // TODO(agrieve): Fill in the rest as needed.
137 return left == boolean.class && rightClazz == Boolean.class 137 return left == boolean.class && rightClazz == Boolean.class
138 || left == int.class && rightClazz == Integer.class; 138 || left == int.class && rightClazz == Integer.class;
139 } 139 }
140 return left.isAssignableFrom(rightClazz); 140 return left.isAssignableFrom(rightClazz);
141 } 141 }
142 } 142 }
OLDNEW
« no previous file with comments | « build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698