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

Issue 157593005: Added new ReadFileToString API with a max_size argument (Closed)

Created:
6 years, 10 months ago by kaliamoorthi
Modified:
6 years, 10 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, bartfab (slow)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Added new ReadFileToString API with a max_size argument The CL creates a new API that takes a max_size argument. When the file size exceed the max_size, the API primes the cache and returns false. BUG=339417 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251771

Patch Set 1 #

Total comments: 26

Patch Set 2 : Added new ReadFileToString API with a max_size argument #

Patch Set 3 : Added new ReadFileToString API with a max_size argument #

Total comments: 7

Patch Set 4 : Added new ReadFileToString API with a max_size argument #

Total comments: 18

Patch Set 5 : Added new ReadFileToString API with a max_size argument #

Patch Set 6 : Added new ReadFileToString API with a max_size argument #

Patch Set 7 : Added new ReadFileToString API with a max_size argument #

Total comments: 4

Patch Set 8 : Added new ReadFileToString API with a max_size argument #

Total comments: 6

Patch Set 9 : Added new ReadFileToString API with a max_size argument #

Total comments: 2

Patch Set 10 : Added new ReadFileToString API with a max_size argument #

Total comments: 4

Patch Set 11 : Added new ReadFileToString API with a max_size argument #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -5 lines) Patch
M base/file_util.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +16 lines, -2 lines 4 comments Download
M base/file_util.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +24 lines, -3 lines 0 comments Download
M base/file_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +45 lines, -0 lines 2 comments Download

Messages

Total messages: 28 (0 generated)
kaliamoorthi
6 years, 10 months ago (2014-02-07 17:55:12 UTC) #1
kaliamoorthi
Can you please review this CL.
6 years, 10 months ago (2014-02-10 13:49:15 UTC) #2
Andrew T Wilson (Slow)
This is pretty close - good work! Please edit the bug description to be more ...
6 years, 10 months ago (2014-02-10 14:29:46 UTC) #3
kaliamoorthi
The CQ bit was unchecked by kaliamoorthi@chromium.org
6 years, 10 months ago (2014-02-10 14:36:12 UTC) #4
kaliamoorthi
The CQ bit was checked by kaliamoorthi@chromium.org
6 years, 10 months ago (2014-02-10 14:36:12 UTC) #5
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-10 14:37:00 UTC) #6
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
6 years, 10 months ago (2014-02-10 14:37:03 UTC) #7
bartfab (slow)
https://codereview.chromium.org/157593005/diff/1/base/file_util.cc File base/file_util.cc (right): https://codereview.chromium.org/157593005/diff/1/base/file_util.cc#newcode130 base/file_util.cc:130: bool checkSz, size_t maxsize) { On 2014/02/10 14:29:46, Andrew ...
6 years, 10 months ago (2014-02-10 14:55:37 UTC) #8
kaliamoorthi
PTAL https://codereview.chromium.org/157593005/diff/1/base/file_util.cc File base/file_util.cc (right): https://codereview.chromium.org/157593005/diff/1/base/file_util.cc#newcode130 base/file_util.cc:130: bool checkSz, size_t maxsize) { On 2014/02/10 14:55:37, ...
6 years, 10 months ago (2014-02-11 10:10:44 UTC) #9
Andrew T Wilson (Slow)
https://codereview.chromium.org/157593005/diff/390001/base/file_util.cc File base/file_util.cc (right): https://codereview.chromium.org/157593005/diff/390001/base/file_util.cc#newcode168 base/file_util.cc:168: return ReadFileToStringImpl(path, contents, ~(size_t)0); Can you use SIZE_MAX here ...
6 years, 10 months ago (2014-02-11 10:27:08 UTC) #10
bartfab (slow)
https://codereview.chromium.org/157593005/diff/460001/base/file_util.cc File base/file_util.cc (right): https://codereview.chromium.org/157593005/diff/460001/base/file_util.cc#newcode130 base/file_util.cc:130: std::string* contents, Nit: Align the arguments. https://codereview.chromium.org/157593005/diff/460001/base/file_util.cc#newcode143 base/file_util.cc:143: // ...
6 years, 10 months ago (2014-02-11 12:51:12 UTC) #11
kaliamoorthi
PTAL https://codereview.chromium.org/157593005/diff/390001/base/file_util.cc File base/file_util.cc (right): https://codereview.chromium.org/157593005/diff/390001/base/file_util.cc#newcode168 base/file_util.cc:168: return ReadFileToStringImpl(path, contents, ~(size_t)0); On 2014/02/11 10:27:12, Andrew ...
6 years, 10 months ago (2014-02-11 16:29:15 UTC) #12
Andrew T Wilson (Slow)
lgtm
6 years, 10 months ago (2014-02-12 15:13:10 UTC) #13
kaliamoorthi
Hi Brett, Can you please do a owner review.
6 years, 10 months ago (2014-02-12 16:14:58 UTC) #14
bartfab (slow)
lgtm https://codereview.chromium.org/157593005/diff/460003/base/file_util.cc File base/file_util.cc (right): https://codereview.chromium.org/157593005/diff/460003/base/file_util.cc#newcode144 base/file_util.cc:144: // Many files supplied in path have incorrect ...
6 years, 10 months ago (2014-02-12 16:27:10 UTC) #15
brettw
Can you provide more reason for wanting thsi in the CL description or bug? Like, ...
6 years, 10 months ago (2014-02-13 18:54:58 UTC) #16
Andrew T Wilson (Slow)
On 2014/02/13 18:54:58, brettw wrote: > Can you provide more reason for wanting thsi in ...
6 years, 10 months ago (2014-02-14 10:48:25 UTC) #17
brettw
Looking at this function signature, I'd expect somewhat different behavior than it's doing. If the ...
6 years, 10 months ago (2014-02-14 19:03:08 UTC) #18
kaliamoorthi
Hi Bret, > Looking at this function signature, I'd expect somewhat different behavior than > ...
6 years, 10 months ago (2014-02-17 11:09:26 UTC) #19
kaliamoorthi
PTAL https://codereview.chromium.org/157593005/diff/460003/base/file_util.cc File base/file_util.cc (right): https://codereview.chromium.org/157593005/diff/460003/base/file_util.cc#newcode144 base/file_util.cc:144: // Many files supplied in path have incorrect ...
6 years, 10 months ago (2014-02-17 11:09:41 UTC) #20
Andrew T Wilson (Slow)
I'm not sure if changing the behavior of ReadFileToString() from its current behavior of appending ...
6 years, 10 months ago (2014-02-17 14:38:22 UTC) #21
bartfab (slow)
https://codereview.chromium.org/157593005/diff/710001/base/file_util_unittest.cc File base/file_util_unittest.cc (right): https://codereview.chromium.org/157593005/diff/710001/base/file_util_unittest.cc#newcode1965 base/file_util_unittest.cc:1965: EXPECT_FALSE(ReadFileToString(file_path, &data)); Nit: Check the contents of |data| using ...
6 years, 10 months ago (2014-02-17 15:25:55 UTC) #22
brettw
LGTM. I doubt the appending behavior of the current function was intended. I went through ...
6 years, 10 months ago (2014-02-18 05:24:33 UTC) #23
kaliamoorthi
Made a few final changes to address review comments. https://codereview.chromium.org/157593005/diff/640001/base/file_util.cc File base/file_util.cc (right): https://codereview.chromium.org/157593005/diff/640001/base/file_util.cc#newcode133 base/file_util.cc:133: ...
6 years, 10 months ago (2014-02-18 11:50:49 UTC) #24
kaliamoorthi
The CQ bit was checked by kaliamoorthi@chromium.org
6 years, 10 months ago (2014-02-18 12:08:00 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kaliamoorthi@chromium.org/157593005/880001
6 years, 10 months ago (2014-02-18 12:08:08 UTC) #26
bartfab (slow)
https://codereview.chromium.org/157593005/diff/880001/base/file_util.h File base/file_util.h (right): https://codereview.chromium.org/157593005/diff/880001/base/file_util.h#newcode136 base/file_util.h:136: // side effect of priming the disk cache, which ...
6 years, 10 months ago (2014-02-18 14:56:51 UTC) #27
commit-bot: I haz the power
6 years, 10 months ago (2014-02-18 16:31:55 UTC) #28
Message was sent while issue was closed.
Change committed as 251771

Powered by Google App Engine
This is Rietveld 408576698