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

COVERAGE SUMMARY FOR SOURCE FILE [TabBase.java]

nameclass, %method, %block, %line, %
TabBase.java100% (1/1)100% (6/6)78%  (36/46)90%  (10.8/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TabBase100% (1/1)100% (6/6)78%  (36/46)90%  (10.8/12)
destroyBase (): void 100% (1/1)69%  (9/13)85%  (2.6/3)
setNativePtr (int): void 100% (1/1)69%  (9/13)85%  (2.6/3)
<static initializer> 100% (1/1)75%  (6/8)75%  (0.8/1)
TabBase (WindowAndroid): void 100% (1/1)100% (6/6)100% (3/3)
getNativePtr (): int 100% (1/1)100% (3/3)100% (1/1)
getWindowAndroid (): WindowAndroid 100% (1/1)100% (3/3)100% (1/1)

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;
8import org.chromium.content.browser.ContentView;
9import org.chromium.ui.WindowAndroid;
10 
11/**
12 * The basic Java representation of a tab.  Contains and manages a {@link ContentView}.
13 *
14 * TabBase provides common functionality for ChromiumTestshell's Tab as well as Chrome on Android's
15 * tab. It's intended to be extended both on Java and C++, with ownership managed by the subclass.
16 * Because of the inner-workings of JNI, the subclass is responsible for constructing the native
17 * subclass which in turn constructs TabAndroid (the native counterpart to TabBase) which in turn
18 * sets the native pointer for TabBase. The same is true for destruction. The Java subclass must be
19 * destroyed which will call into the native subclass and finally lead to the destruction of the
20 * parent classes.
21 */
22public abstract class TabBase {
23    public static final int INVALID_TAB_ID = -1;
24 
25    private final WindowAndroid mWindowAndroid;
26    private int mNativeTabAndroid;
27 
28    protected TabBase(WindowAndroid window) {
29        mWindowAndroid = window;
30    }
31 
32    @CalledByNative
33    private void destroyBase() {
34        assert mNativeTabAndroid != 0;
35        mNativeTabAndroid = 0;
36    }
37 
38    @CalledByNative
39    private void setNativePtr(int nativePtr) {
40        assert mNativeTabAndroid == 0;
41        mNativeTabAndroid = nativePtr;
42    }
43 
44    int getNativePtr() {
45        return mNativeTabAndroid;
46    }
47 
48    protected WindowAndroid getWindowAndroid() {
49        return mWindowAndroid;
50    }
51}

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