|
|
Created:
4 years, 2 months ago by hajimehoshi Modified:
4 years, 2 months ago CC:
chromium-reviews, tyoshino+watch_chromium.org, Yoav Weiss, gavinp+loader_chromium.org, blink-reviews, loading-reviews+fetch_chromium.org, Nate Chapin Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionImageResource: Reset the encoded image size after receiving all data
Before this CL, an ImageResource's encoded image size remains non-zero
even after the encoded data is cleared. This CL fixes this to make
Resource::onMemoryDump report more accurate size.
BUG=618623, 643135
TEST=webkit_unit_tests --gtest_filter=ImageResourceTest.*
Committed: https://crrev.com/66658a10410c9f6d90dfbabbc3b3d6c9a366e0e2
Cr-Commit-Position: refs/heads/master@{#426754}
Patch Set 1 #
Total comments: 2
Patch Set 2 : (rebasing) #Patch Set 3 : Add encodedSizeMemoryUsage #Patch Set 4 : Fix comments #Patch Set 5 : Remove unnecessary change #
Total comments: 4
Patch Set 6 : Address on yhirano's review #
Total comments: 4
Patch Set 7 : Rename encodedSizeMemoryUsage -> encodedSizeMemoryUsageForTesting #
Depends on Patchset: Messages
Total messages: 51 (28 generated)
The CQ bit was checked by hajimehoshi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
hajimehoshi@chromium.org changed reviewers: + haraken@chromium.org, hiroshige@chromium.org, yhirano@chromium.org
PTAL
https://codereview.chromium.org/2393113002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2393113002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/fetch/ImageResource.cpp:423: setEncodedSize(0); Would it be better to move setEncodedSize into clearData?
https://codereview.chromium.org/2393113002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/2393113002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/fetch/ImageResource.cpp:423: setEncodedSize(0); On 2016/10/05 05:59:39, haraken wrote: > > Would it be better to move setEncodedSize into clearData? I agree but hiroshige@ will do this in another CL. That would not be simple according to hiroshige@.
LGTM
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
Tests are failing.
The CQ bit was checked by hajimehoshi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/10/06 01:32:20, yhirano wrote: > Tests are failing. Couldn't reproduce them on my local machine. Let me cl-try again.
The CQ bit was checked by hajimehoshi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
On 2016/10/06 10:10:30, hajimehoshi wrote: > On 2016/10/06 01:32:20, yhirano wrote: > > Tests are failing. > > Couldn't reproduce them on my local machine. Let me cl-try again. Found that InspectorPageAgent::cachedResourceContent returns empty result when its encoded size is 0. +hiroshige@ do you have any good idea to fix this?
On 2016/10/07 08:59:06, hajimehoshi wrote: > On 2016/10/06 10:10:30, hajimehoshi wrote: > > On 2016/10/06 01:32:20, yhirano wrote: > > > Tests are failing. > > > > Couldn't reproduce them on my local machine. Let me cl-try again. > > Found that InspectorPageAgent::cachedResourceContent returns empty result when > its encoded size is 0. +hiroshige@ do you have any good idea to fix this? ping.
The CQ bit was checked by hajimehoshi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/10/13 02:59:35, ssid wrote: > On 2016/10/07 08:59:06, hajimehoshi wrote: > > On 2016/10/06 10:10:30, hajimehoshi wrote: > > > On 2016/10/06 01:32:20, yhirano wrote: > > > > Tests are failing. > > > > > > Couldn't reproduce them on my local machine. Let me cl-try again. > > > > Found that InspectorPageAgent::cachedResourceContent returns empty result when > > its encoded size is 0. +hiroshige@ do you have any good idea to fix this? > > ping. As discussed offline with hiroshige, I've added encodedSizeMemoryUsage along with encodedSize. This could have a better name. PTAL
LGTM
The CQ bit was checked by hajimehoshi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by hajimehoshi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
yhirano: As we discussed offline, I've removed unnecessary change in MemoryCache, which was my misunderstanding. PTAL
https://codereview.chromium.org/2393113002/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/fetch/Resource.cpp (right): https://codereview.chromium.org/2393113002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/fetch/Resource.cpp:803: void Resource::setEncodedSizeMemoryUsage(size_t encodedSize) { Can you remove this function, and set m_encodedSizeMemoryUsage to 0 in clearData? https://codereview.chromium.org/2393113002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/fetch/Resource.cpp:808: memoryCache()->update(this, oldSize, size()); This is now not needed, right?
Thank you! https://codereview.chromium.org/2393113002/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/fetch/Resource.cpp (right): https://codereview.chromium.org/2393113002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/fetch/Resource.cpp:803: void Resource::setEncodedSizeMemoryUsage(size_t encodedSize) { On 2016/10/14 09:20:00, yhirano wrote: > Can you remove this function, and set m_encodedSizeMemoryUsage to 0 in > clearData? Hmm, your suggestion would affect other resources than ImageResource, which I don't want to do in this CL. https://codereview.chromium.org/2393113002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/fetch/Resource.cpp:808: memoryCache()->update(this, oldSize, size()); On 2016/10/14 09:20:00, yhirano wrote: > This is now not needed, right? Done.
The CQ bit was checked by hajimehoshi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2393113002/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/fetch/Resource.h (right): https://codereview.chromium.org/2393113002/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/fetch/Resource.h:185: size_t encodedSizeMemoryUsage() const { return m_encodedSizeMemoryUsage; } Can you add ForTest[ing] suffix?
lgtm
hiroshige: Are you happy with this change?
On 2016/10/18 04:37:43, hajimehoshi wrote: > hiroshige: Are you happy with this change? hajimehoshi@: Please see #37.
lgtm. Could you add 643135 to BUG in the CL description? https://codereview.chromium.org/2393113002/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/fetch/Resource.h (right): https://codereview.chromium.org/2393113002/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/fetch/Resource.h:185: size_t encodedSizeMemoryUsage() const { return m_encodedSizeMemoryUsage; } On 2016/10/17 05:25:16, yhirano wrote: > Can you add ForTest[ing] suffix? I'm neutral about this; encodedSizeMemoryUsage() is not only for testing but also used for memory-infra. (and both of encodedSize() and encodedSizeMemoryUsage() is equally not recommended)
https://codereview.chromium.org/2393113002/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/fetch/Resource.h (right): https://codereview.chromium.org/2393113002/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/fetch/Resource.h:185: size_t encodedSizeMemoryUsage() const { return m_encodedSizeMemoryUsage; } On 2016/10/19 04:04:01, hiroshige wrote: > On 2016/10/17 05:25:16, yhirano wrote: > > Can you add ForTest[ing] suffix? > > I'm neutral about this; encodedSizeMemoryUsage() is not only for testing but > also used for memory-infra. > (and both of encodedSize() and encodedSizeMemoryUsage() is equally not > recommended) The field is not for testing but this getter is for testing only.
Description was changed from ========== ImageResource: Reset the encoded image size after receiving all data Before this CL, an ImageResource's encoded image size remains non-zero even after the encoded data is cleared. This CL fixes this to make Resource::onMemoryDump report more accurate size. BUG=618623 TEST=webkit_unit_tests --gtest_filter=ImageResourceTest.* ========== to ========== ImageResource: Reset the encoded image size after receiving all data Before this CL, an ImageResource's encoded image size remains non-zero even after the encoded data is cleared. This CL fixes this to make Resource::onMemoryDump report more accurate size. BUG=618623, 643135 TEST=webkit_unit_tests --gtest_filter=ImageResourceTest.* ==========
Thank you! https://codereview.chromium.org/2393113002/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/fetch/Resource.h (right): https://codereview.chromium.org/2393113002/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/fetch/Resource.h:185: size_t encodedSizeMemoryUsage() const { return m_encodedSizeMemoryUsage; } On 2016/10/19 05:36:11, yhirano wrote: > On 2016/10/19 04:04:01, hiroshige wrote: > > On 2016/10/17 05:25:16, yhirano wrote: > > > Can you add ForTest[ing] suffix? > > > > I'm neutral about this; encodedSizeMemoryUsage() is not only for testing but > > also used for memory-infra. > > (and both of encodedSize() and encodedSizeMemoryUsage() is equally not > > recommended) > > The field is not for testing but this getter is for testing only. Done.
The CQ bit was checked by hajimehoshi@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from haraken@chromium.org, hiroshige@chromium.org, yhirano@chromium.org Link to the patchset: https://codereview.chromium.org/2393113002/#ps120001 (title: "Rename encodedSizeMemoryUsage -> encodedSizeMemoryUsageForTesting")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== ImageResource: Reset the encoded image size after receiving all data Before this CL, an ImageResource's encoded image size remains non-zero even after the encoded data is cleared. This CL fixes this to make Resource::onMemoryDump report more accurate size. BUG=618623, 643135 TEST=webkit_unit_tests --gtest_filter=ImageResourceTest.* ========== to ========== ImageResource: Reset the encoded image size after receiving all data Before this CL, an ImageResource's encoded image size remains non-zero even after the encoded data is cleared. This CL fixes this to make Resource::onMemoryDump report more accurate size. BUG=618623, 643135 TEST=webkit_unit_tests --gtest_filter=ImageResourceTest.* ==========
Message was sent while issue was closed.
Committed patchset #7 (id:120001)
Message was sent while issue was closed.
Description was changed from ========== ImageResource: Reset the encoded image size after receiving all data Before this CL, an ImageResource's encoded image size remains non-zero even after the encoded data is cleared. This CL fixes this to make Resource::onMemoryDump report more accurate size. BUG=618623, 643135 TEST=webkit_unit_tests --gtest_filter=ImageResourceTest.* ========== to ========== ImageResource: Reset the encoded image size after receiving all data Before this CL, an ImageResource's encoded image size remains non-zero even after the encoded data is cleared. This CL fixes this to make Resource::onMemoryDump report more accurate size. BUG=618623, 643135 TEST=webkit_unit_tests --gtest_filter=ImageResourceTest.* Committed: https://crrev.com/66658a10410c9f6d90dfbabbc3b3d6c9a366e0e2 Cr-Commit-Position: refs/heads/master@{#426754} ==========
Message was sent while issue was closed.
Patchset 7 (id:??) landed as https://crrev.com/66658a10410c9f6d90dfbabbc3b3d6c9a366e0e2 Cr-Commit-Position: refs/heads/master@{#426754} |