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

Issue 423953002: Tidy up app::response(). (Closed)

Created:
6 years, 4 months ago by Tom Sepez
Modified:
6 years, 4 months ago
Reviewers:
jun_fang
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Visibility:
Public.

Description

Tidy up app::response(). Follow-up from https://codereview.chromium.org/424883002/ - Remove some stray whitespace. - Fix "else after return". - Remove unused swResponse local. - Treat unexpectedly large responses as errors. BUG= R=jun_fang@foxitsoftware.com Committed: https://pdfium.googlesource.com/pdfium/+/621d4de

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address comments. #

Total comments: 2

Patch Set 3 : Tolerate out-of-range returns. #

Patch Set 4 : Tolerate out-of-range returns #

Total comments: 1

Patch Set 5 : Search for U+0000. #

Patch Set 6 : Search for U+0000. #

Total comments: 2

Patch Set 7 : Use returned length, update API comment. #

Patch Set 8 : Tabs. #

Patch Set 9 : Wordsmith #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -54 lines) Patch
M fpdfsdk/include/fpdfformfill.h View 1 2 3 4 5 6 7 8 2 chunks +11 lines, -15 lines 0 comments Download
M fpdfsdk/src/javascript/app.cpp View 1 2 3 4 5 6 8 chunks +40 lines, -39 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
Tom Sepez
Jun, please review. Thanks.
6 years, 4 months ago (2014-07-28 19:54:22 UTC) #1
jun_fang
https://codereview.chromium.org/423953002/diff/1/fpdfsdk/src/javascript/app.cpp File fpdfsdk/src/javascript/app.cpp (right): https://codereview.chromium.org/423953002/diff/1/fpdfsdk/src/javascript/app.cpp#newcode1103 fpdfsdk/src/javascript/app.cpp:1103: char* pBuff = new char[nLength]; nLength is the length ...
6 years, 4 months ago (2014-07-29 04:11:31 UTC) #2
Tom Sepez
Thanks. I'll take care of this. https://codereview.chromium.org/423953002/diff/1/fpdfsdk/src/javascript/app.cpp File fpdfsdk/src/javascript/app.cpp (right): https://codereview.chromium.org/423953002/diff/1/fpdfsdk/src/javascript/app.cpp#newcode1103 fpdfsdk/src/javascript/app.cpp:1103: char* pBuff = ...
6 years, 4 months ago (2014-07-29 16:55:57 UTC) #3
jun_fang
https://codereview.chromium.org/423953002/diff/1/fpdfsdk/src/javascript/app.cpp File fpdfsdk/src/javascript/app.cpp (right): https://codereview.chromium.org/423953002/diff/1/fpdfsdk/src/javascript/app.cpp#newcode1103 fpdfsdk/src/javascript/app.cpp:1103: char* pBuff = new char[nLength]; On 2014/07/29 16:55:57, Tom ...
6 years, 4 months ago (2014-07-29 17:31:47 UTC) #4
Tom Sepez
> Strlen depends upon the last char '\0'. That's why I suggest to initialize the ...
6 years, 4 months ago (2014-07-29 17:39:05 UTC) #5
Tom Sepez
Jun, please take a look at PS#2. Thanks.
6 years, 4 months ago (2014-07-29 17:47:25 UTC) #6
jun_fang
On 2014/07/29 17:39:05, Tom Sepez wrote: > > Strlen depends upon the last char '\0'. ...
6 years, 4 months ago (2014-07-29 17:52:13 UTC) #7
jun_fang
https://codereview.chromium.org/423953002/diff/20001/fpdfsdk/src/javascript/app.cpp File fpdfsdk/src/javascript/app.cpp (right): https://codereview.chromium.org/423953002/diff/20001/fpdfsdk/src/javascript/app.cpp#newcode1110 fpdfsdk/src/javascript/app.cpp:1110: if (nLengthBytes <= 0 || nLengthBytes > kMaxInputBytes) I ...
6 years, 4 months ago (2014-07-29 18:03:36 UTC) #8
Tom Sepez
> we should use the actual length of data rather than the returned length. No, ...
6 years, 4 months ago (2014-07-29 18:07:04 UTC) #9
jun_fang
https://codereview.chromium.org/423953002/diff/20001/fpdfsdk/src/javascript/app.cpp File fpdfsdk/src/javascript/app.cpp (right): https://codereview.chromium.org/423953002/diff/20001/fpdfsdk/src/javascript/app.cpp#newcode1103 fpdfsdk/src/javascript/app.cpp:1103: const int kMaxInputBytes = 2048; It's suggested to use ...
6 years, 4 months ago (2014-07-29 18:12:24 UTC) #10
Tom Sepez
> * Return Value: > * Number of bytes the user input text consumes, not ...
6 years, 4 months ago (2014-07-29 18:15:27 UTC) #11
Tom Sepez
If > > the text exceed 2048 bytes, the exceeded part will be ignored. > ...
6 years, 4 months ago (2014-07-29 18:16:19 UTC) #12
Tom Sepez
Ok, I think we're on the same page now. Please take a look at PS#4, ...
6 years, 4 months ago (2014-07-29 18:21:15 UTC) #13
Tom Sepez
On 2014/07/29 18:21:15, Tom Sepez wrote: > Ok, I think we're on the same page ...
6 years, 4 months ago (2014-07-29 18:27:46 UTC) #14
jun_fang
https://codereview.chromium.org/423953002/diff/60001/fpdfsdk/src/javascript/app.cpp File fpdfsdk/src/javascript/app.cpp (right): https://codereview.chromium.org/423953002/diff/60001/fpdfsdk/src/javascript/app.cpp#newcode1106 fpdfsdk/src/javascript/app.cpp:1106: return FALSE; very minor issue here. It's not aligned ...
6 years, 4 months ago (2014-07-29 18:31:31 UTC) #15
Tom Sepez
On 2014/07/29 18:31:31, jun_fang wrote: > https://codereview.chromium.org/423953002/diff/60001/fpdfsdk/src/javascript/app.cpp > File fpdfsdk/src/javascript/app.cpp (right): > > https://codereview.chromium.org/423953002/diff/60001/fpdfsdk/src/javascript/app.cpp#newcode1106 > ...
6 years, 4 months ago (2014-07-29 18:51:32 UTC) #16
Tom Sepez
https://codereview.chromium.org/423953002/diff/90001/fpdfsdk/src/javascript/app.cpp File fpdfsdk/src/javascript/app.cpp (right): https://codereview.chromium.org/423953002/diff/90001/fpdfsdk/src/javascript/app.cpp#newcode1111 fpdfsdk/src/javascript/app.cpp:1111: if (nLengthBytes <= 0) hmm. Just noticed this. Why ...
6 years, 4 months ago (2014-07-29 18:53:37 UTC) #17
jun_fang
On 2014/07/29 18:27:46, Tom Sepez wrote: > On 2014/07/29 18:21:15, Tom Sepez wrote: > > ...
6 years, 4 months ago (2014-07-29 18:53:48 UTC) #18
jun_fang
https://codereview.chromium.org/423953002/diff/90001/fpdfsdk/src/javascript/app.cpp File fpdfsdk/src/javascript/app.cpp (right): https://codereview.chromium.org/423953002/diff/90001/fpdfsdk/src/javascript/app.cpp#newcode1111 fpdfsdk/src/javascript/app.cpp:1111: if (nLengthBytes <= 0) On 2014/07/29 18:53:37, Tom Sepez ...
6 years, 4 months ago (2014-07-29 19:03:17 UTC) #19
Tom Sepez
> 'response' is pointed to the buffer that receives the user's answer.According to > the ...
6 years, 4 months ago (2014-07-29 19:04:19 UTC) #20
jun_fang
On 2014/07/29 19:04:19, Tom Sepez wrote: > > 'response' is pointed to the buffer that ...
6 years, 4 months ago (2014-07-29 19:15:14 UTC) #21
Tom Sepez
> If the user types 2052 bytes, |response| will keep 2048 bytes. The app_response > ...
6 years, 4 months ago (2014-07-29 19:17:02 UTC) #22
jun_fang
On 2014/07/29 19:17:02, Tom Sepez wrote: > > If the user types 2052 bytes, |response| ...
6 years, 4 months ago (2014-07-29 19:28:58 UTC) #23
Tom Sepez
> I agree to remove it. Excellent. So which do you prefer, PS#6 or PS#4?
6 years, 4 months ago (2014-07-29 19:32:33 UTC) #24
jun_fang
On 2014/07/29 19:32:33, Tom Sepez wrote: > > I agree to remove it. > Excellent. ...
6 years, 4 months ago (2014-07-29 19:55:52 UTC) #25
Tom Sepez
Ok, please review.
6 years, 4 months ago (2014-07-29 20:25:53 UTC) #26
jun_fang
On 2014/07/29 20:25:53, Tom Sepez wrote: > Ok, please review. Thanks. LGTM
6 years, 4 months ago (2014-07-29 20:34:35 UTC) #27
Tom Sepez
6 years, 4 months ago (2014-07-29 21:01:25 UTC) #28
Message was sent while issue was closed.
Committed patchset #9 manually as r621d4de (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698