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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/datausage/ExternalDataUseObserver.java

Issue 1393073002: Add external data use observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@datause_accounting_scliitle_cl_do_not_edit_2
Patch Set: onDestroy added Created 5 years, 2 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
(Empty)
1 // Copyright 2015 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
5 package org.chromium.chrome.browser.datausage;
6
7 import android.content.Context;
8
9 import org.chromium.base.annotations.CalledByNative;
10 import org.chromium.base.annotations.JNINamespace;
11 import org.chromium.chrome.browser.ChromeApplication;
12
13 /**
14 * This class provides a base class implementation of a data use observer that i s external to
15 * Chromium. This class should be accessed only on IO thread.
16 */
17 @JNINamespace("chrome::android")
18 public class ExternalDataUseObserver {
19 /**
20 * Pointer to the native ExternalDataUseObserver object.
21 */
22 private long mNativeExternalDataUseObserver;
23
24 @CalledByNative
25 private static ExternalDataUseObserver create(Context context, long nativePt r) {
26 return ((ChromeApplication) context).createExternalDataUseObserver(nativ ePtr);
27 }
28
29 /*
newt (away) 2015/10/14 00:02:48 nit: use two asterisks "**"
tbansal1 2015/10/14 00:37:15 Done.
30 * Notification that the native object has been destroyed.
31 */
32 @CalledByNative
33 private void onDestroy() {
34 mNativeExternalDataUseObserver = 0;
35 }
36
37 @CalledByNative
38 private void onDataUse(String tag, long bytesDownloaded, long bytesUploaded) {}
39
40 /**
41 * Creates an instance of {@link #ExternalDataUseObserver}.
42 */
43 public ExternalDataUseObserver(long nativePtr) {
44 mNativeExternalDataUseObserver = nativePtr;
45 }
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698