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

Side by Side Diff: chrome/browser/views/location_bar_view.cc

Issue 159711: LocationBarView::PageActionImageView::LoadImageTask::Run() may pass a NULL im... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Made the NOTREACHED more helpful. Created 11 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/location_bar_view.h" 5 #include "chrome/browser/views/location_bar_view.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 // ImageLoadingDone). 1154 // ImageLoadingDone).
1155 } 1155 }
1156 ~ImageLoadingTracker() {} 1156 ~ImageLoadingTracker() {}
1157 1157
1158 void StopTrackingImageLoad() { 1158 void StopTrackingImageLoad() {
1159 view_ = NULL; 1159 view_ = NULL;
1160 } 1160 }
1161 1161
1162 void OnImageLoaded(SkBitmap* image, int index) { 1162 void OnImageLoaded(SkBitmap* image, int index) {
1163 if (image == NULL) { 1163 if (image == NULL) {
1164 NOTREACHED(); 1164 NOTREACHED() << "Image failed to decode.";
1165 image = new SkBitmap(); 1165 image = new SkBitmap();
1166 } 1166 }
1167 if (view_) 1167 if (view_)
1168 view_->OnImageLoaded(image, index); 1168 view_->OnImageLoaded(image, index);
1169 delete image; 1169 delete image;
1170 if (--image_count_ == 0) 1170 if (--image_count_ == 0)
1171 Release(); // We are no longer needed. 1171 Release(); // We are no longer needed.
1172 } 1172 }
1173 1173
1174 private: 1174 private:
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 } 1381 }
1382 1382
1383 int LocationBarView::PageActionVisibleCount() { 1383 int LocationBarView::PageActionVisibleCount() {
1384 int result = 0; 1384 int result = 0;
1385 for (size_t i = 0; i < page_action_image_views_.size(); i++) { 1385 for (size_t i = 0; i < page_action_image_views_.size(); i++) {
1386 if (page_action_image_views_[i]->IsVisible()) 1386 if (page_action_image_views_[i]->IsVisible())
1387 ++result; 1387 ++result;
1388 } 1388 }
1389 return result; 1389 return result;
1390 } 1390 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698