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

Issue 1018743003: Re-land: base: Replace PurgeAndTruncate with Shrink function. (Closed)

Created:
5 years, 9 months ago by reveman
Modified:
5 years, 8 months ago
CC:
chromium-reviews, darin-cc_chromium.org, erikwright+watch_chromium.org, gavinp+memory_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Re-land: base: Replace PurgeAndTruncate with Shrink function. This cleans up the API a bit and allows the code to be unit tested. This also prevents ftruncate from being used on Android where shared memory is backed by Ashmem. Ashmem doesn't support ftruncate. BUG=466509 TEST=base_unittests --gtest_filter=DiscardableSharedMemoryTest.Shrink Committed: https://crrev.com/59d32f501694975c4011ea85a67060a41140d0f4 Cr-Commit-Position: refs/heads/master@{#323941}

Patch Set 1 #

Patch Set 2 : avoid using ftruncate on android #

Total comments: 2

Patch Set 3 : remove IsShrinkingSupported #

Total comments: 2

Patch Set 4 : add DISCARDABLE_SHARED_MEMORY_SHRINKING define #

Total comments: 2

Patch Set 5 : move define #

Patch Set 6 : avoid changes in behavior #

Patch Set 7 : fix typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -28 lines) Patch
M base/memory/discardable_shared_memory.h View 1 2 3 4 3 chunks +12 lines, -6 lines 0 comments Download
M base/memory/discardable_shared_memory.cc View 1 2 3 2 chunks +20 lines, -16 lines 0 comments Download
M base/memory/discardable_shared_memory_unittest.cc View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
M content/common/host_discardable_shared_memory_manager.cc View 1 2 3 4 5 6 1 chunk +11 lines, -6 lines 0 comments Download

Messages

Total messages: 24 (6 generated)
reveman
5 years, 9 months ago (2015-03-18 22:28:32 UTC) #2
Avi (use Gerrit)
lgtm
5 years, 9 months ago (2015-03-18 22:36:03 UTC) #3
reveman
+danakj for base/
5 years, 9 months ago (2015-03-18 23:01:44 UTC) #5
danakj
https://codereview.chromium.org/1018743003/diff/20001/base/memory/discardable_shared_memory_unittest.cc File base/memory/discardable_shared_memory_unittest.cc (right): https://codereview.chromium.org/1018743003/diff/20001/base/memory/discardable_shared_memory_unittest.cc#newcode315 base/memory/discardable_shared_memory_unittest.cc:315: if (!DiscardableSharedMemory::IsShrinkingSupported()) Do you think you could add platform ...
5 years, 9 months ago (2015-03-18 23:18:52 UTC) #6
reveman
https://codereview.chromium.org/1018743003/diff/20001/base/memory/discardable_shared_memory_unittest.cc File base/memory/discardable_shared_memory_unittest.cc (right): https://codereview.chromium.org/1018743003/diff/20001/base/memory/discardable_shared_memory_unittest.cc#newcode315 base/memory/discardable_shared_memory_unittest.cc:315: if (!DiscardableSharedMemory::IsShrinkingSupported()) On 2015/03/18 at 23:18:52, danakj wrote: > ...
5 years, 9 months ago (2015-03-19 02:21:54 UTC) #7
danakj
https://codereview.chromium.org/1018743003/diff/40001/content/common/host_discardable_shared_memory_manager.cc File content/common/host_discardable_shared_memory_manager.cc (right): https://codereview.chromium.org/1018743003/diff/40001/content/common/host_discardable_shared_memory_manager.cc#newcode386 content/common/host_discardable_shared_memory_manager.cc:386: #if defined(OS_POSIX) && !defined(OS_ANDROID) Hmm.. the only thing I ...
5 years, 9 months ago (2015-03-19 16:41:56 UTC) #8
reveman
PTAL https://codereview.chromium.org/1018743003/diff/40001/content/common/host_discardable_shared_memory_manager.cc File content/common/host_discardable_shared_memory_manager.cc (right): https://codereview.chromium.org/1018743003/diff/40001/content/common/host_discardable_shared_memory_manager.cc#newcode386 content/common/host_discardable_shared_memory_manager.cc:386: #if defined(OS_POSIX) && !defined(OS_ANDROID) On 2015/03/19 16:41:56, danakj ...
5 years, 9 months ago (2015-03-19 19:23:05 UTC) #9
reveman
ping for review
5 years, 9 months ago (2015-03-23 18:53:21 UTC) #10
danakj
I like the define approach so LGTM, with one suggestion: https://codereview.chromium.org/1018743003/diff/60001/base/memory/discardable_shared_memory.h File base/memory/discardable_shared_memory.h (right): https://codereview.chromium.org/1018743003/diff/60001/base/memory/discardable_shared_memory.h#newcode19 ...
5 years, 9 months ago (2015-03-25 17:55:00 UTC) #11
reveman
https://codereview.chromium.org/1018743003/diff/60001/base/memory/discardable_shared_memory.h File base/memory/discardable_shared_memory.h (right): https://codereview.chromium.org/1018743003/diff/60001/base/memory/discardable_shared_memory.h#newcode19 base/memory/discardable_shared_memory.h:19: On 2015/03/25 17:55:00, danakj wrote: > If might be ...
5 years, 9 months ago (2015-03-25 18:26:42 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1018743003/80001
5 years, 9 months ago (2015-03-25 18:27:12 UTC) #15
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 9 months ago (2015-03-25 19:21:39 UTC) #16
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/2d15df9ef3f9b982aef650d0be0be64a1c5d34a5 Cr-Commit-Position: refs/heads/master@{#322207}
5 years, 9 months ago (2015-03-25 19:22:04 UTC) #17
reveman
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/1057493005/ by reveman@chromium.org. ...
5 years, 8 months ago (2015-04-01 15:14:50 UTC) #18
reveman
Going to try re-land this now that I've updated the patch to not change the ...
5 years, 8 months ago (2015-04-06 18:49:42 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1018743003/120001
5 years, 8 months ago (2015-04-06 19:09:25 UTC) #22
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 8 months ago (2015-04-06 20:11:33 UTC) #23
commit-bot: I haz the power
5 years, 8 months ago (2015-04-06 20:12:27 UTC) #24
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/59d32f501694975c4011ea85a67060a41140d0f4
Cr-Commit-Position: refs/heads/master@{#323941}

Powered by Google App Engine
This is Rietveld 408576698