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

Issue 3781009: Move the windows-specific scoped_* stuff from base to base/win and in the bas... (Closed)

Created:
10 years, 2 months ago by brettw
Modified:
9 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, Paweł Hajdan Jr., darin-cc_chromium.org, amit, brettw-cc_chromium.org
Visibility:
Public.

Description

Move the windows-specific scoped_* stuff from base to base/win and in the base::win namespace. This keeps old headers that forward to the new versions and have using declarations that allow the existing code to compile. I fixed all the callers in base to use the new ones, and also the other files I happened to touch. This splits out the stuff from scoped_handle into a few separate files. I just deleted ScopedFindFile since it was only used in one place and it wasn't even really helping there. I removed StackBstr which was a #define and used the "regular" ScopedBstr in the 7 places that used it. This is an optimization to avoid an extra allocation, but none of the callers are remotely performance critical. TEST=it compiles BUG=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=62843

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+240 lines, -2380 lines) Patch
M app/win_util.h View 1 chunk +0 lines, -1 line 0 comments Download
M base/base.gyp View 3 chunks +6 lines, -3 lines 0 comments Download
M base/base.gypi View 3 chunks +9 lines, -6 lines 0 comments Download
M base/file_util_win.cc View 12 chunks +28 lines, -28 lines 0 comments Download
M base/process_util_win.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M base/scoped_bstr_win.h View 1 chunk +5 lines, -138 lines 0 comments Download
D base/scoped_bstr_win.cc View 1 chunk +0 lines, -66 lines 0 comments Download
D base/scoped_bstr_win_unittest.cc View 1 chunk +0 lines, -93 lines 0 comments Download
M base/scoped_comptr_win.h View 1 chunk +5 lines, -155 lines 0 comments Download
D base/scoped_comptr_win_unittest.cc View 1 chunk +0 lines, -107 lines 0 comments Download
M base/scoped_handle_win.h View 1 chunk +15 lines, -233 lines 0 comments Download
M base/scoped_variant_win.h View 1 chunk +4 lines, -156 lines 0 comments Download
D base/scoped_variant_win.cc View 1 chunk +0 lines, -270 lines 0 comments Download
D base/scoped_variant_win_unittest.cc View 1 chunk +0 lines, -257 lines 0 comments Download
A + base/win/scoped_bstr.h View 5 chunks +28 lines, -73 lines 0 comments Download
A + base/win/scoped_bstr.cc View 2 chunks +14 lines, -9 lines 0 comments Download
A + base/win/scoped_bstr_unittest.cc View 2 chunks +6 lines, -22 lines 0 comments Download
A + base/win/scoped_comptr.h View 4 chunks +18 lines, -12 lines 1 comment Download
A + base/win/scoped_comptr_unittest.cc View 1 2 chunks +7 lines, -1 line 0 comments Download
A + base/win/scoped_gdi_object.h View 3 chunks +7 lines, -167 lines 0 comments Download
A + base/win/scoped_handle.h View 3 chunks +7 lines, -155 lines 0 comments Download
A + base/win/scoped_hdc.h View 2 chunks +7 lines, -190 lines 0 comments Download
A + base/win/scoped_hglobal.h View 2 chunks +8 lines, -193 lines 0 comments Download
A + base/win/scoped_variant.h View 2 chunks +9 lines, -4 lines 0 comments Download
A + base/win/scoped_variant.cc View 2 chunks +7 lines, -1 line 0 comments Download
A + base/win/scoped_variant_unittest.cc View 2 chunks +7 lines, -1 line 0 comments Download
M chrome/installer/util/wmi.cc View 5 chunks +18 lines, -17 lines 1 comment Download
M chrome_frame/chrome_frame_activex.cc View 10 chunks +17 lines, -15 lines 0 comments Download
M net/disk_cache/cache_util_win.cc View 3 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
brettw
I'm thinking this might be a good template for future moves.
10 years, 2 months ago (2010-10-15 03:09:40 UTC) #1
darin (slow to review)
http://codereview.chromium.org/3781009/diff/25001/26018 File base/win/scoped_comptr.h (right): http://codereview.chromium.org/3781009/diff/25001/26018#newcode25 base/win/scoped_comptr.h:25: template <class Interface> this does not need the template ...
10 years, 2 months ago (2010-10-15 05:58:11 UTC) #2
brettw
On Thu, Oct 14, 2010 at 10:58 PM, <darin@chromium.org> wrote: > > http://codereview.chromium.org/3781009/diff/25001/26018 > File ...
10 years, 2 months ago (2010-10-15 06:47:03 UTC) #3
darin (slow to review)
10 years, 2 months ago (2010-10-15 07:08:16 UTC) #4
On Thu, Oct 14, 2010 at 11:46 PM, Brett Wilson <brettw@chromium.org> wrote:

> On Thu, Oct 14, 2010 at 10:58 PM,  <darin@chromium.org> wrote:
> >
> > http://codereview.chromium.org/3781009/diff/25001/26018
> > File base/win/scoped_comptr.h (right):
> >
> > http://codereview.chromium.org/3781009/diff/25001/26018#newcode25
> > base/win/scoped_comptr.h:25: template <class Interface>
> > this does not need the template prefix since it is an inner class now
> > and it can just pick up Interface from ScopedComPtr.
> >
> > http://codereview.chromium.org/3781009/diff/25001/26027
> > File chrome/installer/util/wmi.cc (right):
> >
> > http://codereview.chromium.org/3781009/diff/25001/26027#newcode118
> > chrome/installer/util/wmi.cc:118:
> > base::win::ScopedComPtr<IWbemClassObject> process_create;
> > the base::win:: is actually a bit obnoxious in windows specific files.
> > when i'm in such a source file, or within an OS_WIN define, i would
> > never use base::(other_platform)::, so why do i need to say base::win::?
> >  maybe the "win" namespace is not so helpful?
>
> I agree in this case it's a bit redundant. On the other hand
> ScopedHandle is really much better with win on it, especially since
> there's *another* ScopedHandle in base (for stdio-type handles). I
> don't have a better answer other than to be consistent.
>
> Brett
>


OK (LGTM w/ the other one nit fixed)

-Darin

Powered by Google App Engine
This is Rietveld 408576698