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

Issue 6542069: Add an encoder/decoder for quoted-printable. (Closed)

Created:
9 years, 10 months ago by Jay Civelli
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org
Visibility:
Public.

Description

Adds a way to encode/decode quoted-printable strings. This is going to be used for MHTML support. BUG=30863 TEST=Run the unit-tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=76273

Patch Set 1 #

Patch Set 2 : Clean-up #

Patch Set 3 : Any EOL is now encoded to CRLF. #

Patch Set 4 : Moving code from base to chrome/browser/net #

Total comments: 16

Patch Set 5 : Addressed reviewers' comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+376 lines, -0 lines) Patch
A chrome/browser/net/quoted_printable.h View 1 2 3 4 1 chunk +35 lines, -0 lines 0 comments Download
A chrome/browser/net/quoted_printable.cc View 1 2 3 4 1 chunk +132 lines, -0 lines 0 comments Download
A chrome/browser/net/quoted_printable_unittest.cc View 1 2 3 4 1 chunk +206 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Jay Civelli
9 years, 10 months ago (2011-02-22 23:01:14 UTC) #1
Avi (use Gerrit)
If you're writing code to implement the bug, can you switch the bug from unconfirmed? ...
9 years, 10 months ago (2011-02-22 23:09:51 UTC) #2
Avi (use Gerrit)
If you're writing code to implement the bug, can you switch the bug from unconfirmed? ...
9 years, 10 months ago (2011-02-22 23:10:46 UTC) #3
brettw
This doesn't really sound like something that should be in base. Does it need to ...
9 years, 10 months ago (2011-02-25 03:05:25 UTC) #4
Jay Civelli
On 2011/02/25 03:05:25, brettw wrote: > This doesn't really sound like something that should be ...
9 years, 9 months ago (2011-02-28 06:23:27 UTC) #5
brettw
On Sun, Feb 27, 2011 at 10:23 PM, <jcivelli@chromium.org> wrote: > On 2011/02/25 03:05:25, brettw ...
9 years, 9 months ago (2011-02-28 06:32:41 UTC) #6
Jay Civelli
On 2011/02/28 06:32:41, brettw wrote: > On Sun, Feb 27, 2011 at 10:23 PM, <mailto:jcivelli@chromium.org> ...
9 years, 9 months ago (2011-02-28 17:20:37 UTC) #7
brettw
LGTM http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_printable.cc File chrome/browser/net/quoted_printable.cc (right): http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_printable.cc#newcode20 chrome/browser/net/quoted_printable.cc:20: int HexASCIICharToInt(char c) { You should be able ...
9 years, 9 months ago (2011-02-28 17:33:14 UTC) #8
tfarina
http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_printable.cc File chrome/browser/net/quoted_printable.cc (right): http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_printable.cc#newcode47 chrome/browser/net/quoted_printable.cc:47: if (c >= 33 && c <= 126 && ...
9 years, 9 months ago (2011-02-28 18:32:44 UTC) #9
tfarina
http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_printable.cc File chrome/browser/net/quoted_printable.cc (right): http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_printable.cc#newcode14 chrome/browser/net/quoted_printable.cc:14: const char kHexTable[] = { You can simplify this ...
9 years, 9 months ago (2011-02-28 18:38:20 UTC) #10
Jay Civelli
9 years, 9 months ago (2011-02-28 19:25:53 UTC) #11
All comments addressed.

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
File chrome/browser/net/quoted_printable.cc (right):

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
chrome/browser/net/quoted_printable.cc:14: const char kHexTable[] = {
On 2011/02/28 18:38:21, tfarina wrote:
> You can simplify this as:
> 
> const char kHexTable[] = "0123456789ABCDEF";

Done.

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
chrome/browser/net/quoted_printable.cc:20: int HexASCIICharToInt(char c) {
On 2011/02/28 17:33:14, brettw wrote:
> You should be able to use HexDigitToInt in string_util instead of writing
this.

Done.

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
chrome/browser/net/quoted_printable.cc:41: iter!= input.end(); ++iter) {
On 2011/02/28 17:33:14, brettw wrote:
> Space before the !

Done.

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
chrome/browser/net/quoted_printable.cc:47: if (c >= 33 && c <= 126 && c != 61) {
On 2011/02/28 18:32:44, tfarina wrote:
> Is there a reason for not using the letters instead? I think they will make
the
> code more easy to read. Same thing for the other occurrences below.

Done.

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
chrome/browser/net/quoted_printable.cc:125: char r = static_cast<char>((i1 << 4
& 0xF0) | (i2 &0x0F));
On 2011/02/28 17:33:14, brettw wrote:
> Can you use an extra set of parens around the first part, I'm not sure of the
> order pf operations for << and &.
> 
> Space after the second &

Done.

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
File chrome/browser/net/quoted_printable.h (right):

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
chrome/browser/net/quoted_printable.h:14: namespace chrome_browser_net {
On 2011/02/28 17:33:14, brettw wrote:
> We're trying to standardize on using nested namespaces. Although this doesn't
> match the existing code, I'd prefer doin the new way, so this would be
> namespace chrome {
> namespace browser {
> namespace net {

Done.

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
chrome/browser/net/quoted_printable.h:27: int IsEOL(const
std::string::const_iterator& iter, const std::string& input);
On 2011/02/28 18:32:44, tfarina wrote:
> Is this going to be used by the consumers (i.e is this part of the public API
as
> the two functions above)? If not, can you move this to the source file? 
As the comment mentions, this is also used by the unit-tests, this is why it is
exposed.

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
File chrome/browser/net/quoted_printable_unittest.cc (right):

http://codereview.chromium.org/6542069/diff/15001/chrome/browser/net/quoted_p...
chrome/browser/net/quoted_printable_unittest.cc:76:
"=0E=0F=10=11=12=13=14=15=16=17=18=19=1A=1B=1C=1D=1E=1F !\"#$%&'()*+,-./01234="
On 2011/02/28 17:33:14, brettw wrote:
> Looks like these are too long.

Done.

Powered by Google App Engine
This is Rietveld 408576698