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

Issue 985853005: base: Remove operator& from ScopedVariant and ScopedPropVariant. (Closed)

Created:
5 years, 9 months ago by danakj
Modified:
5 years, 9 months ago
CC:
chromium-reviews, jam, je_julie(Not used), plundblad+watch_chromium.org, feature-media-reviews_chromium.org, aboxhall+watch_chromium.org, grt+watch_chromium.org, nektar+watch_chromium.org, mcasas+watch_chromium.org, yuzo+watch_chromium.org, wfh+watch_chromium.org, posciak+watch_chromium.org, darin-cc_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, tfarina, erikwright+watch_chromium.org, wjia+watch_chromium.org, piman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

base: Remove operator& from ScopedVariant and ScopedPropVariant. The operator& is dangerous as it makes code unclear what is happening. For ScopedPropVariant there is already a get() method returning a const& of the internal type. So doing &foo.get() will get a pointer to the internal type. For ScopedVariant, there is only operator&, so replace it with an operator*() that returns a const&. This changes callsites from doing something like V_FOO(&scoper) to V_FOO(&*scoper) which makes it clear that it is getting the address of the thing inside scoper, not the scoper itself. R=Nico BUG=464816 Committed: https://crrev.com/8095bc45b602f704ef85df43f9913f48fbf4cf9c Cr-Commit-Position: refs/heads/master@{#319795}

Patch Set 1 #

Patch Set 2 : scoped-operator: rebase #

Patch Set 3 : scoped-operator: fixbrowsertest #

Patch Set 4 : scoped-operator: ptr() #

Total comments: 2

Patch Set 5 : scoped-operator: prop-ptr #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -74 lines) Patch
M base/win/scoped_propvariant.h View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M base/win/scoped_variant.h View 1 2 3 1 chunk +1 line, -3 lines 0 comments Download
M base/win/scoped_variant_unittest.cc View 1 2 3 4 7 chunks +34 lines, -34 lines 0 comments Download
M chrome/browser/importer/ie_importer_browsertest_win.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/accessibility/navigation_accessibility_uitest_win.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/installer/util/advanced_firewall_manager_win.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/util/wmi.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/accessibility/accessibility_event_recorder_win.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/accessibility/accessibility_win_browsertest.cc View 1 2 3 4 chunks +7 lines, -7 lines 0 comments Download
M media/video/capture/win/video_capture_device_factory_win.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M media/video/capture/win/video_capture_device_win.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ui/accessibility/platform/ax_platform_node_win_unittest.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M ui/views/accessibility/native_view_accessibility_win_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M win8/metro_driver/ime/text_service.cc View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M win8/test/ui_automation_client.cc View 1 2 3 3 chunks +10 lines, -9 lines 0 comments Download

Messages

Total messages: 22 (5 generated)
danakj
+cpu cuz this is windows magic
5 years, 9 months ago (2015-03-07 00:04:32 UTC) #2
dmazzoni
My vote would be to add a get() accessor to ScopedVariant so I can just ...
5 years, 9 months ago (2015-03-09 18:14:51 UTC) #4
danakj
On Mon, Mar 9, 2015 at 11:14 AM, <dmazzoni@chromium.org> wrote: > My vote would be ...
5 years, 9 months ago (2015-03-09 18:27:04 UTC) #5
dmazzoni
On Mon, Mar 9, 2015 at 11:18 AM, Dana Jansens <danakj@chromium.org> wrote: > On Mon, ...
5 years, 9 months ago (2015-03-09 18:27:53 UTC) #6
danakj
On Mon, Mar 9, 2015 at 11:27 AM, Dominic Mazzoni <dmazzoni@chromium.org> wrote: > On Mon, ...
5 years, 9 months ago (2015-03-09 18:37:07 UTC) #7
danakj
PTAL
5 years, 9 months ago (2015-03-09 18:43:53 UTC) #8
dmazzoni
lgtm
5 years, 9 months ago (2015-03-09 20:24:12 UTC) #9
danakj
On 2015/03/09 20:24:12, dmazzoni wrote: > lgtm Nico PTAL
5 years, 9 months ago (2015-03-09 20:57:27 UTC) #10
Nico
win -> cpu, i thought?
5 years, 9 months ago (2015-03-09 21:09:06 UTC) #11
Nico
win -> cpu, i thought?
5 years, 9 months ago (2015-03-09 21:09:07 UTC) #12
Nico
but conceptually lgtm except for one thing: https://codereview.chromium.org/985853005/diff/60001/chrome/browser/importer/ie_importer_browsertest_win.cc File chrome/browser/importer/ie_importer_browsertest_win.cc (right): https://codereview.chromium.org/985853005/diff/60001/chrome/browser/importer/ie_importer_browsertest_win.cc#newcode197 chrome/browser/importer/ie_importer_browsertest_win.cc:197: FAILED(property_storage->WriteMultiple(1, properties, ...
5 years, 9 months ago (2015-03-09 21:11:32 UTC) #13
danakj
On 2015/03/09 21:09:07, Nico wrote: > win -> cpu, i thought? Yep, wanted you to ...
5 years, 9 months ago (2015-03-09 21:44:36 UTC) #15
danakj
On 2015/03/09 21:44:36, danakj wrote: > On 2015/03/09 21:09:07, Nico wrote: > > win -> ...
5 years, 9 months ago (2015-03-09 21:44:58 UTC) #16
cpu_(ooo_6.6-7.5)
lgtm
5 years, 9 months ago (2015-03-09 22:29:05 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/985853005/100001
5 years, 9 months ago (2015-03-09 22:30:23 UTC) #20
commit-bot: I haz the power
Committed patchset #5 (id:100001)
5 years, 9 months ago (2015-03-10 00:41:09 UTC) #21
commit-bot: I haz the power
5 years, 9 months ago (2015-03-10 00:41:52 UTC) #22
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/8095bc45b602f704ef85df43f9913f48fbf4cf9c
Cr-Commit-Position: refs/heads/master@{#319795}

Powered by Google App Engine
This is Rietveld 408576698