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

Issue 2054643003: Remove duplication of encoded image data (Closed)

Created:
4 years, 6 months ago by hajimehoshi
Modified:
3 years, 6 months ago
CC:
ajuma+watch_chromium.org, blink-reviews, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dcheng, dshwang, drott+blinkwatch_chromium.org, krit, jbroman, Justin Novosad, pdr+graphicswatchlist_chromium.org, Peter Kasting, rwlbuis, Stephen Chennney
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove duplication of encoded image data Now there are at least two encoded image data: one is in Image/ImageResource as SharedBuffer and the other is in DeferredImageDecoder as SkRWBuffer. This CL removes former when possible (non-icon bitmaps), and generate the SharedBuffer from the SkRWBuffer if needed. Design Doc: https://docs.google.com/document/d/1v0yTAZ6wkqX2U_M6BNIGUJpM1s0TIw1VsqpxoL7aciY/edit?usp=sharing BUG=618623 TEST=blink_platform_unittests --gtest_filter=BitmapImageTest.*:ImageDecoderTest.* Committed: https://crrev.com/36f4eb81d4a791a8e3dfea4ba2418465d30bcc90 Cr-Commit-Position: refs/heads/master@{#406238}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 #

Total comments: 5

Patch Set 4 : Bug fix: m_image should not be cleared #

Total comments: 4

Patch Set 5 : Address on hiroshige's review #

Total comments: 13

Patch Set 6 : (rebase) #

Patch Set 7 : Address on Leon's review #

Patch Set 8 : Stop deleting m_image at clearImage() #

Total comments: 10

Patch Set 9 : Address on haraken's review #

Patch Set 10 : Remove ImageResource::clearImage #

Patch Set 11 : Fix a bug in DeferredImageDecoder::data #

Patch Set 12 : Bug fix: Recreate images for multipart response #

Patch Set 13 : (rebasing) #

Patch Set 14 : Refactoring #

Total comments: 31

Patch Set 15 : (rebase) #

Patch Set 16 : Address on reviews #

Patch Set 17 : Simplify changes #

Patch Set 18 : Bug fix #

Total comments: 5

Patch Set 19 : Address on fmalita's review #

Patch Set 20 : Remove a comment #

Total comments: 16

Patch Set 21 : (rebase) #

Patch Set 22 : Address on haraken's review #

Patch Set 23 : Remove DeferredImageDecoder::hasData #

Patch Set 24 : Move m_data.clear() to finish() #

Total comments: 1

Patch Set 25 : Add DCHECK #

Total comments: 8

Patch Set 26 : Address on hiroshige's review #

Patch Set 27 : (rebase) #

Patch Set 28 : (rebase) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+110 lines, -44 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/clipboard/DataTransfer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 7 chunks +24 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 3 chunks +7 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 3 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/SharedBufferChunkReader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/BitmapImage.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/BitmapImage.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +19 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +15 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Image.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageSource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageSource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/mhtml/MHTMLArchive.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/mhtml/MHTMLParser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/mhtml/MHTMLParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download

Depends on Patchset:

Messages

Total messages: 84 (26 generated)
hajimehoshi
PTAL https://codereview.chromium.org/2054643003/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode130 third_party/WebKit/Source/core/fetch/ImageResource.cpp:130: I think it is safe to remove since ...
4 years, 6 months ago (2016-06-10 13:30:28 UTC) #10
f(malita)
https://codereview.chromium.org/2054643003/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2054643003/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode389 third_party/WebKit/Source/core/fetch/ImageResource.cpp:389: updateImageAndClearBuffer(); My understanding of the current impl is that ...
4 years, 6 months ago (2016-06-10 14:26:43 UTC) #11
hajimehoshi
Thank you! https://codereview.chromium.org/2054643003/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2054643003/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode389 third_party/WebKit/Source/core/fetch/ImageResource.cpp:389: updateImageAndClearBuffer(); On 2016/06/10 14:26:43, f(malita) wrote: > ...
4 years, 6 months ago (2016-06-13 09:10:47 UTC) #12
hajimehoshi
+hiroshige
4 years, 6 months ago (2016-06-13 09:12:42 UTC) #14
f(malita)
On 2016/06/13 09:10:47, hajimehoshi wrote: > Did you mean the resource cache is ResourceFetcher::cachedResource > ...
4 years, 6 months ago (2016-06-13 10:32:58 UTC) #15
f(malita)
On 2016/06/13 10:32:58, f(malita) wrote: > Yeah, I'm thinking of MemoryCache and ResourceFetcher interactions: AFAIU ...
4 years, 6 months ago (2016-06-13 10:34:52 UTC) #16
hajimehoshi
On 2016/06/13 10:32:58, f(malita) wrote: > On 2016/06/13 09:10:47, hajimehoshi wrote: > > Did you ...
4 years, 6 months ago (2016-06-13 12:10:10 UTC) #17
hajimehoshi
On 2016/06/13 12:10:10, hajimehoshi wrote: > On 2016/06/13 10:32:58, f(malita) wrote: > > On 2016/06/13 ...
4 years, 6 months ago (2016-06-15 10:55:57 UTC) #18
hiroshige
I think ImageResource::destroyDecodedDataIfPossible() should also be modified; currently, it can clear |m_image| as decoded data. ...
4 years, 6 months ago (2016-06-15 13:16:26 UTC) #19
hiroshige
https://codereview.chromium.org/2054643003/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode130 third_party/WebKit/Source/core/fetch/ImageResource.cpp:130: On 2016/06/10 13:30:28, hajimehoshi wrote: > I think it ...
4 years, 6 months ago (2016-06-15 13:27:01 UTC) #20
hajimehoshi
https://codereview.chromium.org/2054643003/diff/60001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2054643003/diff/60001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode354 third_party/WebKit/Source/core/fetch/ImageResource.cpp:354: sizeAvailable = m_image->setData(m_data, allDataReceived); On 2016/06/15 13:16:25, hiroshige (slow) ...
4 years, 6 months ago (2016-06-16 09:43:20 UTC) #21
hajimehoshi
https://codereview.chromium.org/2054643003/diff/60001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2054643003/diff/60001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode354 third_party/WebKit/Source/core/fetch/ImageResource.cpp:354: sizeAvailable = m_image->setData(m_data, allDataReceived); On 2016/06/16 09:43:20, hajimehoshi wrote: ...
4 years, 6 months ago (2016-06-16 09:47:41 UTC) #22
hajimehoshi
On 2016/06/15 13:16:26, hiroshige (slow) wrote: > I think ImageResource::destroyDecodedDataIfPossible() should also be modified; > ...
4 years, 6 months ago (2016-06-16 12:11:42 UTC) #23
hajimehoshi
PTAL https://codereview.chromium.org/2054643003/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/40001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode130 third_party/WebKit/Source/core/fetch/ImageResource.cpp:130: On 2016/06/15 13:27:01, hiroshige (slow) wrote: > On ...
4 years, 6 months ago (2016-06-17 09:25:15 UTC) #24
scroggo_chromium
https://codereview.chromium.org/2054643003/diff/80001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2054643003/diff/80001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode194 third_party/WebKit/Source/core/fetch/ImageResource.cpp:194: if (!hasClientsOrObservers() && !isLoading() && m_image && (m_image->hasOneRef() && ...
4 years, 6 months ago (2016-06-20 19:00:44 UTC) #25
hajimehoshi
Thank you! https://codereview.chromium.org/2054643003/diff/80001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/80001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode358 third_party/WebKit/Source/core/fetch/ImageResource.cpp:358: if (m_image) Found that there is a ...
4 years, 6 months ago (2016-06-22 09:42:30 UTC) #26
scroggo_chromium
lgtm
4 years, 6 months ago (2016-06-22 19:22:49 UTC) #28
haraken
Exciting! tasak@: Would you measure how much this CL reduces renderer's memory?
4 years, 6 months ago (2016-06-23 00:59:56 UTC) #29
haraken
https://codereview.chromium.org/2054643003/diff/160001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2054643003/diff/160001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode190 third_party/WebKit/Source/core/fetch/ImageResource.cpp:190: m_image->destroyDecodedData(); Honestly speaking, I don't fully understand changes in ...
4 years, 6 months ago (2016-06-23 01:26:41 UTC) #30
hajimehoshi
Thank you! Thanks to hiroshige-san, we found that this CL needs to consider SVGImage since ...
4 years, 6 months ago (2016-06-23 09:23:13 UTC) #31
hajimehoshi
I think all bugs detected by the build bots have been fixed. PTAL
4 years, 5 months ago (2016-06-28 08:58:13 UTC) #32
scroggo_chromium
https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode357 third_party/WebKit/Source/core/fetch/ImageResource.cpp:357: m_image->clearImageObserver(); Why is it okay to drop this line? ...
4 years, 5 months ago (2016-06-28 15:33:44 UTC) #33
hiroshige
https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode332 third_party/WebKit/Source/core/fetch/ImageResource.cpp:332: clearImage(); Perhaps, we need to call clearImage() here, because ...
4 years, 5 months ago (2016-06-29 07:04:06 UTC) #34
hiroshige
Probably we need a design doc that describe the lifetime of - |Resource::m_data|, - |ImageResource::m_image|, ...
4 years, 5 months ago (2016-06-29 07:07:29 UTC) #35
haraken
On 2016/06/29 07:07:29, hiroshige wrote: > Probably we need a design doc that describe the ...
4 years, 5 months ago (2016-06-29 07:29:32 UTC) #36
hiroshige
https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode189 third_party/WebKit/Source/core/fetch/ImageResource.cpp:189: m_image->destroyDecodedData(); On 2016/06/29 07:04:06, hiroshige wrote: > I think ...
4 years, 5 months ago (2016-06-29 08:20:52 UTC) #37
f(malita)
https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode226 third_party/WebKit/Source/core/fetch/ImageResource.cpp:226: return data; Nit: return data.release(); https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp File third_party/WebKit/Source/platform/graphics/BitmapImage.cpp (right): ...
4 years, 5 months ago (2016-06-30 18:21:46 UTC) #38
hajimehoshi
Thank you! https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode332 third_party/WebKit/Source/core/fetch/ImageResource.cpp:332: clearImage(); On 2016/06/29 07:04:06, hiroshige wrote: > ...
4 years, 5 months ago (2016-07-04 10:46:25 UTC) #39
hajimehoshi
On 2016/06/29 07:07:29, hiroshige wrote: > Probably we need a design doc that describe the ...
4 years, 5 months ago (2016-07-05 12:13:17 UTC) #41
hajimehoshi
On 2016/06/30 18:21:46, f(malita) wrote: > https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp > File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): > > https://codereview.chromium.org/2054643003/diff/280001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#newcode226 > ...
4 years, 5 months ago (2016-07-07 11:56:39 UTC) #42
hajimehoshi
ping
4 years, 5 months ago (2016-07-08 02:17:44 UTC) #43
hiroshige
https://codereview.chromium.org/2054643003/diff/360001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/360001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode521 third_party/WebKit/Source/core/fetch/ImageResource.cpp:521: updateImageAndClearBuffer(); FYI [1] will change this line. Because [1] ...
4 years, 5 months ago (2016-07-08 08:28:41 UTC) #44
hiroshige
https://codereview.chromium.org/2054643003/diff/360001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/360001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode521 third_party/WebKit/Source/core/fetch/ImageResource.cpp:521: updateImageAndClearBuffer(); On 2016/07/08 08:28:41, hiroshige wrote: > FYI [1] ...
4 years, 5 months ago (2016-07-08 08:29:27 UTC) #45
f(malita)
Thanks for verifying perf with Telemetry. Just a small refactoring question. https://codereview.chromium.org/2054643003/diff/360001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp File third_party/WebKit/Source/platform/graphics/BitmapImage.cpp (right): ...
4 years, 5 months ago (2016-07-08 15:34:40 UTC) #46
hajimehoshi
Thank you! https://codereview.chromium.org/2054643003/diff/360001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp File third_party/WebKit/Source/platform/graphics/BitmapImage.cpp (right): https://codereview.chromium.org/2054643003/diff/360001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp#newcode194 third_party/WebKit/Source/platform/graphics/BitmapImage.cpp:194: m_temporaryEncodedImageData = data; On 2016/07/08 15:34:40, f(malita) ...
4 years, 5 months ago (2016-07-11 06:15:08 UTC) #47
f(malita)
https://codereview.chromium.org/2054643003/diff/360001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp File third_party/WebKit/Source/platform/graphics/BitmapImage.cpp (right): https://codereview.chromium.org/2054643003/diff/360001/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp#newcode194 third_party/WebKit/Source/platform/graphics/BitmapImage.cpp:194: m_temporaryEncodedImageData = data; On 2016/07/11 06:15:07, hajimehoshi wrote: > ...
4 years, 5 months ago (2016-07-12 17:10:59 UTC) #48
haraken
Mostly looks good. https://codereview.chromium.org/2054643003/diff/400001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/400001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode399 third_party/WebKit/Source/core/fetch/ImageResource.cpp:399: m_data.clear(); I don't fully understand why ...
4 years, 5 months ago (2016-07-13 02:18:30 UTC) #49
hajimehoshi
Thank you! https://codereview.chromium.org/2054643003/diff/400001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/400001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode399 third_party/WebKit/Source/core/fetch/ImageResource.cpp:399: m_data.clear(); On 2016/07/13 02:18:29, haraken wrote: > ...
4 years, 5 months ago (2016-07-13 07:36:22 UTC) #51
haraken
https://codereview.chromium.org/2054643003/diff/400001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/400001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode399 third_party/WebKit/Source/core/fetch/ImageResource.cpp:399: m_data.clear(); On 2016/07/13 07:36:22, hajimehoshi wrote: > On 2016/07/13 ...
4 years, 5 months ago (2016-07-13 07:38:34 UTC) #52
hajimehoshi
https://codereview.chromium.org/2054643003/diff/400001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/400001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode399 third_party/WebKit/Source/core/fetch/ImageResource.cpp:399: m_data.clear(); On 2016/07/13 07:38:34, haraken wrote: > On 2016/07/13 ...
4 years, 5 months ago (2016-07-13 07:59:59 UTC) #53
haraken
https://codereview.chromium.org/2054643003/diff/500001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/500001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode532 third_party/WebKit/Source/core/fetch/ImageResource.cpp:532: updateImageAndClearBuffer(); Why can we remove this? Now you're not ...
4 years, 5 months ago (2016-07-13 08:07:42 UTC) #54
haraken
Discussed offline. LGTM.
4 years, 5 months ago (2016-07-13 08:13:58 UTC) #55
hiroshige
+mkwst@ as a core/fetch OWNER. (This CL is already l-g-t-m'ed by core OWNERs, but I'd ...
4 years, 5 months ago (2016-07-13 09:26:55 UTC) #57
hajimehoshi
https://codereview.chromium.org/2054643003/diff/520001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2054643003/diff/520001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode126 third_party/WebKit/Source/core/fetch/ImageResource.cpp:126: void ImageResource::didAddClient(ResourceClient* client) On 2016/07/13 09:26:55, hiroshige wrote: > ...
4 years, 5 months ago (2016-07-13 12:25:45 UTC) #58
Mike West
//Source/core/fetch LGTM. Let's see if those DCHECKs start firing. :)
4 years, 5 months ago (2016-07-18 08:36:29 UTC) #63
hajimehoshi
Thank you! hiroshige, are you fine with this change landing?
4 years, 5 months ago (2016-07-19 06:16:21 UTC) #66
hiroshige
lgtm, all related CLs I mentioned have been landed. Thank you for making this change!
4 years, 5 months ago (2016-07-19 08:42:10 UTC) #67
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/2054643003/580001
4 years, 5 months ago (2016-07-19 09:46:41 UTC) #72
commit-bot: I haz the power
Committed patchset #28 (id:580001)
4 years, 5 months ago (2016-07-19 09:59:50 UTC) #74
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-19 09:59:58 UTC) #75
commit-bot: I haz the power
Patchset 28 (id:??) landed as https://crrev.com/36f4eb81d4a791a8e3dfea4ba2418465d30bcc90 Cr-Commit-Position: refs/heads/master@{#406238}
4 years, 5 months ago (2016-07-19 10:02:18 UTC) #77
haraken
On 2016/07/19 10:02:18, commit-bot: I haz the power wrote: > Patchset 28 (id:??) landed as ...
4 years, 5 months ago (2016-07-20 16:54:05 UTC) #78
hajimehoshi
On 2016/07/20 16:54:05, haraken wrote: > On 2016/07/19 10:02:18, commit-bot: I haz the power wrote: ...
4 years, 5 months ago (2016-07-21 04:12:10 UTC) #79
lhp.peter
Why not make SharedBuffer threadsafe and discard SkRWBuffer from DeferredImageDecoder? I think it will resolve ...
4 years, 2 months ago (2016-09-25 13:04:20 UTC) #80
Noel Gordon
On 2016/09/25 13:04:20, lhp.peter_gmail.com wrote: > Why not make SharedBuffer threadsafe That is a very ...
3 years, 10 months ago (2017-02-22 06:37:17 UTC) #81
hajimehoshi
On 2016/09/25 13:04:20, lhp.peter_gmail.com wrote: > Why not make SharedBuffer threadsafe and discard SkRWBuffer from ...
3 years, 10 months ago (2017-02-22 07:25:30 UTC) #82
lhp.peter
On 2017/02/22 07:25:30, hajimehoshi wrote: > On 2016/09/25 13:04:20, http://lhp.peter_gmail.com wrote: > > Why not ...
3 years, 7 months ago (2017-05-25 12:11:56 UTC) #83
scroggo_chromium
3 years, 6 months ago (2017-05-30 20:39:07 UTC) #84
Message was sent while issue was closed.
On 2017/05/25 12:11:56, lhp.peter wrote:
> On 2017/02/22 07:25:30, hajimehoshi wrote:
> > On 2016/09/25 13:04:20, http://lhp.peter_gmail.com wrote:
> > > Why not make SharedBuffer threadsafe and discard SkRWBuffer from
> > > DeferredImageDecoder? I think it will resolve this problem originally.
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google Groups
> > "Blink
> > > Reviews" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an
> > email
> > > to mailto:blink-reviews+unsubscribe@chromium.org.
> > 
> > As far as I can remember, we didn't want to add any locks for buffers for
> > performance. SkRWBuffer is special since this doesn't require any locks when
> it
> > is read by multiple threads and written by one thread at the same time.
> > SkRWBuffer is an append-only data storage and appending data chunk doesn't
> > affect readers.
> 
> Depending on whether the vectors' capacity needs to be expanded, SharedBuffer
> can be divided into several steps.
> In step, single thread writing and multi-threaded reading are safe. So only in
> the step switch, synchronization should be make. 

Sorry, I do not follow you.

> This cost is light enough. Moreover, the existing ROBufferSegmentReader also
> need to add a wide range of lock when reading.

Although ROBufferSegmentReader does use a lock, it only uses one for reading. In
practice, there is only one owner of an ROBufferSegmentReader, so there will be
no contention on that lock. (There is a brief note about this in the description
for
https://chromium.googlesource.com/chromium/src/+/d2234904faee943bd987bd38d620...)

If we were to make SharedBuffer threadsafe, wouldn't we have to lock while
reading and writing? I suspect there would be some contention here, leading to
worse performance, but maybe I'm wrong.

> 
> In addition, SharedBuffer supports random access, while ROBufferSegmentReader
> only supports forward or backward access by segment.

Indeed. Many calls access consecutive data, though, so often random access is
not necessary.

Powered by Google App Engine
This is Rietveld 408576698