EMMA Coverage Report (generated Fri Aug 23 16:39:17 PDT 2013)
[all classes][org.chromium.chrome.browser]

COVERAGE SUMMARY FOR SOURCE FILE [ApplicationLifetime.java]

nameclass, %method, %block, %line, %
ApplicationLifetime.java0%   (0/1)0%   (0/5)0%   (0/33)0%   (0/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ApplicationLifetime0%   (0/1)0%   (0/5)0%   (0/33)0%   (0/11)
<static initializer> 0%   (0/1)0%   (0/10)0%   (0/2)
ApplicationLifetime (): void 0%   (0/1)0%   (0/3)0%   (0/2)
removeObserver (): void 0%   (0/1)0%   (0/3)0%   (0/2)
setObserver (ApplicationLifetime$Observer): void 0%   (0/1)0%   (0/11)0%   (0/3)
terminate (boolean): void 0%   (0/1)0%   (0/6)0%   (0/3)

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
3// found in the LICENSE file.
4 
5package org.chromium.chrome.browser;
6 
7import org.chromium.base.CalledByNative;
8 
9/**
10 * Watches for when Chrome is told to restart itself.
11 */
12public class ApplicationLifetime {
13    public interface Observer {
14        void onTerminate(boolean restart);
15    }
16    private static Observer sObserver = null;
17 
18    /**
19     * Sets the observer that monitors for ApplicationLifecycle events.
20     * We only allow one observer to be set to avoid race conditions for shutdown events.
21     */
22    public static void setObserver(Observer observer) {
23        assert sObserver == null;
24        sObserver = observer;
25    }
26 
27    /**
28     * Removes whatever observer is currently watching this class.
29     */
30    public static void removeObserver() {
31        sObserver = null;
32    }
33 
34    @CalledByNative
35    public static void terminate(boolean restart) {
36        if (sObserver != null)
37            sObserver.onTerminate(restart);
38    }
39}

[all classes][org.chromium.chrome.browser]
EMMA 2.0.5312 (C) Vladimir Roubtsov