diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-29 03:07:29 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-29 03:07:29 +0000 |
commit | 452be197b1bfd23ab71db38cea5655bda0e8cc24 (patch) | |
tree | 09f9e18096384409b460f0dfe3018000b524ee68 | |
parent | eec396cc0a529c3c1d65221fbe76c73ef84e4759 (diff) | |
download | chromium_src-452be197b1bfd23ab71db38cea5655bda0e8cc24.zip chromium_src-452be197b1bfd23ab71db38cea5655bda0e8cc24.tar.gz chromium_src-452be197b1bfd23ab71db38cea5655bda0e8cc24.tar.bz2 |
Fix a crash where we were looking for the fav icon in the wrong service.
This caused the possible url dialog in the options menu to never load favicons, and instead DCHECK (crashing debug builds).
Review URL: http://codereview.chromium.org/179034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24852 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/list_store_favicon_loader.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/list_store_favicon_loader.h | 12 | ||||
-rw-r--r-- | chrome/browser/possible_url_model.cc | 8 | ||||
-rw-r--r-- | chrome/browser/possible_url_model.h | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/gtk/list_store_favicon_loader.cc b/chrome/browser/gtk/list_store_favicon_loader.cc index 68cf557..2b3803b 100644 --- a/chrome/browser/gtk/list_store_favicon_loader.cc +++ b/chrome/browser/gtk/list_store_favicon_loader.cc @@ -40,7 +40,7 @@ void ListStoreFavIconLoader::LoadFaviconForRow(const GURL& url, } bool ListStoreFavIconLoader::GetRowByFavIconHandle( - HistoryService::Handle handle, GtkTreeIter* result_iter) { + FaviconService::Handle handle, GtkTreeIter* result_iter) { GtkTreeIter iter; gboolean valid = gtk_tree_model_get_iter_first( GTK_TREE_MODEL(list_store_), &iter); @@ -60,7 +60,7 @@ bool ListStoreFavIconLoader::GetRowByFavIconHandle( } void ListStoreFavIconLoader::OnGotFavIcon( - HistoryService::Handle handle, bool know_fav_icon, + FaviconService::Handle handle, bool know_fav_icon, scoped_refptr<RefCountedBytes> image_data, bool is_expired, GURL icon_url) { GtkTreeIter iter; if (!GetRowByFavIconHandle(handle, &iter)) diff --git a/chrome/browser/gtk/list_store_favicon_loader.h b/chrome/browser/gtk/list_store_favicon_loader.h index 86bb7e0..8be5b9ba 100644 --- a/chrome/browser/gtk/list_store_favicon_loader.h +++ b/chrome/browser/gtk/list_store_favicon_loader.h @@ -7,7 +7,7 @@ #include <gtk/gtk.h> -#include "chrome/browser/history/history.h" +#include "chrome/browser/favicon_service.h" #include "googleurl/src/gurl.h" class Profile; @@ -33,11 +33,11 @@ class ListStoreFavIconLoader { private: // Find a row from the GetFavIconForURL handle. Returns true if the row was // found. - bool GetRowByFavIconHandle(HistoryService::Handle handle, + bool GetRowByFavIconHandle(FaviconService::Handle handle, GtkTreeIter* result_iter); - // Callback from HistoryService:::GetFavIconForURL - void OnGotFavIcon(HistoryService::Handle handle, bool know_fav_icon, + // Callback from FaviconService:::GetFavIconForURL + void OnGotFavIcon(FaviconService::Handle handle, bool know_fav_icon, scoped_refptr<RefCountedBytes> image_data, bool is_expired, GURL icon_url); @@ -48,10 +48,10 @@ class ListStoreFavIconLoader { gint favicon_col_; // The index of the G_TYPE_INT column used internally to track the - // HistoryService::Handle of each favicon request. + // FaviconService::Handle of each favicon request. gint favicon_handle_col_; - // The profile from which we will get the HistoryService. + // The profile from which we will get the FaviconService. Profile* profile_; // Used in loading favicons. diff --git a/chrome/browser/possible_url_model.cc b/chrome/browser/possible_url_model.cc index 520678a..cdf9da1 100644 --- a/chrome/browser/possible_url_model.cc +++ b/chrome/browser/possible_url_model.cc @@ -163,15 +163,15 @@ int PossibleURLModel::CompareValues(int row1, int row2, int column_id) { } void PossibleURLModel::OnFavIconAvailable( - HistoryService::Handle h, + FaviconService::Handle h, bool fav_icon_available, scoped_refptr<RefCountedBytes> data, bool expired, GURL icon_url) { if (profile_) { - HistoryService* hs = - profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); - size_t index = consumer_.GetClientData(hs, h); + FaviconService* favicon_service = + profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); + size_t index = consumer_.GetClientData(favicon_service, h); if (fav_icon_available) { // The decoder will leave our bitmap empty on error. PNGDecoder::Decode(&data->data, &(fav_icon_map_[index])); diff --git a/chrome/browser/possible_url_model.h b/chrome/browser/possible_url_model.h index 4a688fe..ac3013c 100644 --- a/chrome/browser/possible_url_model.h +++ b/chrome/browser/possible_url_model.h @@ -47,7 +47,7 @@ class PossibleURLModel : public TableModel { virtual int CompareValues(int row1, int row2, int column_id); - virtual void OnFavIconAvailable(HistoryService::Handle h, + virtual void OnFavIconAvailable(FaviconService::Handle h, bool fav_icon_available, scoped_refptr<RefCountedBytes> data, bool expired, |