Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1529)

Unified Diff: chrome/browser/gtk/location_bar_view_gtk.cc

Issue 1075006: Eliminate all UI thread decoding of extension images.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/gtk/location_bar_view_gtk.cc
===================================================================
--- chrome/browser/gtk/location_bar_view_gtk.cc (revision 42362)
+++ chrome/browser/gtk/location_bar_view_gtk.cc (working copy)
@@ -1057,6 +1057,7 @@
profile_(profile),
page_action_(page_action),
last_icon_pixbuf_(NULL),
+ tracker_(this),
preview_enabled_(false) {
event_box_.Own(gtk_event_box_new());
gtk_widget_set_size_request(event_box_.get(),
@@ -1083,10 +1084,9 @@
if (!page_action_->default_icon_path().empty())
icon_paths.push_back(page_action_->default_icon_path());
- tracker_ = new ImageLoadingTracker(this, icon_paths.size());
for (std::vector<std::string>::iterator iter = icon_paths.begin();
iter != icon_paths.end(); ++iter) {
- tracker_->PostLoadImageTask(
+ tracker_.PostLoadImageTask(
extension->GetResource(*iter),
gfx::Size(Extension::kPageActionIconMaxSize,
Extension::kPageActionIconMaxSize));
@@ -1094,8 +1094,6 @@
}
LocationBarViewGtk::PageActionViewGtk::~PageActionViewGtk() {
- if (tracker_)
- tracker_->StopTrackingImageLoad();
image_.Destroy();
event_box_.Destroy();
for (PixbufMap::iterator iter = pixbufs_.begin(); iter != pixbufs_.end();
@@ -1178,11 +1176,11 @@
}
}
-void LocationBarViewGtk::PageActionViewGtk::OnImageLoaded(SkBitmap* image,
- size_t index) {
+void LocationBarViewGtk::PageActionViewGtk::OnImageLoaded(
+ SkBitmap* image, int index) {
// We loaded icons()->size() icons, plus one extra if the page action had
// a default icon.
- size_t total_icons = page_action_->icon_paths()->size();
+ int total_icons = static_cast<int>(page_action_->icon_paths()->size());
if (!page_action_->default_icon_path().empty())
total_icons++;
DCHECK(index < total_icons);
@@ -1197,10 +1195,6 @@
pixbufs_[page_action_->default_icon_path()] = pixbuf;
}
- // If we are done, release the tracker.
- if (index == (total_icons - 1))
- tracker_ = NULL;
-
owner_->UpdatePageActions();
}

Powered by Google App Engine
This is Rietveld 408576698