Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Default load request to allow (#3179)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored Apr 16, 2020
1 parent b90a704 commit 58ba8ea
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1039,14 +1039,14 @@ public void onCanGoForward(@NonNull GeckoSession aSession, boolean aCanGoForward

final GeckoResult<AllowOrDeny> result = new GeckoResult<>();
AtomicInteger count = new AtomicInteger(0);
AtomicBoolean allowed = new AtomicBoolean(false);
AtomicBoolean allowed = new AtomicBoolean(true);
final int listenerCount = mNavigationListeners.size() - 1;
for (GeckoSession.NavigationDelegate listener: mNavigationListeners) {
GeckoResult<AllowOrDeny> listenerResult = listener.onLoadRequest(aSession, aRequest);
if (listenerResult != null) {
listenerResult.then(value -> {
if (AllowOrDeny.ALLOW.equals(value)) {
allowed.set(true);
if (AllowOrDeny.DENY.equals(value)) {
allowed.set(false);
}
if (count.getAndIncrement() == listenerCount) {
result.complete(allowed.get() ? AllowOrDeny.ALLOW : AllowOrDeny.DENY);
Expand Down

0 comments on commit 58ba8ea

Please sign in to comment.