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

Commit

Permalink
Improve onFirstContentfulPaintnotification
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro committed Nov 25, 2019
1 parent a8b4a73 commit a552472
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ private void closeSession(@NonNull SessionState aState) {
}
aState.mSession.close();
aState.setActive(false);
mFirstContentfulPaint = false;
}

public void captureBitmap() {
Expand Down Expand Up @@ -1053,6 +1054,14 @@ public void onFirstComposite(@NonNull GeckoSession aSession) {
for (GeckoSession.ContentDelegate listener : mContentListeners) {
listener.onFirstComposite(aSession);
}
if (mFirstContentfulPaint) {
// onFirstContentfulPaint is only called once after a session is opened.
// Notify onFirstContentfulPaint after a session is reattached before
// being closed ((e.g. tab selected)
for (GeckoSession.ContentDelegate listener : mContentListeners) {
listener.onFirstContentfulPaint(aSession);
}
}
}
}

Expand Down

0 comments on commit a552472

Please sign in to comment.