OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.chrome.browser.init; | 5 package org.chromium.chrome.browser.init; |
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.Handler; | 9 import android.os.Handler; |
10 import android.os.Looper; | 10 import android.os.Looper; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
247 | 247 |
248 private void onFinishNativeInitialization() { | 248 private void onFinishNativeInitialization() { |
249 if (mNativeInitializationComplete) return; | 249 if (mNativeInitializationComplete) return; |
250 | 250 |
251 mNativeInitializationComplete = true; | 251 mNativeInitializationComplete = true; |
252 ContentUriUtils.setFileProviderUtil(new FileProviderHelper()); | 252 ContentUriUtils.setFileProviderUtil(new FileProviderHelper()); |
253 } | 253 } |
254 | 254 |
255 private static void configureStrictMode() { | 255 private static void configureStrictMode() { |
256 CommandLine commandLine = CommandLine.getInstance(); | 256 CommandLine commandLine = CommandLine.getInstance(); |
257 if ("eng".equals(Build.TYPE) || commandLine.hasSwitch(ChromeSwitches.STR ICT_MODE)) { | 257 if ("eng".equals(Build.TYPE) |
258 || "userdebug".equals(Build.TYPE) | |
jdduke (slow)
2015/06/01 21:34:58
Ned, Annie: Can we somehow bypass this for telemet
nednguyen
2015/06/01 21:37:53
I would push back adding further flags to telemetr
| |
259 || commandLine.hasSwitch(ChromeSwitches.STRICT_MODE)) { | |
258 StrictMode.enableDefaults(); | 260 StrictMode.enableDefaults(); |
259 StrictMode.ThreadPolicy.Builder policy = | 261 StrictMode.ThreadPolicy.Builder policy = |
260 new StrictMode.ThreadPolicy.Builder(StrictMode.getThreadPoli cy()); | 262 new StrictMode.ThreadPolicy.Builder(StrictMode.getThreadPoli cy()); |
261 policy = policy.detectAll() | 263 policy = policy.detectAll() |
262 .penaltyFlashScreen() | 264 .penaltyFlashScreen() |
263 .penaltyDeathOnNetwork(); | 265 .penaltyDeathOnNetwork(); |
264 if ("death".equals(commandLine.getSwitchValue(ChromeSwitches.STRICT_ MODE))) { | 266 if ("death".equals(commandLine.getSwitchValue(ChromeSwitches.STRICT_ MODE))) { |
265 policy = policy.penaltyDeath(); | 267 policy = policy.penaltyDeath(); |
266 StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder(StrictMod e.getVmPolicy()) | 268 StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder(StrictMod e.getVmPolicy()) |
267 .penaltyDeath() | 269 .penaltyDeath() |
268 .build()); | 270 .build()); |
269 } | 271 } |
270 StrictMode.setThreadPolicy(policy.build()); | 272 StrictMode.setThreadPolicy(policy.build()); |
271 } | 273 } |
272 } | 274 } |
273 | 275 |
274 private void waitForDebuggerIfNeeded() { | 276 private void waitForDebuggerIfNeeded() { |
275 if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUG GER)) { | 277 if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUG GER)) { |
276 Log.e(TAG, "Waiting for Java debugger to connect..."); | 278 Log.e(TAG, "Waiting for Java debugger to connect..."); |
277 android.os.Debug.waitForDebugger(); | 279 android.os.Debug.waitForDebugger(); |
278 Log.e(TAG, "Java debugger connected. Resuming execution."); | 280 Log.e(TAG, "Java debugger connected. Resuming execution."); |
279 } | 281 } |
280 } | 282 } |
281 } | 283 } |
OLD | NEW |