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

Issue 1337823003: Cleanup JBig2_GeneralDecoder.cpp. (Closed)

Created:
5 years, 3 months ago by Lei Zhang
Modified:
5 years, 3 months ago
Reviewers:
Tom Sepez
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Cleanup JBig2_GeneralDecoder.cpp. - FX_Alloc() can't fail and return. - Use unique_ptr / remove gotos. - NULL -> nullptr. - Combine common code. R=tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/d15cda90f598ce52fa601552577ef7fd8a89fce3

Patch Set 1 : FX_Alloc() can't fail and return, unique_ptr #

Total comments: 7

Patch Set 2 : nullptr #

Patch Set 3 : more unique_ptr #

Total comments: 2

Patch Set 4 : common code #

Total comments: 3

Patch Set 5 : lint #

Total comments: 1

Patch Set 6 : address comments #

Patch Set 7 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+368 lines, -464 lines) Patch
M core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp View 1 2 3 4 5 92 chunks +364 lines, -464 lines 0 comments Download

Messages

Total messages: 10 (1 generated)
Lei Zhang
Each patch set is (mostly) one mechanical step. So it's more obvious how we arrived ...
5 years, 3 months ago (2015-09-11 23:16:14 UTC) #2
Tom Sepez
This is for PS#1 https://codereview.chromium.org/1337823003/diff/1/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp File core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp (right): https://codereview.chromium.org/1337823003/diff/1/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp#newcode166 core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp:166: nonstd::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH)); Didn't ...
5 years, 3 months ago (2015-09-11 23:36:21 UTC) #3
Tom Sepez
PS#2 diffs OK.
5 years, 3 months ago (2015-09-11 23:38:38 UTC) #4
Tom Sepez
This is PS#3 https://codereview.chromium.org/1337823003/diff/40001/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp File core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp (right): https://codereview.chromium.org/1337823003/diff/40001/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp#newcode1540 core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp:1540: nonstd::unique_ptr<CJBig2_ArithIntDecoder> IADH(new CJBig2_ArithIntDecoder()); nit: if you ...
5 years, 3 months ago (2015-09-11 23:41:40 UTC) #5
Tom Sepez
PS#4 https://codereview.chromium.org/1337823003/diff/60001/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp File core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp (right): https://codereview.chromium.org/1337823003/diff/60001/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp#newcode37 core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp:37: return (GBAT[0] == 3) && (GBAT[1] == -1) ...
5 years, 3 months ago (2015-09-11 23:46:03 UTC) #6
Tom Sepez
PS#5 OK https://codereview.chromium.org/1337823003/diff/80001/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp File core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp (right): https://codereview.chromium.org/1337823003/diff/80001/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp#newcode791 core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp:791: if (line3_r_ok) { yeah, much better!
5 years, 3 months ago (2015-09-11 23:46:59 UTC) #7
Lei Zhang
https://codereview.chromium.org/1337823003/diff/1/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp File core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp (right): https://codereview.chromium.org/1337823003/diff/1/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp#newcode166 core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp:166: nonstd::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH)); On 2015/09/11 23:36:21, Tom Sepez ...
5 years, 3 months ago (2015-09-12 01:19:28 UTC) #8
Tom Sepez
LGTM. > b) Someday when we have a nicer unique_ptr, we can return > nonstd::unique_ptr<CJBig2_Image> ...
5 years, 3 months ago (2015-09-14 16:58:43 UTC) #9
Lei Zhang
5 years, 3 months ago (2015-09-15 08:12:58 UTC) #10
Message was sent while issue was closed.
Committed patchset #7 (id:110001) manually as
d15cda90f598ce52fa601552577ef7fd8a89fce3 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698