New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 760866 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Closed: Aug 8
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 751024



Sign in to add a comment

GenerateMaskedSmallIcon returns gfx::Image whose lifetime is tied to Notification instance.

Project Member Reported by tetsui@chromium.org, Aug 31 2017

Issue description

Notification::GenerateMaskedSmallIcon returns gfx::Image object whose lifetime is tied to the Notification instance when |vector_small_image| is specified.

This is because CreateVectorIcon internally retains reference to the |vector_small_image|.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6008e9d038da8e800a68f3c233c9e69eab3b333b

commit 6008e9d038da8e800a68f3c233c9e69eab3b333b
Author: Tetsui Ohkubo <tetsui@chromium.org>
Date: Thu Aug 31 08:25:43 2017

Make |vector_small_image| a pointer in RichNotificationData.

This CL changes |vector_small_image| in RichNotificationData to a
pointer. The setter and getter remain unchanged.

The reason of the change is to give separate lifetime to the returned
gfx::Image of Notification::GenerateMaskedSmallIcon from the original
Notification instance.

WebNotificationTray assumes they have separate lifetime.

VectorIcon constants e.g. kNotificationCapsLockIcon are globally
defined constants so we can assume they are alive from the beggining to
the end of the program.
(Example: gen/ash/resources/vector_icons/vector_icons.cc)

This CL is needed to land https://crrev.com/c/chromium/src/+/605342
without asan failure.

TEST=out/asan/ash_unittests
BUG= 760866 

Change-Id: Ia7c3cbed65772b205277f8c2aa6561eda3a250ee
Reviewed-on: https://chromium-review.googlesource.com/641696
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498787}
[modify] https://crrev.com/6008e9d038da8e800a68f3c233c9e69eab3b333b/ui/message_center/notification.h

Comment 2 by tetsui@chromium.org, Sep 20 2017

Labels: -Pri-1 -M-62 M-64 Pri-2
Status: Archived (was: Started)

Sign in to add a comment