コード例 #1
0
 // Cancel the download if active and release the queue. Called on WebCore thread.
 public void cancelAndReleaseQueue() {
   if (mRequestHandle != null) {
     mRequestHandle.cancel();
     mRequestHandle = null;
   }
   releaseQueue();
 }
コード例 #2
0
  /**
   * Cancel a request. FIXME: This will only work if the request has yet to be handled. This is in
   * no way guarenteed if requests are served in a separate thread. It also causes major problems if
   * cancel is called during an EventHandler's method call.
   */
  public void cancel() {
    if (Config.LOGV) {
      if (mRequestHandle == null) {
        Log.v(LOGTAG, "LoadListener.cancel(): no requestHandle");
      } else {
        Log.v(LOGTAG, "LoadListener.cancel()");
      }
    }
    if (mRequestHandle != null) {
      mRequestHandle.cancel();
      mRequestHandle = null;
    }

    mCacheResult = null;
    mCancelled = true;

    clearNativeLoader();
  }