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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java

Issue 987193003: Android: Fix GPU.GPUProcessTerminationStatus UMA stat (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
index eae1698e3363a4e38e8cade7ff987bec1a9a5139..e9f7beb56486d092abaf75f9d5eac6e348405a15 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
@@ -351,6 +351,9 @@ public class ChildProcessLauncher {
private static Map<Pair<Integer, Integer>, Surface> sSurfaceTextureSurfaceMap =
new ConcurrentHashMap<Pair<Integer, Integer>, Surface>();
+ // Whether the main application is currently brought to the foreground.
+ private static boolean sApplicationInForeground = true;
+
@VisibleForTesting
public static void setBindingManagerForTesting(BindingManager manager) {
sBindingManager = manager;
@@ -433,6 +436,7 @@ public class ChildProcessLauncher {
* Called when the embedding application is sent to background.
*/
public static void onSentToBackground() {
+ sApplicationInForeground = false;
sBindingManager.onSentToBackground();
}
@@ -440,10 +444,18 @@ public class ChildProcessLauncher {
* Called when the embedding application is brought to foreground.
*/
public static void onBroughtToForeground() {
+ sApplicationInForeground = true;
sBindingManager.onBroughtToForeground();
}
/**
+ * Returns whether the application is currently in the foreground.
+ */
+ static boolean isApplicationInForeground() {
+ return sApplicationInForeground;
+ }
+
+ /**
* Should be called early in startup so the work needed to spawn the child process can be done
* in parallel to other startup work. Must not be called on the UI thread. Spare connection is
* created in sandboxed child process.
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698