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

COVERAGE SUMMARY FOR SOURCE FILE [AwBrowserContext.java]

nameclass, %method, %block, %line, %
AwBrowserContext.java100% (1/1)14%  (1/7)10%  (6/60)16%  (3/19)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AwBrowserContext100% (1/1)14%  (1/7)10%  (6/60)16%  (3/19)
getCookieManager (): AwCookieManager 0%   (0/1)0%   (0/11)0%   (0/3)
getFormDatabase (): AwFormDatabase 0%   (0/1)0%   (0/11)0%   (0/3)
getGeolocationPermissions (): AwGeolocationPermissions 0%   (0/1)0%   (0/13)0%   (0/3)
getHttpAuthDatabase (Context): HttpAuthDatabase 0%   (0/1)0%   (0/13)0%   (0/3)
pauseTimers (): void 0%   (0/1)0%   (0/3)0%   (0/2)
resumeTimers (): void 0%   (0/1)0%   (0/3)0%   (0/2)
AwBrowserContext (SharedPreferences): void 100% (1/1)100% (6/6)100% (3/3)

1// Copyright (c) 2013 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.android_webview;
6 
7import android.content.Context;
8import android.content.SharedPreferences;
9 
10import org.chromium.content.browser.ContentViewStatics;
11 
12/**
13 * Java side of the Browser Context: contains all the java side objects needed to host one
14 * browing session (i.e. profile).
15 * Note that due to running in single process mode, and limitations on renderer process only
16 * being able to use a single browser context, currently there can only be one AwBrowserContext
17 * instance, so at this point the class mostly exists for conceptual clarity.
18 *
19 * Obtain the default (singleton) instance with  AwBrowserProcess.getDefaultBrowserContext().
20 */
21public class AwBrowserContext {
22 
23    private static final String HTTP_AUTH_DATABASE_FILE = "http_auth.db";
24 
25    private SharedPreferences mSharedPreferences;
26 
27    private AwGeolocationPermissions mGeolocationPermissions;
28    private AwCookieManager mCookieManager;
29    private AwFormDatabase mFormDatabase;
30    private HttpAuthDatabase mHttpAuthDatabase;
31 
32    public AwBrowserContext(SharedPreferences sharedPreferences) {
33        mSharedPreferences = sharedPreferences;
34    }
35 
36    public AwGeolocationPermissions getGeolocationPermissions() {
37        if (mGeolocationPermissions == null) {
38            mGeolocationPermissions = new AwGeolocationPermissions(mSharedPreferences);
39        }
40        return mGeolocationPermissions;
41    }
42 
43    public AwCookieManager getCookieManager() {
44        if (mCookieManager == null) {
45            mCookieManager = new AwCookieManager();
46        }
47        return mCookieManager;
48    }
49 
50    public AwFormDatabase getFormDatabase() {
51        if (mFormDatabase == null) {
52            mFormDatabase = new AwFormDatabase();
53        }
54        return mFormDatabase;
55    }
56 
57    public HttpAuthDatabase getHttpAuthDatabase(Context context) {
58        if (mHttpAuthDatabase == null) {
59            mHttpAuthDatabase = new HttpAuthDatabase(context, HTTP_AUTH_DATABASE_FILE);
60        };
61        return mHttpAuthDatabase;
62    }
63 
64    /**
65     * @see android.webkit.WebView#pauseTimers()
66     */
67    public void pauseTimers() {
68        ContentViewStatics.setWebKitSharedTimersSuspended(true);
69    }
70 
71    /**
72     * @see android.webkit.WebView#resumeTimers()
73     */
74    public void resumeTimers() {
75        ContentViewStatics.setWebKitSharedTimersSuspended(false);
76    }
77}

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