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

Issue 2356803002: Change Deque<RecycledBitmap> to Vector in DrawingBuffer (Closed)

Created:
4 years, 3 months ago by xidachen
Modified:
4 years, 2 months ago
CC:
ajuma+watch_chromium.org, blink-reviews, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), jbroman, pdr+graphicswatchlist_chromium.org, piman+watch_chromium.org, rwlbuis, Stephen Chennney
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change Deque<RecycledBitmap> to Vector in DrawingBuffer Right now in DrawingBuffer class, we keep a Deque of RecycledBitmap to keep a set of shared memory bitmaps that were released by compositor and can be reused. However, there is a for loop in createOrRecycleBitmap() that is not safe at this moment. This CL changes the Deque structure to Vector and rewrite the for loop to use size_t as index instead of using iterator. BUG=647896 Committed: https://crrev.com/09b9264503a9ce8f36005d2a3136cd922ea397b4 Cr-Commit-Position: refs/heads/master@{#420088}

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -9 lines) Patch
M third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp View 2 chunks +10 lines, -8 lines 3 comments Download

Messages

Total messages: 21 (10 generated)
xidachen
PTAL
4 years, 3 months ago (2016-09-20 15:35:08 UTC) #2
Ken Russell (switch to Gerrit)
LGTM though I'd like danakj@ to take a look if possible. https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): ...
4 years, 3 months ago (2016-09-20 22:55:37 UTC) #4
xidachen
adding junov@ who was investigating a independent bug that happens to be caused by the ...
4 years, 3 months ago (2016-09-21 00:08:42 UTC) #6
Justin Novosad
This change is good, but you are missing a test. In fact, I was looking ...
4 years, 3 months ago (2016-09-21 14:11:32 UTC) #7
xidachen
https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp#newcode258 third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:258: m_recycledBitmap.removeLast(); On 2016/09/20 22:55:37, Ken Russell wrote: > Is ...
4 years, 3 months ago (2016-09-21 14:18:15 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2356803002/1
4 years, 3 months ago (2016-09-21 15:44:04 UTC) #13
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 3 months ago (2016-09-21 17:20:25 UTC) #15
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/09b9264503a9ce8f36005d2a3136cd922ea397b4 Cr-Commit-Position: refs/heads/master@{#420088}
4 years, 3 months ago (2016-09-21 17:23:14 UTC) #17
danakj
LGTM thanks for figuring out the reason for the crash
4 years, 3 months ago (2016-09-21 22:47:55 UTC) #18
esprehn
https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp#newcode252 third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:252: m_recycledBitmap.remove(i); // Removed this position so iterate on it ...
4 years, 2 months ago (2016-09-28 23:41:06 UTC) #20
xidachen
4 years, 2 months ago (2016-09-29 00:08:49 UTC) #21
Message was sent while issue was closed.
On 2016/09/28 23:41:06, esprehn wrote:
>
https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/p...
> File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
(right):
> 
>
https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/p...
> third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:252:
> m_recycledBitmap.remove(i); // Removed this position so iterate on it again.
> This is causing a bunch of vector resizing and copying. I think you want to
> create a new Vector on the stack, copy into it all the values which do match
> m_size, and then swap() with the m_recycledBitmap member. That's the more
> idiomatic way to do this in blink.

Thanks for pointing it out, I will take deeper look.

Powered by Google App Engine
This is Rietveld 408576698