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

Issue 1044953002: Add a method to read a stream without advancing it. (Closed)

Created:
5 years, 8 months ago by scroggo
Modified:
5 years, 8 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Add a method to read a stream without advancing it. Add a virtual method on SkStream which will do a "peek" some bytes, so that those bytes are read, but the next call to read will be unaffected. Implement peek for SkMemoryStream, where the implementation is simple and obvious. Implement peek on SkFrontBufferedStream. Add tests. Motivated by decoding streams which cannot be rewound. TBR=reed@google.com BUG=skia:3257 Committed: https://skia.googlesource.com/skia/+/028a4135aa6404ccd3a494813befe6e1a35e5e6c

Patch Set 1 #

Total comments: 3

Patch Set 2 : Add error messages for SkStream::peek(). #

Total comments: 3

Patch Set 3 : Use kEnums. #

Total comments: 3

Patch Set 4 : No half measures, Walter. #

Total comments: 5

Patch Set 5 : SkDEBUGCODE; fix a bug #

Patch Set 6 : Stop declaring parameters I do not use. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -0 lines) Patch
M include/core/SkStream.h View 1 2 3 4 5 2 chunks +16 lines, -0 lines 0 comments Download
M src/core/SkStream.cpp View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
M src/utils/SkFrontBufferedStream.cpp View 1 2 3 4 2 chunks +16 lines, -0 lines 0 comments Download
M tests/StreamTest.cpp View 1 2 3 2 chunks +75 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (8 generated)
scroggo
5 years, 8 months ago (2015-03-30 17:17:28 UTC) #2
bungeman-skia
lgtm with possible move of declaration. https://codereview.chromium.org/1044953002/diff/1/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/1044953002/diff/1/include/core/SkStream.h#newcode79 include/core/SkStream.h:79: virtual size_t peek(void* ...
5 years, 8 months ago (2015-03-30 19:09:00 UTC) #3
scroggo
https://codereview.chromium.org/1044953002/diff/1/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/1044953002/diff/1/include/core/SkStream.h#newcode79 include/core/SkStream.h:79: virtual size_t peek(void* buffer, size_t size) { return 0; ...
5 years, 8 months ago (2015-03-30 19:31:50 UTC) #4
djsollen
https://codereview.chromium.org/1044953002/diff/1/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/1044953002/diff/1/include/core/SkStream.h#newcode79 include/core/SkStream.h:79: virtual size_t peek(void* buffer, size_t size) { return 0; ...
5 years, 8 months ago (2015-03-30 19:56:54 UTC) #5
scroggo
On 2015/03/30 19:56:54, djsollen wrote: > https://codereview.chromium.org/1044953002/diff/1/include/core/SkStream.h > File include/core/SkStream.h (right): > > https://codereview.chromium.org/1044953002/diff/1/include/core/SkStream.h#newcode79 > ...
5 years, 8 months ago (2015-03-31 20:14:32 UTC) #6
bungeman-skia
https://codereview.chromium.org/1044953002/diff/20001/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/1044953002/diff/20001/include/core/SkStream.h#newcode70 include/core/SkStream.h:70: static const size_t PEEK_UNSUPPORTED = (size_t) -1; I think ...
5 years, 8 months ago (2015-03-31 22:04:49 UTC) #7
scroggo
https://codereview.chromium.org/1044953002/diff/20001/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/1044953002/diff/20001/include/core/SkStream.h#newcode70 include/core/SkStream.h:70: static const size_t PEEK_UNSUPPORTED = (size_t) -1; On 2015/03/31 ...
5 years, 8 months ago (2015-04-01 18:38:31 UTC) #8
bungeman-skia
PS3 lgtm with possible nits. https://codereview.chromium.org/1044953002/diff/40001/tests/StreamTest.cpp File tests/StreamTest.cpp (right): https://codereview.chromium.org/1044953002/diff/40001/tests/StreamTest.cpp#newcode230 tests/StreamTest.cpp:230: // A stream should ...
5 years, 8 months ago (2015-04-01 19:04:40 UTC) #9
scroggo
https://codereview.chromium.org/1044953002/diff/40001/tests/StreamTest.cpp File tests/StreamTest.cpp (right): https://codereview.chromium.org/1044953002/diff/40001/tests/StreamTest.cpp#newcode237 tests/StreamTest.cpp:237: SkStream* stream) { On 2015/04/01 19:04:40, bungeman1 wrote: > ...
5 years, 8 months ago (2015-04-02 18:04:53 UTC) #10
bungeman-skia
https://codereview.chromium.org/1044953002/diff/60001/src/core/SkStream.cpp File src/core/SkStream.cpp (right): https://codereview.chromium.org/1044953002/diff/60001/src/core/SkStream.cpp#newcode378 src/core/SkStream.cpp:378: #ifdef SK_DEBUG Should this be SkDEBUGCODE(...) instead? Then it ...
5 years, 8 months ago (2015-04-02 18:24:09 UTC) #11
scroggo
https://codereview.chromium.org/1044953002/diff/60001/src/core/SkStream.cpp File src/core/SkStream.cpp (right): https://codereview.chromium.org/1044953002/diff/60001/src/core/SkStream.cpp#newcode378 src/core/SkStream.cpp:378: #ifdef SK_DEBUG On 2015/04/02 18:24:09, bungeman1 wrote: > Should ...
5 years, 8 months ago (2015-04-02 19:49:43 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1044953002/80001
5 years, 8 months ago (2015-04-02 19:50:41 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: Build-Ubuntu-GCC-Arm7-Debug-Android-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android-Trybot/builds/309) Build-Ubuntu-GCC-x86_64-Release-Trybot on client.skia.compile (JOB_FAILED, ...
5 years, 8 months ago (2015-04-02 19:52:57 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1044953002/100001
5 years, 8 months ago (2015-04-02 20:10:18 UTC) #22
commit-bot: I haz the power
5 years, 8 months ago (2015-04-02 20:19:56 UTC) #23
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://skia.googlesource.com/skia/+/028a4135aa6404ccd3a494813befe6e1a35e5e6c

Powered by Google App Engine
This is Rietveld 408576698