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

Issue 1340683002: Remove base's implicit_cast. (Closed)

Created:
5 years, 3 months ago by danakj
Modified:
5 years, 3 months ago
CC:
chromium-reviews, tapted, cbentzel+watch_chromium.org, Matt Giuca, tfarina, jam, gavinp+memory_chromium.org, nhiroki, darin-cc_chromium.org, jkarlin+watch_chromium.org, android-webview-reviews_chromium.org, gavinp+disk_chromium.org, piman, Mark Mentovai, scottmg
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove base's implicit_cast. There's no momentum on making this a thing in the C++ standard. We should have less magic that is non-standard in base. R=ricea@chromium.org, thakis@chromium.org, vmpstr BUG=529769 Committed: https://crrev.com/a5f0d96bc4f40971fc82e0b2255e27056d4621d1 Cr-Commit-Position: refs/heads/master@{#348978}

Patch Set 1 #

Total comments: 14

Patch Set 2 : implicitcast: fixedstaticcast #

Patch Set 3 : implicitcast: const_cast #

Patch Set 4 : implicitcast: . #

Total comments: 6

Patch Set 5 : implicitcast: netcheckedcasts #

Total comments: 3

Patch Set 6 : implicitcast: morecheckedcast #

Total comments: 2

Patch Set 7 : implicitcast: . #

Patch Set 8 : implicitcast: numericstest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -89 lines) Patch
M android_webview/native/aw_contents.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/android/scoped_java_ref.h View 1 3 chunks +5 lines, -2 lines 0 comments Download
M base/files/file_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/macros.h View 1 chunk +0 lines, -23 lines 0 comments Download
M base/memory/scoped_ptr.h View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M base/numerics/safe_numerics_unittest.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/apps/app_shim/app_shim_host_mac_unittest.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc View 1 chunk +1 line, -2 lines 0 comments Download
M components/history/core/browser/history_backend.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M components/history/core/browser/visitsegment_database.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/cache_storage/cache_storage.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M net/disk_cache/backend_unittest.cc View 4 chunks +6 lines, -8 lines 0 comments Download
M net/disk_cache/entry_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/disk_cache/simple/simple_index_file.cc View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M net/disk_cache/simple/simple_index_file_unittest.cc View 2 chunks +4 lines, -6 lines 0 comments Download
M net/disk_cache/simple/simple_synchronous_entry.cc View 1 2 3 4 5 5 chunks +5 lines, -5 lines 0 comments Download
M net/disk_cache/simple/simple_version_upgrade_unittest.cc View 5 chunks +13 lines, -14 lines 0 comments Download
M net/tools/flip_server/url_utilities_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/tools/quic/quic_client_session_test.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/base/page_transition_types.cc View 1 2 3 4 5 1 chunk +3 lines, -4 lines 0 comments Download
M ui/views/style/mac/dialog_button_border_mac_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 51 (16 generated)
danakj
https://codereview.chromium.org/1340683002/diff/1/base/android/scoped_java_ref.h File base/android/scoped_java_ref.h (left): https://codereview.chromium.org/1340683002/diff/1/base/android/scoped_java_ref.h#oldcode181 base/android/scoped_java_ref.h:181: implicit_cast<T>(obj); // Ensure U is assignable to T This ...
5 years, 3 months ago (2015-09-11 20:44:21 UTC) #1
Nico
lgtm (thanks!), but a few questions: https://codereview.chromium.org/1340683002/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1340683002/diff/1/base/memory/scoped_ptr.h#newcode470 base/memory/scoped_ptr.h:470: // NOT use ...
5 years, 3 months ago (2015-09-11 20:53:55 UTC) #2
danakj
https://codereview.chromium.org/1340683002/diff/1/chrome/browser/apps/app_shim/app_shim_host_mac_unittest.cc File chrome/browser/apps/app_shim/app_shim_host_mac_unittest.cc (right): https://codereview.chromium.org/1340683002/diff/1/chrome/browser/apps/app_shim/app_shim_host_mac_unittest.cc#newcode81 chrome/browser/apps/app_shim/app_shim_host_mac_unittest.cc:81: static_cast<IPC::Listener*>(host_.release())->OnChannelError(); On 2015/09/11 20:53:55, Nico wrote: > On 2015/09/11 ...
5 years, 3 months ago (2015-09-11 20:56:16 UTC) #3
vmpstr
There's a bunch of places that have potential truncation I think. It might help to ...
5 years, 3 months ago (2015-09-11 21:00:49 UTC) #4
danakj
Thanks! PTAL https://codereview.chromium.org/1340683002/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1340683002/diff/1/base/memory/scoped_ptr.h#newcode470 base/memory/scoped_ptr.h:470: // NOT use static_cast<Base*>() to upcast the ...
5 years, 3 months ago (2015-09-11 21:20:28 UTC) #5
danakj
+sky for components/history and ui/ OWNERS +jsbell for content/browser/cache_storage OWNERS +rsleevi for net/ OWNERS
5 years, 3 months ago (2015-09-11 21:31:05 UTC) #7
vmpstr
There are a few more, but I think some are ok like static_cast<int>(sizeof(foo)) Your call ...
5 years, 3 months ago (2015-09-11 21:31:16 UTC) #9
danakj
On 2015/09/11 21:00:49, vmpstr wrote: > There's a bunch of places that have potential truncation ...
5 years, 3 months ago (2015-09-11 21:31:52 UTC) #10
danakj
https://codereview.chromium.org/1340683002/diff/60001/net/disk_cache/simple/simple_index_file.cc File net/disk_cache/simple/simple_index_file.cc (right): https://codereview.chromium.org/1340683002/diff/60001/net/disk_cache/simple/simple_index_file.cc#newcode80 net/disk_cache/simple/simple_index_file.cc:80: if (bytes_written != static_cast<int>(pickle->size())) { On 2015/09/11 21:31:16, vmpstr ...
5 years, 3 months ago (2015-09-11 21:33:30 UTC) #11
vmpstr
https://codereview.chromium.org/1340683002/diff/80001/ui/views/style/mac/dialog_button_border_mac_unittest.cc File ui/views/style/mac/dialog_button_border_mac_unittest.cc (right): https://codereview.chromium.org/1340683002/diff/80001/ui/views/style/mac/dialog_button_border_mac_unittest.cc#newcode66 ui/views/style/mac/dialog_button_border_mac_unittest.cc:66: EXPECT_EQ(static_cast<SkColor>(SK_ColorTRANSPARENT), initial_pixel); On 2015/09/11 21:33:30, danakj wrote: > On ...
5 years, 3 months ago (2015-09-11 21:34:36 UTC) #12
Ryan Sleevi
net LGTM
5 years, 3 months ago (2015-09-11 21:34:44 UTC) #14
sky
LGTM
5 years, 3 months ago (2015-09-11 21:58:58 UTC) #16
jsbell
content/browser/cache_storage lgtm
5 years, 3 months ago (2015-09-11 22:13:08 UTC) #18
boliu
android_webview lgtm
5 years, 3 months ago (2015-09-11 23:12:24 UTC) #20
danakj
Aw, crash pad is using this from base apparently: ../../third_party/crashpad/crashpad/util/file/file_writer.cc:76:36:error: use of undeclared identifier 'implicit_cast'
5 years, 3 months ago (2015-09-11 23:12:38 UTC) #22
Nico
That's a P0 bug on crashpad then. Projects outside of src/ are not allowed to ...
5 years, 3 months ago (2015-09-11 23:26:43 UTC) #23
danakj
PTAL
5 years, 3 months ago (2015-09-11 23:32:06 UTC) #24
danakj
On 2015/09/11 23:32:06, danakj wrote: > PTAL Er, wrong CL. I'm fixing crashpad :) Oh, ...
5 years, 3 months ago (2015-09-11 23:32:54 UTC) #25
Nico
On 2015/09/11 23:32:54, danakj wrote: > On 2015/09/11 23:32:06, danakj wrote: > > PTAL > ...
5 years, 3 months ago (2015-09-11 23:34:58 UTC) #26
Adam Rice
https://codereview.chromium.org/1340683002/diff/100001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1340683002/diff/100001/base/memory/scoped_ptr.h#newcode470 base/memory/scoped_ptr.h:470: // NOT use const_cast<Base*>() to upcast the static type ...
5 years, 3 months ago (2015-09-14 05:30:29 UTC) #27
danakj
https://codereview.chromium.org/1340683002/diff/100001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1340683002/diff/100001/base/memory/scoped_ptr.h#newcode470 base/memory/scoped_ptr.h:470: // NOT use const_cast<Base*>() to upcast the static type ...
5 years, 3 months ago (2015-09-14 18:02:36 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1340683002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1340683002/120001
5 years, 3 months ago (2015-09-14 20:03:32 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/112666)
5 years, 3 months ago (2015-09-14 21:10:10 UTC) #33
danakj
Hm.. that wasn't enough, or I messed something up. Still seeing: ../../third_party/crashpad/crashpad/util/mach/child_port_handshake.cc:104:34:error: use of undeclared ...
5 years, 3 months ago (2015-09-14 21:15:30 UTC) #34
Nico
On 2015/09/14 21:15:30, danakj wrote: > Hm.. that wasn't enough, or I messed something up. ...
5 years, 3 months ago (2015-09-14 21:17:58 UTC) #35
danakj
On Mon, Sep 14, 2015 at 2:17 PM, <thakis@chromium.org> wrote: > On 2015/09/14 21:15:30, danakj ...
5 years, 3 months ago (2015-09-14 21:27:16 UTC) #36
danakj
On 2015/09/14 21:27:16, danakj wrote: > Yah, I added an implicit_cast inside crashpad to replace ...
5 years, 3 months ago (2015-09-14 21:28:24 UTC) #37
danakj
On 2015/09/14 21:28:24, danakj wrote: > On 2015/09/14 21:27:16, danakj wrote: > > Yah, I ...
5 years, 3 months ago (2015-09-14 21:37:45 UTC) #38
danakj
On 2015/09/14 21:37:45, danakj wrote: > On 2015/09/14 21:28:24, danakj wrote: > > On 2015/09/14 ...
5 years, 3 months ago (2015-09-14 22:32:06 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1340683002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1340683002/120001
5 years, 3 months ago (2015-09-15 00:20:12 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/112846)
5 years, 3 months ago (2015-09-15 01:01:47 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1340683002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1340683002/160001
5 years, 3 months ago (2015-09-15 18:08:43 UTC) #48
commit-bot: I haz the power
Committed patchset #8 (id:160001)
5 years, 3 months ago (2015-09-15 20:27:34 UTC) #49
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/a5f0d96bc4f40971fc82e0b2255e27056d4621d1 Cr-Commit-Position: refs/heads/master@{#348978}
5 years, 3 months ago (2015-09-15 20:28:10 UTC) #50
commit-bot: I haz the power
5 years, 3 months ago (2015-09-23 12:48:55 UTC) #51
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/a5f0d96bc4f40971fc82e0b2255e27056d4621d1
Cr-Commit-Position: refs/heads/master@{#348978}

Powered by Google App Engine
This is Rietveld 408576698