Bug 1301031 - Tab: Initialize icon request builder in constructor. r?ahunt
MozReview-Commit-ID: G6n4BAC2P17
--- a/mobile/android/base/java/org/mozilla/gecko/Tab.java
+++ b/mobile/android/base/java/org/mozilla/gecko/Tab.java
@@ -135,16 +135,17 @@ public class Tab {
mTitle = title == null ? "" : title;
mSiteIdentity = new SiteIdentity();
mHistoryIndex = -1;
mContentType = "";
mZoomConstraints = new ZoomConstraints(false);
mPluginViews = new ArrayList<View>();
mState = shouldShowProgress(url) ? STATE_LOADING : STATE_SUCCESS;
mLoadProgress = LOAD_PROGRESS_INIT;
+ mIconRequestBuilder = Icons.with(mAppContext).pageUrl(mUrl);
updateBookmark();
}
private ContentResolver getContentResolver() {
return mAppContext.getContentResolver();
}
@@ -447,23 +448,16 @@ public class Tab {
}
public void loadFavicon() {
// Static Favicons never change
if (AboutPages.isBuiltinIconPage(mUrl) && mFavicon != null) {
return;
}
- if (mIconRequestBuilder == null) {
- // For the first internal homepage we might want to load a favicon without ever receiving
- // a location change event first. In this case we didn't start to build a request yet.
- // Let's do that now.
- mIconRequestBuilder = Icons.with(mAppContext).pageUrl(mUrl);
- }
-
mRunningIconRequest = mIconRequestBuilder
.build()
.execute(new IconCallback() {
@Override
public void onIconResponse(IconResponse response) {
mFavicon = response.getBitmap();
Tabs.getInstance().notifyListeners(Tab.this, Tabs.TabEvents.FAVICON);