Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
haanhvu committed Dec 15, 2024
1 parent 2bd3493 commit 7d02a86
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.os.Handler;
import android.os.Looper;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -36,7 +35,6 @@ public ResultImpl() {

@Override
public synchronized void complete(@Nullable T value) {
Log.e("ChromiumErrorPage", "Chromium complete() is called");
mValue = value;
mComplete = true;

Expand Down Expand Up @@ -179,28 +177,23 @@ private synchronized void thenInternal(@NonNull final ResultImpl.Dispatcher disp

private void dispatch() {
if (!mComplete) {
Log.e("Chromium dispatch()", "IllegalStateException");
throw new IllegalStateException("Cannot dispatch unless result is complete");
}

if (mListeners.isEmpty()) {
if (mIsUncaughtError) {
Log.e("Chromium dispatch()", "UncaughtException");
// We have no listeners to forward the uncaught exception to;
// rethrow the exception to make it visible.
throw new ResultImpl.UncaughtException(mError);
}
Log.e("Chromium dispatch()", "mListeners is empty");
return;
}

if (mDispatcher == null) {
Log.e("Chromium dispatch()", "AssertionError");
throw new AssertionError("Shouldn't have listeners with null dispatcher");
}

for (int i = 0; i < mListeners.size(); ++i) {
Log.e("Chromium dispatch()", "For loop is called");
final ResultImpl.Dispatcher dispatcher = mListeners.keyAt(i);
final ArrayList<Runnable> jobs = mListeners.valueAt(i);
dispatcher.dispatch(
Expand All @@ -210,7 +203,6 @@ private void dispatch() {
}
});
}
Log.e("Chromium dispatch()", "mListeners.clear() is called");
mListeners.clear();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package com.igalia.wolvic.browser.api.impl;

import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.igalia.wolvic.browser.api.WResult;
import com.igalia.wolvic.browser.api.WSession;
import com.igalia.wolvic.browser.api.WWebRequestError;
import com.igalia.wolvic.utils.InternalPages;

import org.chromium.content_public.browser.LifecycleState;
import org.chromium.content_public.browser.NavigationHandle;
Expand Down Expand Up @@ -85,14 +81,11 @@ private int toWSessionOnVisitedFlags(NavigationHandle navigationHandle) {
*/
@Override
public void didFinishNavigationInPrimaryMainFrame(NavigationHandle navigationHandle) {
Log.e("ChromiumErrorPage", "didFinishNavigationInPrimaryMainFrame is called");

WSession.NavigationDelegate navigationDelegate = mSession.getNavigationDelegate();
if (navigationDelegate == null)
return;

if (navigationHandle.isErrorPage()) {
Log.e("ChromiumErrorPage", "isErrorPage() is true");
didFailLoad(true, navigationHandle.errorCode(), navigationHandle.getUrl(), 0);
return;
}
Expand Down Expand Up @@ -123,8 +116,6 @@ public void didFailLoad(boolean isInPrimaryMainFrame, int errorCode, GURL failin

WSession.NavigationDelegate navigationDelegate = mSession.getNavigationDelegate();
if (navigationDelegate != null) {
Log.e("ChromiumErrorPage", "navigationDelegate != null => onLoadError() is called");

byte[] errorData = navigationDelegate.onLoadErrorData(mSession, failingUrl.getSpec(), new WWebRequestError() {
@Override
public int code() {
Expand All @@ -144,7 +135,6 @@ public X509Certificate certificate() {
return null;
}
});

mSession.loadData(errorData, "text/html");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import android.graphics.RectF;
import android.net.Uri;
import android.os.Build;
import android.util.Log;
import android.view.PointerIcon;
import android.view.Surface;
import android.view.inputmethod.CursorAnchorInfo;
Expand Down Expand Up @@ -515,7 +514,6 @@ WResult<String> onLoadError(
@NonNull final WSession session,
@Nullable final String uri,
@NonNull final WWebRequestError error) {
Log.e("ChromiumErrorPage", "onLoadError() returns null");
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1237,15 +1237,10 @@ public WResult<WSession> onNewSession(@NonNull WSession aSession, @NonNull Strin
return WResult.fromValue(session.getWSession());
}

public String errorData;

@Override
public WResult<String> onLoadError(@NonNull WSession session, @Nullable String uri, @NonNull WWebRequestError error) {
Log.e("ChromiumErrorPage", "onLoadError() returns WResult.fromValue(InternalPages.createErrorPageDataURI(mContext, uri, error.code()))");
Log.d(LOGTAG, "Session onLoadError: " + uri);

Log.e("ChromiumErrorPage", "errorUriString: " + InternalPages.createErrorPageDataURI(mContext, uri, error.code()));
errorData = InternalPages.createErrorPageDataURI(mContext, uri, error.code());
return WResult.fromValue(InternalPages.createErrorPageDataURI(mContext, uri, error.code()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.content.Context;
import android.util.Base64;
import android.util.Log;

import androidx.annotation.Nullable;

Expand Down Expand Up @@ -158,13 +157,9 @@ public static byte[] createErrorPageData(Context context,
html = html.replace("%url%", uri);
}

Log.e("ChromiumErrorPage", "createErrorPageDataURI() returns " + html);

return html.getBytes();
}

public static byte[] htmlBytes;

public static byte[] createAboutPage(Context context,
PageResources resources) {
String html = readRawResourceString(context, resources.html);
Expand Down

0 comments on commit 7d02a86

Please sign in to comment.