Class WebViewCounters

java.lang.Object
org.adblockplus.libadblockplus.android.webview.WebViewCounters

public final class WebViewCounters
extends java.lang.Object
A class for ad blocking counters, such as a counter of blocked resources, of a particular instance of WebView. This class is specifically designed for UI.
  • Constructor Details

    • WebViewCounters

      public WebViewCounters​(WebViewCounters.EventsListener eventsListener)
      Constructs an instance of Counters class.
      Parameters:
      eventsListener - A reference to an implementation of EventsListener.
  • Method Details

    • bindAdblockWebView

      public static AdblockWebView.EventsListener bindAdblockWebView​(WebViewCounters.EventsListener eventsListener)
      A helper method for creation of AdblockWebView.EventsListener and binding it with Counters.EventsListener.
      Parameters:
      eventsListener - which should be bound to the newly created implementation of AdblockWebView.EventsListener.
      Returns:
      a newly created implementation of AdblockWebView.EventsListener.
    • resetBlocked

      public void resetBlocked()
      Thread safe resetting of the blocked counter.
    • resetAllowlisted

      public void resetAllowlisted()
      Thread safe resetting of the allowlisted counter.
    • incrementBlocked

      public void incrementBlocked()
      Thread safe incrementation of the blocked counter.
    • incrementAllowlisted

      public void incrementAllowlisted()
      Thread safe incrementation of the allowlisted counter.