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

Issue 22908008: Limit the total memory usage for Stream instances (Closed)

Created:
7 years, 4 months ago by tyoshino (SeeGerritForStatus)
Modified:
7 years, 4 months ago
Reviewers:
kinuko, Charlie Reis, jam
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, kinuko+watch, jam, tzik+watch_chromium.org
Visibility:
Public.

Description

Limit the total memory usage for Stream instances Stream instances report their memory usage to StreamRegistry to get approval. If rejected, they unregisters themselves. writer_ and reader_ are cleared immediately when memory usage violation happens. Added task runner DCHECKs to ByteStreamReaderImpl and ByteStreamWriterImpl so that we can check we're not violating thread restriction. BUG=169957 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=218933

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 12

Patch Set 4 : Added <limits> #

Total comments: 4

Patch Set 5 : Rebase and kinuko's comments #

Patch Set 6 : Unittest update #

Total comments: 1

Patch Set 7 : Revert thread DCHECKs #

Patch Set 8 : Removed bad change #

Total comments: 2

Patch Set 9 : kinuko's comment and rebase #

Total comments: 14

Patch Set 10 : creis's comments #

Patch Set 11 : Unittest comments #

Patch Set 12 : more comments #

Patch Set 13 : Removed <limits> #

Patch Set 14 : Remove redundant commnet #

Patch Set 15 : Remove unnecessary <limits> #

Total comments: 4

Patch Set 16 : Rebase #

Patch Set 17 : creis's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+232 lines, -25 lines) Patch
M content/browser/byte_stream.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/byte_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +26 lines, -5 lines 0 comments Download
M content/browser/byte_stream_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +31 lines, -0 lines 0 comments Download
M content/browser/fileapi/fileapi_message_filter.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/fileapi/fileapi_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +8 lines, -14 lines 0 comments Download
M content/browser/streams/stream.h View 1 2 3 4 3 chunks +11 lines, -0 lines 0 comments Download
M content/browser/streams/stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +35 lines, -2 lines 0 comments Download
M content/browser/streams/stream_registry.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +19 lines, -2 lines 0 comments Download
M content/browser/streams/stream_registry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +40 lines, -1 line 0 comments Download
M content/browser/streams/stream_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +55 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
tyoshino (SeeGerritForStatus)
7 years, 4 months ago (2013-08-14 08:17:18 UTC) #1
kinuko
https://codereview.chromium.org/22908008/diff/5001/content/browser/byte_stream.cc File content/browser/byte_stream.cc (right): https://codereview.chromium.org/22908008/diff/5001/content/browser/byte_stream.cc#newcode243 content/browser/byte_stream.cc:243: return input_contents_size_ + output_size_used_; Could this overflow? https://codereview.chromium.org/22908008/diff/5001/content/browser/byte_stream.h File ...
7 years, 4 months ago (2013-08-14 09:32:23 UTC) #2
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/22908008/diff/5001/content/browser/byte_stream.cc File content/browser/byte_stream.cc (right): https://codereview.chromium.org/22908008/diff/5001/content/browser/byte_stream.cc#newcode243 content/browser/byte_stream.cc:243: return input_contents_size_ + output_size_used_; On 2013/08/14 09:32:23, kinuko wrote: ...
7 years, 4 months ago (2013-08-15 04:15:33 UTC) #3
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/22908008/diff/21001/content/browser/byte_stream.cc File content/browser/byte_stream.cc (right): https://codereview.chromium.org/22908008/diff/21001/content/browser/byte_stream.cc#newcode197 content/browser/byte_stream.cc:197: DCHECK(my_task_runner_->RunsTasksOnCurrentThread()); reverted these changes. download code crashes if I ...
7 years, 4 months ago (2013-08-16 11:14:09 UTC) #4
kinuko
lgtm, sorry for the delay. https://codereview.chromium.org/22908008/diff/25002/content/browser/streams/stream_registry.h File content/browser/streams/stream_registry.h (right): https://codereview.chromium.org/22908008/diff/25002/content/browser/streams/stream_registry.h#newcode37 content/browser/streams/stream_registry.h:37: // returns false.. Otherwise, ...
7 years, 4 months ago (2013-08-19 15:30:24 UTC) #5
tyoshino (SeeGerritForStatus)
creis, could you please review this for jam? https://codereview.chromium.org/22908008/diff/25002/content/browser/streams/stream_registry.h File content/browser/streams/stream_registry.h (right): https://codereview.chromium.org/22908008/diff/25002/content/browser/streams/stream_registry.h#newcode37 content/browser/streams/stream_registry.h:37: // ...
7 years, 4 months ago (2013-08-20 07:18:38 UTC) #6
Charlie Reis
Looks mostly fine, but I'm not sure why there's two different limits being used in ...
7 years, 4 months ago (2013-08-20 22:24:52 UTC) #7
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/22908008/diff/39001/content/browser/byte_stream.cc File content/browser/byte_stream.cc (right): https://codereview.chromium.org/22908008/diff/39001/content/browser/byte_stream.cc#newcode215 content/browser/byte_stream.cc:215: output_size_used_ - input_contents_size_; On 2013/08/20 22:24:52, creis wrote: > ...
7 years, 4 months ago (2013-08-21 05:37:28 UTC) #8
Charlie Reis
LGTM with the suggestions below, if there's a reason for ByteStreamWriter and Stream to use ...
7 years, 4 months ago (2013-08-21 19:13:55 UTC) #9
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/22908008/diff/56011/content/browser/byte_stream.cc File content/browser/byte_stream.cc (right): https://codereview.chromium.org/22908008/diff/56011/content/browser/byte_stream.cc#newcode214 content/browser/byte_stream.cc:214: size_t space_limit = std::numeric_limits<size_t>::max() - On 2013/08/21 19:13:56, creis ...
7 years, 4 months ago (2013-08-22 02:19:02 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tyoshino@chromium.org/22908008/70001
7 years, 4 months ago (2013-08-22 02:32:59 UTC) #11
commit-bot: I haz the power
7 years, 4 months ago (2013-08-22 07:43:35 UTC) #12
Message was sent while issue was closed.
Change committed as 218933

Powered by Google App Engine
This is Rietveld 408576698