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

Issue 8528013: Convert plain C-style casts to use CFCastStrict and GetValueFromDictionary template (Closed)

Created:
9 years, 1 month ago by KushalP
Modified:
9 years, 1 month ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Convert plain C-style casts to use CFCastStrict and GetValueFromDictionary template. These updates keep CF casts between CFTypeRef and specific CoreFoundation types consistent across the project. BUG=104200 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=110173

Patch Set 1 #

Total comments: 4

Patch Set 2 : Fixed alignment. Removed DCHECKs when CFCastStrict is used. #

Patch Set 3 : Line alignment + Switching strict cases to normal. #

Total comments: 7

Patch Set 4 : Add updated GetValueFromDictionary, and update CFCasts #

Total comments: 8

Patch Set 5 : Strict casts, fix DCHECKs, and alignment #

Total comments: 2

Patch Set 6 : Fix DCHECKs #

Total comments: 5

Patch Set 7 : alignment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -27 lines) Patch
M net/proxy/proxy_config_service_mac.cc View 1 2 3 4 4 chunks +10 lines, -14 lines 0 comments Download
M net/proxy/proxy_resolver_mac.cc View 1 2 3 4 5 3 chunks +8 lines, -9 lines 0 comments Download
M net/proxy/proxy_server_mac.cc View 1 2 3 4 5 6 2 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
KushalP
Currently running through the trybots. The win failure is not related to my change and ...
9 years, 1 month ago (2011-11-10 23:55:51 UTC) #1
willchan no longer on Chromium
I don't understand these casts. Mark, can you look? If it's OK with you, then ...
9 years, 1 month ago (2011-11-10 23:59:25 UTC) #2
Ryan Sleevi
drive-by comments http://codereview.chromium.org/8528013/diff/1/net/proxy/proxy_config_service_mac.cc File net/proxy/proxy_config_service_mac.cc (right): http://codereview.chromium.org/8528013/diff/1/net/proxy/proxy_config_service_mac.cc#newcode33 net/proxy/proxy_config_service_mac.cc:33: base::mac::CFCastStrict<CFNumberRef>( nit: You can align this to ...
9 years, 1 month ago (2011-11-11 00:26:42 UTC) #3
KushalP
http://codereview.chromium.org/8528013/diff/1/net/proxy/proxy_config_service_mac.cc File net/proxy/proxy_config_service_mac.cc (right): http://codereview.chromium.org/8528013/diff/1/net/proxy/proxy_config_service_mac.cc#newcode33 net/proxy/proxy_config_service_mac.cc:33: base::mac::CFCastStrict<CFNumberRef>( In the case of GetValueFromDictionary() it should definitely ...
9 years, 1 month ago (2011-11-11 11:03:19 UTC) #4
Ryan Sleevi
http://codereview.chromium.org/8528013/diff/1/net/proxy/proxy_config_service_mac.cc File net/proxy/proxy_config_service_mac.cc (right): http://codereview.chromium.org/8528013/diff/1/net/proxy/proxy_config_service_mac.cc#newcode33 net/proxy/proxy_config_service_mac.cc:33: base::mac::CFCastStrict<CFNumberRef>( On 2011/11/11 11:03:19, KushalP wrote: > In the ...
9 years, 1 month ago (2011-11-11 17:23:11 UTC) #5
Mark Mentovai
http://codereview.chromium.org/8528013/diff/8001/net/proxy/proxy_config_service_mac.cc File net/proxy/proxy_config_service_mac.cc (right): http://codereview.chromium.org/8528013/diff/8001/net/proxy/proxy_config_service_mac.cc#newcode33 net/proxy/proxy_config_service_mac.cc:33: base::mac::GetValueFromDictionary(dict, key, CFNumberGetTypeID())); I would only consider this a ...
9 years, 1 month ago (2011-11-11 17:31:50 UTC) #6
KushalP
Updated with new GetValueFromDictionary and added CHECKs for NULL values.
9 years, 1 month ago (2011-11-15 13:21:11 UTC) #7
Mark Mentovai
http://codereview.chromium.org/8528013/diff/11001/net/proxy/proxy_config_service_mac.cc File net/proxy/proxy_config_service_mac.cc (right): http://codereview.chromium.org/8528013/diff/11001/net/proxy/proxy_config_service_mac.cc#newcode32 net/proxy/proxy_config_service_mac.cc:32: CFNumberRef number = base::mac::GetValueFromDictionary<CFNumberRef>( dict will fit on this ...
9 years, 1 month ago (2011-11-15 14:23:20 UTC) #8
KushalP
http://codereview.chromium.org/8528013/diff/11001/net/proxy/proxy_resolver_mac.cc File net/proxy/proxy_resolver_mac.cc (right): http://codereview.chromium.org/8528013/diff/11001/net/proxy/proxy_resolver_mac.cc#newcode126 net/proxy/proxy_resolver_mac.cc:126: DCHECK(!result); On 2011/11/15 14:23:20, Mark Mentovai wrote: > This ...
9 years, 1 month ago (2011-11-15 15:07:59 UTC) #9
KushalP
Updated with Patch Set 5.
9 years, 1 month ago (2011-11-15 17:04:42 UTC) #10
Mark Mentovai
http://codereview.chromium.org/8528013/diff/11001/net/proxy/proxy_resolver_mac.cc File net/proxy/proxy_resolver_mac.cc (right): http://codereview.chromium.org/8528013/diff/11001/net/proxy/proxy_resolver_mac.cc#newcode135 net/proxy/proxy_resolver_mac.cc:135: DCHECK(!result); KushalP wrote: > Should I also add tests ...
9 years, 1 month ago (2011-11-15 17:35:27 UTC) #11
KushalP
http://codereview.chromium.org/8528013/diff/16001/net/proxy/proxy_resolver_mac.cc File net/proxy/proxy_resolver_mac.cc (right): http://codereview.chromium.org/8528013/diff/16001/net/proxy/proxy_resolver_mac.cc#newcode126 net/proxy/proxy_resolver_mac.cc:126: DCHECK(!result); On 2011/11/15 17:35:28, Mark Mentovai wrote: > I ...
9 years, 1 month ago (2011-11-15 18:52:43 UTC) #12
Mark Mentovai
http://codereview.chromium.org/8528013/diff/15003/net/proxy/proxy_server_mac.cc File net/proxy/proxy_server_mac.cc (right): http://codereview.chromium.org/8528013/diff/15003/net/proxy/proxy_server_mac.cc#newcode27 net/proxy/proxy_server_mac.cc:27: CFStringRef host_ref = base::mac::GetValueFromDictionary<CFStringRef>( Don’t you think that this ...
9 years, 1 month ago (2011-11-15 19:18:20 UTC) #13
KushalP
http://codereview.chromium.org/8528013/diff/15003/net/proxy/proxy_server_mac.cc File net/proxy/proxy_server_mac.cc (right): http://codereview.chromium.org/8528013/diff/15003/net/proxy/proxy_server_mac.cc#newcode27 net/proxy/proxy_server_mac.cc:27: CFStringRef host_ref = base::mac::GetValueFromDictionary<CFStringRef>( On 2011/11/15 19:18:21, Mark Mentovai ...
9 years, 1 month ago (2011-11-15 19:25:59 UTC) #14
KushalP
On 2011/11/15 19:25:59, KushalP wrote: > > I do, but doing so would mean both ...
9 years, 1 month ago (2011-11-15 19:26:50 UTC) #15
Mark Mentovai
http://codereview.chromium.org/8528013/diff/15003/net/proxy/proxy_server_mac.cc File net/proxy/proxy_server_mac.cc (right): http://codereview.chromium.org/8528013/diff/15003/net/proxy/proxy_server_mac.cc#newcode27 net/proxy/proxy_server_mac.cc:27: CFStringRef host_ref = base::mac::GetValueFromDictionary<CFStringRef>( KushalP wrote: > On 2011/11/15 ...
9 years, 1 month ago (2011-11-15 19:40:56 UTC) #16
KushalP
http://codereview.chromium.org/8528013/diff/15003/net/proxy/proxy_server_mac.cc File net/proxy/proxy_server_mac.cc (right): http://codereview.chromium.org/8528013/diff/15003/net/proxy/proxy_server_mac.cc#newcode27 net/proxy/proxy_server_mac.cc:27: CFStringRef host_ref = base::mac::GetValueFromDictionary<CFStringRef>( On 2011/11/15 19:40:56, Mark Mentovai ...
9 years, 1 month ago (2011-11-15 19:57:25 UTC) #17
Mark Mentovai
This one’s good. No extra newlines needed. LGTM and CQ.
9 years, 1 month ago (2011-11-15 20:07:47 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kushi.p@gmail.com/8528013/12007
9 years, 1 month ago (2011-11-15 20:08:20 UTC) #19
commit-bot: I haz the power
Presubmit check for 8528013-12007 failed and returned exit status 1. Running presubmit commit checks ...
9 years, 1 month ago (2011-11-15 20:08:24 UTC) #20
willchan no longer on Chromium
LGTM rubberstamp On Tue, Nov 15, 2011 at 3:08 PM, <commit-bot@chromium.org> wrote: > Presubmit check ...
9 years, 1 month ago (2011-11-15 20:09:22 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kushi.p@gmail.com/8528013/12007
9 years, 1 month ago (2011-11-15 20:09:54 UTC) #22
commit-bot: I haz the power
Change committed as 110173
9 years, 1 month ago (2011-11-15 21:24:53 UTC) #23
wtc
Patch Set 7 LGTM. Thanks. I just have a suggestion below. http://codereview.chromium.org/8528013/diff/8001/net/proxy/proxy_config_service_mac.cc File net/proxy/proxy_config_service_mac.cc (right): ...
9 years, 1 month ago (2011-11-16 06:23:32 UTC) #24
KushalP
On 2011/11/16 06:23:32, wtc wrote: > Patch Set 7 LGTM. Thanks. I just have a ...
9 years, 1 month ago (2011-11-16 09:24:46 UTC) #25
Ryan Sleevi
9 years, 1 month ago (2011-11-16 13:47:27 UTC) #26
On 2011/11/16 09:24:46, KushalP wrote:
> On 2011/11/16 06:23:32, wtc wrote:
> > Patch Set 7 LGTM.  Thanks.  I just have a suggestion below.
> > 
> >
>
http://codereview.chromium.org/8528013/diff/8001/net/proxy/proxy_config_servi...
> > File net/proxy/proxy_config_service_mac.cc (right):
> > 
> >
>
http://codereview.chromium.org/8528013/diff/8001/net/proxy/proxy_config_servi...
> > net/proxy/proxy_config_service_mac.cc:12: #include "base/mac/mac_util.h"
> > 
> > Can you see if we can remove this #include line now?
> 
> Sure. Can that be done as part of this CL or do I need to make a new issue?

Do it as a new CL.

Powered by Google App Engine
This is Rietveld 408576698