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

Issue 371057: Fix NSString conversions to treat a null NSString as a string of length 0, in... (Closed)

Created:
11 years, 1 month ago by Miranda Callahan
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, Paweł Hajdan Jr., ben+cc_chromium.org, pam+watch_chromium.org, brettw+cc_chromium.org, pink (ping after 24hrs)
Visibility:
Public.

Description

Fix NSString conversions to treat a null NSString as a string of length 0, instead of crashing. This allows Cocoa to use null objects as empties, as is its wont, and we only run a check when needed. This CL also removes the now-superfluous checks for null NSStrings from BugReportWindowController. A cursory look through the code shows that there are many places where a check for null precedes a call to an NSString conversion; filed another bug against myself to go through and fix all of these (http://code.google.com/p/chromium/issues/detail?id=27055). Also filed a bug to expand unit tests for NSString conversion methods (http://code.google.com/p/chromium/issues/detail?id=27059). BUG= none, but see comments in http://codereview.chromium.org/371012/show TEST= none, but unit tests are included that test changed functionality. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=31408

Patch Set 1 : '' #

Total comments: 4

Patch Set 2 : '' #

Total comments: 2

Patch Set 3 : '' #

Total comments: 10

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -12 lines) Patch
M base/base.gyp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M base/sys_string_conversions.h View 1 chunk +2 lines, -1 line 0 comments Download
M base/sys_string_conversions_mac.mm View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
A base/sys_string_conversions_mac_unittest.mm View 1 2 3 1 chunk +19 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/bug_report_window_controller.mm View 3 chunks +3 lines, -8 lines 0 comments Download
M chrome/browser/cocoa/bug_report_window_controller_unittest.mm View 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Miranda Callahan
The unit test for the NSStringToUTFxxx methods should probably have lots more in it, since ...
11 years, 1 month ago (2009-11-08 00:25:13 UTC) #1
John Grabowski
On 2009/11/08 00:25:13, Miranda Callahan wrote: > The unit test for the NSStringToUTFxxx methods should ...
11 years, 1 month ago (2009-11-08 01:35:32 UTC) #2
John Grabowski
LGTM Thanks for the follow-through here. +cc pink as FYI http://codereview.chromium.org/371057/diff/4002/4005 File base/sys_string_conversions_mac_unittest.mm (right): http://codereview.chromium.org/371057/diff/4002/4005#newcode9 ...
11 years, 1 month ago (2009-11-08 01:36:14 UTC) #3
John Grabowski
Still LGTM but... http://codereview.chromium.org/371057/diff/4002/4005 File base/sys_string_conversions_mac_unittest.mm (right): http://codereview.chromium.org/371057/diff/4002/4005#newcode1 Line 1: // Copyright (c) 2006-2008 The ...
11 years, 1 month ago (2009-11-08 01:37:05 UTC) #4
Miranda Callahan
Thanks for the Saturday afternoon review! http://codereview.chromium.org/371057/diff/4002/4005 File base/sys_string_conversions_mac_unittest.mm (right): http://codereview.chromium.org/371057/diff/4002/4005#newcode1 Line 1: // Copyright ...
11 years, 1 month ago (2009-11-08 01:48:09 UTC) #5
Mark Mentovai
http://codereview.chromium.org/371057/diff/7001/3008 File base/sys_string_conversions_mac.mm (right): http://codereview.chromium.org/371057/diff/7001/3008#newcode26 Line 26: // cfstring could have been initialized with a ...
11 years, 1 month ago (2009-11-08 04:12:50 UTC) #6
mirandac
On Sat, Nov 7, 2009 at 8:12 PM, <mark@chromium.org> wrote: > > http://codereview.chromium.org/371057/diff/7001/3008 > File ...
11 years, 1 month ago (2009-11-08 04:36:27 UTC) #7
Miranda Callahan
Moved null check to the SysNSStringTo wrappers. http://codereview.chromium.org/371057/diff/7001/3008 File base/sys_string_conversions_mac.mm (right): http://codereview.chromium.org/371057/diff/7001/3008#newcode26 Line 26: // ...
11 years, 1 month ago (2009-11-08 17:28:19 UTC) #8
Mark Mentovai
LG otherwise http://codereview.chromium.org/371057/diff/2011/2012 File base/base.gyp (right): http://codereview.chromium.org/371057/diff/2011/2012#newcode623 Line 623: 'sys_string_conversions_mac_unittest.mm', Sort nit: _mac before _unittest. ...
11 years, 1 month ago (2009-11-08 17:34:30 UTC) #9
Mark Mentovai
http://codereview.chromium.org/371057/diff/2011/2013 File base/sys_string_conversions_mac.mm (right): http://codereview.chromium.org/371057/diff/2011/2013#newcode186 Line 186: // Check for nil NSString* to avoid initializing ...
11 years, 1 month ago (2009-11-08 17:49:24 UTC) #10
Miranda Callahan
Addressed comments and added unit tests for each of the wrapper functions individually. http://codereview.chromium.org/371057/diff/2011/2012 File ...
11 years, 1 month ago (2009-11-08 18:21:48 UTC) #11
Mark Mentovai
11 years, 1 month ago (2009-11-08 19:01:42 UTC) #12
LGTM!

Powered by Google App Engine
This is Rietveld 408576698