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

Issue 623383002: Align base::hash_map with C++11, part 2. (Closed)

Created:
6 years, 2 months ago by davidben
Modified:
6 years, 2 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, tzik, tfarina, jam, nhiroki, kinuko+fileapi, darin-cc_chromium.org, mmenke, mkwst+moarreviews-renderer_chromium.org, cc-bugs_chromium.org, erikwright+watch_chromium.org, markusheintz_, jshin+watch_chromium.org, jamesr
Base URL:
https://chromium.googlesource.com/chromium/src.git@hash-1
Project:
chromium
Visibility:
Public.

Description

Align base::hash_map with C++11, part 2. MSVC's stdext::hash_map, unlike C++11's std::unordered_map and GCC's __gnu_cxx::hash_map, requires a total order on the key. It also has a very different syntax for supplying a default hash function. Switch MSVC to std::unordered_map, but exposed as base::hash_map. This aligns both the container and the default hash function. The default hash function now differs from our GCC one in that const char * is no longer hashed as a C string. To align GCC with C++11 semantics and the MSVC ones this CL introduces, also provide a new hash function and swap the default hash with it. This new function is identical to __gnu_cxx::hash, but it does not specialize const char* and does specialize T* (which was already aligned by https://codereview.chromium.org/630503002/). Note: This CL changes a file in mojo/ and will need to be mirrored in the mojo repository before the next sync. BUG=420242 Committed: https://crrev.com/44d2e5c45975ab36f29035552521e41ae512c8bf Cr-Commit-Position: refs/heads/master@{#301185}

Patch Set 1 #

Total comments: 3

Patch Set 2 : rebase #

Patch Set 3 : mojo/ #

Patch Set 4 : rebase #

Patch Set 5 : rebase #

Total comments: 2

Patch Set 6 : clean up stale includes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -213 lines) Patch
M base/containers/hash_tables.h View 1 7 chunks +88 lines, -35 lines 0 comments Download
M base/containers/hash_tables_unittest.cc View 2 chunks +14 lines, -0 lines 0 comments Download
M base/containers/small_map_unittest.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M base/files/file_path.h View 1 2 3 4 5 3 chunks +0 lines, -10 lines 0 comments Download
M base/strings/string_piece.h View 2 chunks +0 lines, -12 lines 0 comments Download
M cc/quads/render_pass.h View 1 1 chunk +0 lines, -8 lines 0 comments Download
M cc/surfaces/surface_id.h View 1 2 3 4 5 2 chunks +0 lines, -9 lines 0 comments Download
M chrome/browser/browsing_data/canonical_cookie_hash.h View 1 2 3 4 5 3 chunks +0 lines, -45 lines 0 comments Download
M chrome/browser/sync_file_system/drive_backend/metadata_database_index.h View 1 2 3 4 1 chunk +0 lines, -7 lines 0 comments Download
M chrome/browser/ui/zoom/chrome_zoom_level_prefs.cc View 1 2 3 4 1 chunk +0 lines, -4 lines 0 comments Download
M content/common/host_shared_bitmap_manager.h View 1 2 3 4 5 2 chunks +0 lines, -7 lines 0 comments Download
M content/renderer/pepper/v8_var_converter.cc View 1 1 chunk +0 lines, -5 lines 0 comments Download
M mojo/edk/system/channel_endpoint_id.h View 1 2 3 chunks +1 line, -11 lines 0 comments Download
M net/dns/dns_hosts.h View 2 chunks +0 lines, -9 lines 0 comments Download
M tools/gn/label.h View 1 2 3 4 5 3 chunks +0 lines, -10 lines 0 comments Download
M tools/gn/label_ptr.h View 1 chunk +0 lines, -7 lines 0 comments Download
M tools/gn/output_file.h View 1 chunk +0 lines, -6 lines 0 comments Download
M tools/gn/source_dir.h View 1 chunk +0 lines, -6 lines 0 comments Download
M tools/gn/source_file.h View 1 chunk +0 lines, -6 lines 0 comments Download
M tools/gn/unique_vector.h View 2 chunks +0 lines, -13 lines 0 comments Download

Messages

Total messages: 26 (5 generated)
davidben
There wasn't much chatter on the thread I sent out, so I guess I'll publish ...
6 years, 2 months ago (2014-10-06 19:17:08 UTC) #2
davidben
Transplanting some comments from the original CL. https://codereview.chromium.org/623383002/diff/1/base/containers/small_map_unittest.cc File base/containers/small_map_unittest.cc (left): https://codereview.chromium.org/623383002/diff/1/base/containers/small_map_unittest.cc#oldcode417 base/containers/small_map_unittest.cc:417: hash_map_add_item() : ...
6 years, 2 months ago (2014-10-06 23:37:24 UTC) #3
danakj
On Mon, Oct 6, 2014 at 3:17 PM, <davidben@chromium.org> wrote: > Reviewers: danakj, > > ...
6 years, 2 months ago (2014-10-09 00:05:10 UTC) #4
davidben
On 2014/10/09 00:05:10, danakj wrote: > On Mon, Oct 6, 2014 at 3:17 PM, <mailto:davidben@chromium.org> ...
6 years, 2 months ago (2014-10-09 18:14:25 UTC) #5
davidben
On 2014/10/09 18:14:25, David Benjamin wrote: > There's a thread, though there hasn't been much ...
6 years, 2 months ago (2014-10-09 18:18:20 UTC) #6
davidben
On 2014/10/09 18:18:20, David Benjamin wrote: > On 2014/10/09 18:14:25, David Benjamin wrote: > > ...
6 years, 2 months ago (2014-10-10 00:32:08 UTC) #7
davidben
friendly ping
6 years, 2 months ago (2014-10-15 19:05:12 UTC) #8
davidben
+mark for review (danakj tells me she's busy).
6 years, 2 months ago (2014-10-20 22:20:51 UTC) #10
Mark Mentovai
James is the only person who weighed in with concerns on your thread, so let’s ...
6 years, 2 months ago (2014-10-21 03:34:17 UTC) #11
davidben
Good point. +jamesr for review then.
6 years, 2 months ago (2014-10-21 16:06:22 UTC) #13
jamesr
My main concern is that this changes a lot at once, which increases the risk ...
6 years, 2 months ago (2014-10-22 00:18:33 UTC) #14
Mark Mentovai
LGTM
6 years, 2 months ago (2014-10-22 16:28:32 UTC) #15
davidben
Aaand for the OWNERS monster. sky: chrome/ brettw: tools/gn/
6 years, 2 months ago (2014-10-22 18:23:31 UTC) #17
danakj
cc LGTM
6 years, 2 months ago (2014-10-22 18:25:52 UTC) #18
sky
LGTM https://codereview.chromium.org/623383002/diff/110001/chrome/browser/browsing_data/canonical_cookie_hash.h File chrome/browser/browsing_data/canonical_cookie_hash.h (left): https://codereview.chromium.org/623383002/diff/110001/chrome/browser/browsing_data/canonical_cookie_hash.h#oldcode12 chrome/browser/browsing_data/canonical_cookie_hash.h:12: #if defined(COMPILER_MSVC) Remove any includes that are now ...
6 years, 2 months ago (2014-10-22 20:21:14 UTC) #19
davidben
https://codereview.chromium.org/623383002/diff/110001/chrome/browser/browsing_data/canonical_cookie_hash.h File chrome/browser/browsing_data/canonical_cookie_hash.h (left): https://codereview.chromium.org/623383002/diff/110001/chrome/browser/browsing_data/canonical_cookie_hash.h#oldcode12 chrome/browser/browsing_data/canonical_cookie_hash.h:12: #if defined(COMPILER_MSVC) On 2014/10/22 20:21:14, sky wrote: > Remove ...
6 years, 2 months ago (2014-10-22 21:06:56 UTC) #20
davidben
brettw: friendly ping
6 years, 2 months ago (2014-10-24 01:16:30 UTC) #21
brettw
tools/gn LGTM
6 years, 2 months ago (2014-10-24 16:51:46 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/623383002/130001
6 years, 2 months ago (2014-10-24 18:10:58 UTC) #24
commit-bot: I haz the power
Committed patchset #6 (id:130001)
6 years, 2 months ago (2014-10-24 20:20:05 UTC) #25
commit-bot: I haz the power
6 years, 2 months ago (2014-10-24 20:20:55 UTC) #26
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/44d2e5c45975ab36f29035552521e41ae512c8bf
Cr-Commit-Position: refs/heads/master@{#301185}

Powered by Google App Engine
This is Rietveld 408576698