| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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; | 5 package org.chromium.chrome.browser; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A set of utility methods related to the various Chrome processes. | 8 * A set of utility methods related to the various Chrome processes. |
| 9 * TODO(pliard): Remove this class when JavaScript timers toggling is handled di
rectly on the native |
| 10 * side by using the system monitor. |
| 9 */ | 11 */ |
| 10 public class ProcessUtils { | 12 public class ProcessUtils { |
| 11 // To prevent this class from being instantiated. | 13 // To prevent this class from being instantiated. |
| 12 private ProcessUtils() { | 14 private ProcessUtils() { |
| 13 } | 15 } |
| 14 | 16 |
| 15 /** | 17 /** |
| 16 * Suspends Webkit timers in all renderers. | 18 * Suspends Webkit timers in all renderers. |
| 17 * | 19 * |
| 18 * @param suspend true if timers should be suspended. | 20 * @param suspend true if timers should be suspended. |
| 19 */ | 21 */ |
| 20 public static void toggleWebKitSharedTimers(boolean suspend) { | 22 public static void toggleWebKitSharedTimers(boolean suspend) { |
| 21 nativeToggleWebKitSharedTimers(suspend); | 23 nativeToggleWebKitSharedTimers(suspend); |
| 22 } | 24 } |
| 23 | 25 |
| 24 /** | |
| 25 * We have keep-alives enabled for network connections as without it some ro
uters will | |
| 26 * kill the connection, causing web pages to hang. This call closes such | |
| 27 * idle-but-kept-alive connections. | |
| 28 */ | |
| 29 public static void closeIdleConnections() { | |
| 30 nativeCloseIdleConnections(); | |
| 31 } | |
| 32 | |
| 33 private static native void nativeToggleWebKitSharedTimers(boolean suspend); | 26 private static native void nativeToggleWebKitSharedTimers(boolean suspend); |
| 34 private static native void nativeCloseIdleConnections(); | |
| 35 } | 27 } |
| OLD | NEW |