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

Issue 603462 link

Starred by 6 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocked on:
issue 657382

Blocking:
issue 603595
issue 603791
issue 644058
issue 668611



Sign in to add a comment

Weak MemoryCache

Project Member Reported by hirosh...@chromium.org, Apr 14 2016

Issue description

Make references from MemoryCache to Resource weak.
 

Comment 1 by kbr@chromium.org, Apr 14 2016

Blockedon: 603595

Comment 2 by kinuko@chromium.org, Apr 15 2016

Blocking: 603791
I see why the FPS were dropping a few days ago.
Note: at this time, this issue doesn't affect any recent regressions, because this issue addresses a long-term issue of MemoryCache and no commits are made.
Blocking: 603595
Blockedon: -603595
Committed: https://codereview.chromium.org/1807323002/
(I forgot BUG=603462 so pasted the following here manually)

Make Reference from Inspector to Resource weak, remove removedFromMemoryCache()

Previously, Inspector and CSSStyleSheet-related classes depend on whether
Resource is in MemoryCache and track Resource's eviction from MemoryCache by
removedFromMemoryCache().

This CL replaces the condition of "whether Resource is in MemoryCache" with
"whether Resource is not garbage collected":
- Replaces Resource::removedFromMemoryCache() with newly-added Resource's
  prefinalizer, Resource::willDestroyResource().
- Make |NetworkResourcesData::ResourceData::m_cachedResource| a WeakMember,
  so that Resource's prefinalizer is called even if it is referenced by
  |m_cachedResource|.
- Removes some checks of MemoryCache from Inspector, and
  replaces StyleSheetContents::isInMemoryCache() with
  StyleSheetContents::isReferencedFromResource().

This is Step 1a of Weak MemoryCache:
https://docs.google.com/document/d/1Pj4vzxzCKC_11SugdJ_x7wq7ErE-pHtf4w4FLKdcF7g/edit?usp=sharing

BUG=603462
Committed: https://crrev.com/9b939698486aae30f47b68806ed70d660dea776e
Cr-Commit-Position: refs/heads/master@{#392562}
The CL at Comment #8 was landed on 52.0.2733.0.
Project Member

Comment 10 by bugdroid1@chromium.org, May 13 2016

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

commit 5ea6d3b8ee5b06fdfa4bc56767637680ca68af95
Author: hiroshige <hiroshige@chromium.org>
Date: Fri May 13 20:46:38 2016

Encapsulate |MemoryCacheEntry::m_resource| and refactor pruneDead/LiveResources

This CL
- Make |MemoryCacheEntry::m_resource| private and always use MemoryCacheEntry::resource(),
- Removes somes ASSERT() because Issue 594644 is now fixed, and
- Continue pruning when we encounter entries evicted during destroyDecodedData().

BUG=603462, 594644

Review-Url: https://codereview.chromium.org/1918093003
Cr-Commit-Position: refs/heads/master@{#393632}

[modify] https://crrev.com/5ea6d3b8ee5b06fdfa4bc56767637680ca68af95/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
[modify] https://crrev.com/5ea6d3b8ee5b06fdfa4bc56767637680ca68af95/third_party/WebKit/Source/core/fetch/MemoryCache.h

Project Member

Comment 11 by bugdroid1@chromium.org, May 16 2016

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

commit 682417e0c5057a4823bc9eeaea5dc2417edbf10b
Author: hiroshige <hiroshige@chromium.org>
Date: Mon May 16 15:28:40 2016

[WeakMemoryCache] Do not lookup MemoryCache when adding resource to Inspector

Instead of retrieving Resource via ResourceLoader and MemoryCache
(via InspectorPageAgent::cachedResource())
in InspectorResourceAgent::didReceiveResourceResponse(),
this CL passes a Resource pointer directly from loader to Inspector,
in order to reduce dependencies from Inspector to MemoryCache.

BUG=603462

Review-Url: https://codereview.chromium.org/1829803002
Cr-Commit-Position: refs/heads/master@{#393835}

[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/fetch/FetchContext.cpp
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/fetch/FetchContext.h
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/fetch/ResourceFetcher.h
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.idl
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/inspector/InspectorInstrumentationCustomInl.h
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
[modify] https://crrev.com/682417e0c5057a4823bc9eeaea5dc2417edbf10b/third_party/WebKit/Source/core/loader/FrameFetchContext.h

Project Member

Comment 12 by bugdroid1@chromium.org, May 18 2016

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

commit a25ff64ce15df2a38c3bf3f92f3272080e5640f5
Author: dgozman <dgozman@chromium.org>
Date: Wed May 18 22:03:13 2016

[DevTools] Use registerWeakMembers in NetworkResourcesData.

We have custom plumbing from pre-finalizer via InspectorInstrumentation::willDestroyResource, which is no better than intended for this purpose registerWeakMembers call.

BUG= 603462

Review-Url: https://codereview.chromium.org/1985033003
Cr-Commit-Position: refs/heads/master@{#394567}

[modify] https://crrev.com/a25ff64ce15df2a38c3bf3f92f3272080e5640f5/third_party/WebKit/Source/core/fetch/DEPS
[modify] https://crrev.com/a25ff64ce15df2a38c3bf3f92f3272080e5640f5/third_party/WebKit/Source/core/fetch/Resource.cpp
[modify] https://crrev.com/a25ff64ce15df2a38c3bf3f92f3272080e5640f5/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
[modify] https://crrev.com/a25ff64ce15df2a38c3bf3f92f3272080e5640f5/third_party/WebKit/Source/core/inspector/InspectorInstrumentationCustomInl.h
[modify] https://crrev.com/a25ff64ce15df2a38c3bf3f92f3272080e5640f5/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
[modify] https://crrev.com/a25ff64ce15df2a38c3bf3f92f3272080e5640f5/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp
[modify] https://crrev.com/a25ff64ce15df2a38c3bf3f92f3272080e5640f5/third_party/WebKit/Source/core/inspector/NetworkResourcesData.h
[modify] https://crrev.com/a25ff64ce15df2a38c3bf3f92f3272080e5640f5/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp

Project Member

Comment 14 by bugdroid1@chromium.org, Jun 2 2016

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

commit e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f
Author: hiroshige <hiroshige@chromium.org>
Date: Thu Jun 02 06:27:41 2016

[WeakMemoryCache] Field-Trial: Make Reference from MemoryCache to Resource weak

This CL adds two RuntimeEnabledFeatures controlled by Field Trials to evaluate
their feasibility:
- |WeakMemoryCache| switches whether the references from MemoryCache to
  Resource are weak or not.
  A corresponding flag |enable-weak-memorycache| is added to chrome://flags.
  Null checks are added to MemoryCache to handle weak pointers.
- |DoNotUnlockSharedBuffer| skips SharedBuffer::unlock() in Resource::unlock().

This CL will be reverted before going to stable (or even before going to beta).

BUG=603462

Review-Url: https://codereview.chromium.org/1915113005
Cr-Commit-Position: refs/heads/master@{#397312}

[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/chrome/app/generated_resources.grd
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/chrome/browser/about_flags.cc
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/content/child/runtime_features.cc
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/content/public/common/content_features.cc
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/content/public/common/content_features.h
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/third_party/WebKit/Source/core/fetch/MemoryCache.h
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/third_party/WebKit/Source/core/fetch/Resource.cpp
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/third_party/WebKit/public/web/WebRuntimeFeatures.h
[modify] https://crrev.com/e46449c9825bf0891d9b2ba9d0bcaa6ce6cc959f/tools/metrics/histograms/histograms.xml

Cc: rkaplow@chromium.org
Added +rkaplow@ as the Finch ambassador.

Because the field-trial at Comment #14 is canary/dev-only experiment, this crbug entry has no Type-Launch- labels.
Project Member

Comment 16 by bugdroid1@chromium.org, Jun 23 2016

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

commit 4706b08cb45742e3b0dcc73ba443522d0cce28da
Author: hiroshige <hiroshige@chromium.org>
Date: Thu Jun 23 04:19:47 2016

[WeakMemoryCache] Remove Resource from MemoryCache just before destructed

Previously, if Weak MemoryCache is enabled, Resource could be silently
destructed and MemoryCache's live/dead sizes were not updated.
This may cause larger |m_live/deadSize| and more aggressive pruning.

This CL calls MemoryCache::remove() just before a Resource is destructed
to make the MemoryCache sizes correct.

This CL should be reverted before going to beta.

BUG=603462

Review-Url: https://codereview.chromium.org/2066763002
Cr-Commit-Position: refs/heads/master@{#401536}

[modify] https://crrev.com/4706b08cb45742e3b0dcc73ba443522d0cce28da/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
[modify] https://crrev.com/4706b08cb45742e3b0dcc73ba443522d0cce28da/third_party/WebKit/Source/core/fetch/MemoryCache.h

Project Member

Comment 17 by bugdroid1@chromium.org, Jun 27 2016

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

commit 41f261a0bc951dbd256f6d33ac739c9bcad07b13
Author: hiroshige <hiroshige@chromium.org>
Date: Mon Jun 27 07:22:14 2016

Use image instead of CSS in layout test network-memory-cached-resource.html

If we make references from MemoryCache to Resource weak, stylesheet Resource
might be destructed because LinkStyle doesn't keep a strong reference to
Resource after loading is done.
This CL makes network-memory-cached-resource.html to use an image instead of
CSS to make the cached resource alive during the test.

BUG=603462

Review-Url: https://codereview.chromium.org/2012193002
Cr-Commit-Position: refs/heads/master@{#402130}

[modify] https://crrev.com/41f261a0bc951dbd256f6d33ac739c9bcad07b13/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-memory-cached-resource-expected.txt
[modify] https://crrev.com/41f261a0bc951dbd256f6d33ac739c9bcad07b13/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-memory-cached-resource.html
[modify] https://crrev.com/41f261a0bc951dbd256f6d33ac739c9bcad07b13/third_party/WebKit/LayoutTests/http/tests/inspector/network/resources/memory-cached-resource.html

Project Member

Comment 18 by bugdroid1@chromium.org, Jun 30 2016

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

commit bb84af54556198947087f4ec33209e5c4ea5bbc3
Author: hiroshige <hiroshige@chromium.org>
Date: Thu Jun 30 04:29:30 2016

Revert of [WeakMemoryCache] Remove Resource from MemoryCache just before destructed (patchset #3 id:40001 of https://codereview.chromium.org/2066763002/ )

Reason for revert:
Reverting field-trial CLs before going to beta, as planned.

Original issue's description:
> [WeakMemoryCache] Remove Resource from MemoryCache just before destructed
>
> Previously, if Weak MemoryCache is enabled, Resource could be silently
> destructed and MemoryCache's live/dead sizes were not updated.
> This may cause larger |m_live/deadSize| and more aggressive pruning.
>
> This CL calls MemoryCache::remove() just before a Resource is destructed
> to make the MemoryCache sizes correct.
>
> This CL should be reverted before going to beta.
>
> BUG=603462
>
> Committed: https://crrev.com/4706b08cb45742e3b0dcc73ba443522d0cce28da
> Cr-Commit-Position: refs/heads/master@{#401536}

TBR=japhet@chromium.org,yhirano@chromium.org,oilpan-reviews@chromium.org,haraken@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=603462

Review-Url: https://codereview.chromium.org/2110683005
Cr-Commit-Position: refs/heads/master@{#403087}

[modify] https://crrev.com/bb84af54556198947087f4ec33209e5c4ea5bbc3/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
[modify] https://crrev.com/bb84af54556198947087f4ec33209e5c4ea5bbc3/third_party/WebKit/Source/core/fetch/MemoryCache.h

Project Member

Comment 19 by bugdroid1@chromium.org, Jun 30 2016

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

commit 117933b658ec04474d2862a4fae1e5e52fb15e0b
Author: hiroshige <hiroshige@chromium.org>
Date: Thu Jun 30 11:56:36 2016

[WeakMemoryCache] Revert Field-Trial: Make Reference from MemoryCache to Resource weak

This is partial revert of
https://codereview.chromium.org/1915113005.

The modifications in MemoryCache are reverted before going to beta because it
might be not so stable, while other field-trial related changes are kept
because I'm planning further experiment in the next milestone.

BUG=603462

Review-Url: https://codereview.chromium.org/2110823003
Cr-Commit-Position: refs/heads/master@{#403148}

[modify] https://crrev.com/117933b658ec04474d2862a4fae1e5e52fb15e0b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
[modify] https://crrev.com/117933b658ec04474d2862a4fae1e5e52fb15e0b/third_party/WebKit/Source/core/fetch/MemoryCache.h

Blocking: 644058
Project Member

Comment 21 by bugdroid1@chromium.org, Sep 7 2016

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

commit 7356fd5e3a42bc48f010b54f9013d1494f662079
Author: hiroshige <hiroshige@chromium.org>
Date: Wed Sep 07 04:06:56 2016

[WeakMemoryCache] Cleanup Field-Trial code

[1] was partially reverted by [2].
This CL reverts the rest of [1] to remove Field-Trial-related code.

[1] https://codereview.chromium.org/1915113005
[2] https://codereview.chromium.org/2110823003

BUG=603462

Review-Url: https://codereview.chromium.org/2289183005
Cr-Commit-Position: refs/heads/master@{#416842}

[modify] https://crrev.com/7356fd5e3a42bc48f010b54f9013d1494f662079/chrome/app/generated_resources.grd
[modify] https://crrev.com/7356fd5e3a42bc48f010b54f9013d1494f662079/chrome/browser/about_flags.cc
[modify] https://crrev.com/7356fd5e3a42bc48f010b54f9013d1494f662079/content/child/runtime_features.cc
[modify] https://crrev.com/7356fd5e3a42bc48f010b54f9013d1494f662079/content/public/common/content_features.cc
[modify] https://crrev.com/7356fd5e3a42bc48f010b54f9013d1494f662079/content/public/common/content_features.h
[modify] https://crrev.com/7356fd5e3a42bc48f010b54f9013d1494f662079/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
[modify] https://crrev.com/7356fd5e3a42bc48f010b54f9013d1494f662079/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp
[modify] https://crrev.com/7356fd5e3a42bc48f010b54f9013d1494f662079/third_party/WebKit/public/web/WebRuntimeFeatures.h

Project Member

Comment 23 by bugdroid1@chromium.org, Sep 8 2016

Labels: merge-merged-2854
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/581fd42e219de5510f0fd7729e7b00a411ff68a8

commit 581fd42e219de5510f0fd7729e7b00a411ff68a8
Author: hiroshige <hiroshige@chromium.org>
Date: Thu Sep 08 10:56:13 2016

[WeakMemoryCache] Make references from MemoryCache to Resource Weak

Design doc (Step 1):
https://docs.google.com/document/d/1Pj4vzxzCKC_11SugdJ_x7wq7ErE-pHtf4w4FLKdcF7g/edit?usp=sharing

This cl relands
- https://codereview.chromium.org/1915113005
- https://codereview.chromium.org/2066763002
except for code related to Field-Trial or SharedBuffer::unlock().

BUG=603462

Review-Url: https://codereview.chromium.org/2296913003
Cr-Commit-Position: refs/heads/master@{#417245}

[modify] https://crrev.com/581fd42e219de5510f0fd7729e7b00a411ff68a8/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
[modify] https://crrev.com/581fd42e219de5510f0fd7729e7b00a411ff68a8/third_party/WebKit/Source/core/fetch/MemoryCache.h

Project Member

Comment 24 by bugdroid1@chromium.org, Sep 29 2016

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

commit b23d2fc9c472f2b89b1101bdcf38ac13f4756ef7
Author: hiroshige <hiroshige@chromium.org>
Date: Thu Sep 29 07:31:02 2016

Do not call MemoryCache::prune() when a client/observer is removed

- didRemoveClientOrObserver() can be called during a Oilpan prefinalizer,
  so it might be unsafe to call MemoryCache::prune() there.
- As WeakMemoryCache is enabled, Resource is expected to be garbage collected
  shortly after all clients/observers are removed, so there is less need for
  the pruning.

BUG=644058, 603462

Review-Url: https://codereview.chromium.org/2326743003
Cr-Commit-Position: refs/heads/master@{#421768}

[modify] https://crrev.com/b23d2fc9c472f2b89b1101bdcf38ac13f4756ef7/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
[modify] https://crrev.com/b23d2fc9c472f2b89b1101bdcf38ac13f4756ef7/third_party/WebKit/Source/core/fetch/MemoryCache.h
[modify] https://crrev.com/b23d2fc9c472f2b89b1101bdcf38ac13f4756ef7/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp
[modify] https://crrev.com/b23d2fc9c472f2b89b1101bdcf38ac13f4756ef7/third_party/WebKit/Source/core/fetch/Resource.cpp

Blockedon: 657382
Project Member

Comment 26 by bugdroid1@chromium.org, Oct 25 2016

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

commit fd61ca3f63c0640f4606dd9d93bcd681b5dfb6dd
Author: hiroshige <hiroshige@chromium.org>
Date: Tue Oct 25 03:45:17 2016

[WeakMemoryCache] Do not prune in didAccessDecodedData()

Preparation for removing didAccessDecodedData()
in https://codereview.chromium.org/2411243004.

BUG=603462

Review-Url: https://codereview.chromium.org/2435873003
Cr-Commit-Position: refs/heads/master@{#427267}

[modify] https://crrev.com/fd61ca3f63c0640f4606dd9d93bcd681b5dfb6dd/third_party/WebKit/Source/core/fetch/Resource.cpp

Project Member

Comment 27 by bugdroid1@chromium.org, Oct 25 2016

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

commit df6cf99f8c60d3efb3df84dfa1bd0aed6c791b48
Author: hiroshige <hiroshige@chromium.org>
Date: Tue Oct 25 03:59:46 2016

Remove unused Internals::setMemoryCacheCapacities()

According to codesearch, there are no usage of setMemoryCacheCapacities from
JavaScript in the tests.

BUG=603462

Review-Url: https://codereview.chromium.org/2416803002
Cr-Commit-Position: refs/heads/master@{#427271}

[modify] https://crrev.com/df6cf99f8c60d3efb3df84dfa1bd0aed6c791b48/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/df6cf99f8c60d3efb3df84dfa1bd0aed6c791b48/third_party/WebKit/Source/core/testing/Internals.h
[modify] https://crrev.com/df6cf99f8c60d3efb3df84dfa1bd0aed6c791b48/third_party/WebKit/Source/core/testing/Internals.idl

Project Member

Comment 28 by bugdroid1@chromium.org, Nov 17 2016

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

commit a756f82e21bd1af1025d373c099c8a7e7b589514
Author: hiroshige <hiroshige@chromium.org>
Date: Thu Nov 17 21:43:22 2016

[WeakMemoryCache] Remove LRU lists, prune order control and live/dead distinction

This CL removes most of the control mechanisms for prune ordering of Resources
(except one using |m_lastDecodedAccessTime|), including those using the
LRU order, |m_lastDecodedAccessTime|, |m_maxDeferredPruneDeadCapacity|, and
|m_accessCount|.
This enable us to:
- Remove updateDecodedResource(), updateForAccess() and thus
  didAccessDecodedData().
- Make update() to do nothing except for |m_size| update.
- Remove |m_liveDecodedResources| and |m_allResources| and make Resources
  managed only by the simple hashmaps in |m_resourceMaps|.
- Remove live/dead distinction in MemoryCache.
  - Remove min/max dead capacities.
  - Merge liveSize() and deadSize() into size().

Removal of min/max dead capacities and live/dead distinction causes more code
outside core/fetch to be unused.
https://codereview.chromium.org/2435603002/ will remove such unused code.

This CL also
- Removes a prune() call in didAccessDecodedData().
- Adds |const| to some methods.

This CL increases web_cache size reported in memory-infra (e.g.
memory.top_10_mobile performance test's web_cache:effective_size_avg), but
this doesn't affect the real memory usage.
Previously, dead Resources were evicted during pruneDeadResources() and such
Resources were not reported to memory-infra.
This CL make such Resources to be reported to memory-infra because this CL
doesn't evict Resources during pruneResources().

BUG=603462

Review-Url: https://codereview.chromium.org/2411243004
Cr-Commit-Position: refs/heads/master@{#432972}

[modify] https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp
[modify] https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp
[modify] https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514/third_party/WebKit/Source/core/fetch/ImageResource.cpp
[modify] https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
[modify] https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514/third_party/WebKit/Source/core/fetch/MemoryCache.h
[modify] https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp
[modify] https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514/third_party/WebKit/Source/core/fetch/Resource.cpp
[modify] https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514/third_party/WebKit/Source/core/fetch/Resource.h
[modify] https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
[modify] https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514/third_party/WebKit/Source/web/WebCache.cpp

The commit at Comment #28 landed on 56.0.2924.0.
Project Member

Comment 30 by bugdroid1@chromium.org, Nov 22 2016

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

commit 950d4f8dae0d4011896719a973eaebba757b5828
Author: hiroshige <hiroshige@chromium.org>
Date: Tue Nov 22 16:30:51 2016

Remove ImageObserver::didDraw()

Follow-up of https://codereview.chromium.org/2411243004/.
didDraw() no longer does anything.

BUG=603462

Review-Url: https://codereview.chromium.org/2447623002
Cr-Commit-Position: refs/heads/master@{#433881}

[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/core/fetch/ImageResource.cpp
[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/core/fetch/ImageResource.h
[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp
[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/platform/graphics/ImageObserver.h
[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp
[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/platform/graphics/PlaceholderImage.h
[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp
[modify] https://crrev.com/950d4f8dae0d4011896719a973eaebba757b5828/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp

Blocking: 668611
I found I did something inconsistent in https://codereview.chromium.org/2411243004:
The CL Description says:
  This CL removes most of the control mechanisms ... (except one using 
  |m_lastDecodedAccessTime|), including ... |m_lastDecodedAccessTime| ...
And |m_lastDecodedAccessTime| itself remains in the code base but the logic for that was removed.

Sign in to add a comment