Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 } | |
| OLD | NEW |