| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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; | 5 package org.chromium.base; |
| 6 | 6 |
| 7 import android.text.TextUtils; | 7 import android.text.TextUtils; |
| 8 import android.util.Log; | 8 import android.util.Log; |
| 9 | 9 |
| 10 import java.io.File; | 10 import java.io.File; |
| 11 import java.io.FileInputStream; | 11 import java.io.FileInputStream; |
| 12 import java.io.FileNotFoundException; | 12 import java.io.FileNotFoundException; |
| 13 import java.io.IOException; | 13 import java.io.IOException; |
| 14 import java.io.InputStreamReader; | 14 import java.io.InputStreamReader; |
| 15 import java.io.Reader; | 15 import java.io.Reader; |
| 16 import java.util.ArrayList; | 16 import java.util.ArrayList; |
| 17 import java.util.Arrays; | 17 import java.util.Arrays; |
| 18 import java.util.HashMap; | 18 import java.util.HashMap; |
| 19 import java.util.List; | 19 import java.util.List; |
| 20 import java.util.concurrent.atomic.AtomicReference; | 20 import java.util.concurrent.atomic.AtomicReference; |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * Java mirror of base/command_line.h. | 23 * Java mirror of base/command_line.h. |
| 24 * Android applications don't have command line arguments. Instead, they're "sim
ulated" by reading a | 24 * Android applications don't have command line arguments. Instead, they're "sim
ulated" by reading a |
| 25 * file at a specific location early during startup. Applications each define th
eir own files, e.g., | 25 * file at a specific location early during startup. Applications each define th
eir own files, e.g., |
| 26 * ContentShellApplication.COMMAND_LINE_FILE or ChromeShellApplication.COMMAND_L
INE_FILE. | 26 * ContentShellApplication.COMMAND_LINE_FILE. |
| 27 **/ | 27 **/ |
| 28 public abstract class CommandLine { | 28 public abstract class CommandLine { |
| 29 /** | 29 /** |
| 30 * Allows classes who cache command line flags to be notified when those arg
uments are updated | 30 * Allows classes who cache command line flags to be notified when those arg
uments are updated |
| 31 * at runtime. This happens in tests. | 31 * at runtime. This happens in tests. |
| 32 */ | 32 */ |
| 33 public interface ResetListener { | 33 public interface ResetListener { |
| 34 /** Called when the command line arguments are reset. */ | 34 /** Called when the command line arguments are reset. */ |
| 35 void onCommandLineReset(); | 35 void onCommandLineReset(); |
| 36 } | 36 } |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 private static native void nativeReset(); | 402 private static native void nativeReset(); |
| 403 private static native boolean nativeHasSwitch(String switchString); | 403 private static native boolean nativeHasSwitch(String switchString); |
| 404 private static native String nativeGetSwitchValue(String switchString); | 404 private static native String nativeGetSwitchValue(String switchString); |
| 405 private static native void nativeAppendSwitch(String switchString); | 405 private static native void nativeAppendSwitch(String switchString); |
| 406 private static native void nativeAppendSwitchWithValue(String switchString,
String value); | 406 private static native void nativeAppendSwitchWithValue(String switchString,
String value); |
| 407 private static native void nativeAppendSwitchesAndArguments(String[] array); | 407 private static native void nativeAppendSwitchesAndArguments(String[] array); |
| 408 } | 408 } |
| OLD | NEW |