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

Unified Diff: chrome/browser/notifications/notification_conversion_helper.cc

Issue 1135213004: Returning error when NotificationConversionHelper::NotificationBitmapToGfxImage() get failed in not… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 7 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
« no previous file with comments | « chrome/browser/notifications/notification_conversion_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/notification_conversion_helper.cc
diff --git a/chrome/browser/notifications/notification_conversion_helper.cc b/chrome/browser/notifications/notification_conversion_helper.cc
index 4434af17bedbf677f4c0aa2da6223e3d6ebb0988..b0eec8322be26b339c7c1fb9089b26c4d3258096 100644
--- a/chrome/browser/notifications/notification_conversion_helper.cc
+++ b/chrome/browser/notifications/notification_conversion_helper.cc
@@ -142,25 +142,23 @@ void NotificationConversionHelper::GfxImageToNotificationBitmap(
bool NotificationConversionHelper::NotificationBitmapToGfxImage(
float max_scale,
const gfx::Size& target_size_dips,
- extensions::api::notifications::NotificationBitmap* notification_bitmap,
+ const extensions::api::notifications::NotificationBitmap&
+ notification_bitmap,
gfx::Image* return_image) {
- if (!notification_bitmap)
- return false;
-
const int max_device_pixel_width = target_size_dips.width() * max_scale;
const int max_device_pixel_height = target_size_dips.height() * max_scale;
const int BYTES_PER_PIXEL = 4;
- const int width = notification_bitmap->width;
- const int height = notification_bitmap->height;
+ const int width = notification_bitmap.width;
+ const int height = notification_bitmap.height;
if (width < 0 || height < 0 || width > max_device_pixel_width ||
height > max_device_pixel_height)
return false;
// Ensure we have rgba data.
- std::vector<char>* rgba_data = notification_bitmap->data.get();
+ std::vector<char>* rgba_data = notification_bitmap.data.get();
if (!rgba_data)
return false;
« no previous file with comments | « chrome/browser/notifications/notification_conversion_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698