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

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java

Issue 1474483004: WebView Metrics client implementation (Chromium part) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.android_webview; 5 package org.chromium.android_webview;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.SharedPreferences; 8 import android.content.SharedPreferences;
9 9
10 import org.chromium.content.browser.ContentViewStatics; 10 import org.chromium.content.browser.ContentViewStatics;
11 11
12 /** 12 /**
13 * Java side of the Browser Context: contains all the java side objects needed t o host one 13 * Java side of the Browser Context: contains all the java side objects needed t o host one
14 * browing session (i.e. profile). 14 * browing session (i.e. profile).
15 * 15 *
16 * Note that historically WebView was running in single process mode, and limita tions on renderer 16 * Note that historically WebView was running in single process mode, and limita tions on renderer
17 * process only being able to use a single browser context, currently there can only be one 17 * process only being able to use a single browser context, currently there can only be one
18 * AwBrowserContext instance, so at this point the class mostly exists for conce ptual clarity. 18 * AwBrowserContext instance, so at this point the class mostly exists for conce ptual clarity.
19 */ 19 */
20 public class AwBrowserContext { 20 public class AwBrowserContext {
21 private static final String HTTP_AUTH_DATABASE_FILE = "http_auth.db"; 21 private static final String HTTP_AUTH_DATABASE_FILE = "http_auth.db";
22 22
23 private final SharedPreferences mSharedPreferences; 23 private final SharedPreferences mSharedPreferences;
24 24
25 private AwGeolocationPermissions mGeolocationPermissions; 25 private AwGeolocationPermissions mGeolocationPermissions;
26 private AwFormDatabase mFormDatabase; 26 private AwFormDatabase mFormDatabase;
27 private HttpAuthDatabase mHttpAuthDatabase; 27 private HttpAuthDatabase mHttpAuthDatabase;
28 private AwMessagePortService mMessagePortService; 28 private AwMessagePortService mMessagePortService;
29 private AwMetricsServiceClient mMetricsServiceClient;
29 30
30 public AwBrowserContext(SharedPreferences sharedPreferences, Context applica tionContext) { 31 public AwBrowserContext(SharedPreferences sharedPreferences, Context applica tionContext) {
31 mSharedPreferences = sharedPreferences; 32 mSharedPreferences = sharedPreferences;
33 mMetricsServiceClient = new AwMetricsServiceClient(applicationContext);
32 } 34 }
33 35
34 public AwGeolocationPermissions getGeolocationPermissions() { 36 public AwGeolocationPermissions getGeolocationPermissions() {
35 if (mGeolocationPermissions == null) { 37 if (mGeolocationPermissions == null) {
36 mGeolocationPermissions = new AwGeolocationPermissions(mSharedPrefer ences); 38 mGeolocationPermissions = new AwGeolocationPermissions(mSharedPrefer ences);
37 } 39 }
38 return mGeolocationPermissions; 40 return mGeolocationPermissions;
39 } 41 }
40 42
41 public AwFormDatabase getFormDatabase() { 43 public AwFormDatabase getFormDatabase() {
(...skipping 10 matching lines...) Expand all
52 return mHttpAuthDatabase; 54 return mHttpAuthDatabase;
53 } 55 }
54 56
55 public AwMessagePortService getMessagePortService() { 57 public AwMessagePortService getMessagePortService() {
56 if (mMessagePortService == null) { 58 if (mMessagePortService == null) {
57 mMessagePortService = new AwMessagePortService(); 59 mMessagePortService = new AwMessagePortService();
58 } 60 }
59 return mMessagePortService; 61 return mMessagePortService;
60 } 62 }
61 63
64 public AwMetricsServiceClient getMetricsServiceClient() {
65 return mMetricsServiceClient;
66 }
67
62 /** 68 /**
63 * @see android.webkit.WebView#pauseTimers() 69 * @see android.webkit.WebView#pauseTimers()
64 */ 70 */
65 public void pauseTimers() { 71 public void pauseTimers() {
66 ContentViewStatics.setWebKitSharedTimersSuspended(true); 72 ContentViewStatics.setWebKitSharedTimersSuspended(true);
67 } 73 }
68 74
69 /** 75 /**
70 * @see android.webkit.WebView#resumeTimers() 76 * @see android.webkit.WebView#resumeTimers()
71 */ 77 */
72 public void resumeTimers() { 78 public void resumeTimers() {
73 ContentViewStatics.setWebKitSharedTimersSuspended(false); 79 ContentViewStatics.setWebKitSharedTimersSuspended(false);
74 } 80 }
75 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698