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

Side by Side Diff: ui/gfx/generic_shared_memory_id.h

Issue 1502373009: Allow std::unordered_*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, more HashPair -> HashInts Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_GENERIC_SHARED_MEMORY_ID_H_ 5 #ifndef UI_GFX_GENERIC_SHARED_MEMORY_ID_H_
6 #define UI_GFX_GENERIC_SHARED_MEMORY_ID_H_ 6 #define UI_GFX_GENERIC_SHARED_MEMORY_ID_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include "base/containers/hash_tables.h"
12 #include "base/hash.h"
11 #include "base/trace_event/memory_allocator_dump.h" 13 #include "base/trace_event/memory_allocator_dump.h"
12 #include "ui/gfx/gfx_export.h" 14 #include "ui/gfx/gfx_export.h"
13 15
14 namespace gfx { 16 namespace gfx {
15 17
16 // Defines an ID type which is used across all types of shared memory 18 // Defines an ID type which is used across all types of shared memory
17 // allocations in content/. This ID type is in ui/gfx, as components outside 19 // allocations in content/. This ID type is in ui/gfx, as components outside
18 // content/ may need to hold an ID (but should not generate one). 20 // content/ may need to hold an ID (but should not generate one).
19 class GFX_EXPORT GenericSharedMemoryId { 21 class GFX_EXPORT GenericSharedMemoryId {
20 public: 22 public:
(...skipping 30 matching lines...) Expand all
51 struct hash<gfx::GenericSharedMemoryId> { 53 struct hash<gfx::GenericSharedMemoryId> {
52 size_t operator()(gfx::GenericSharedMemoryId key) const { 54 size_t operator()(gfx::GenericSharedMemoryId key) const {
53 return BASE_HASH_NAMESPACE::hash<int>()(key.id); 55 return BASE_HASH_NAMESPACE::hash<int>()(key.id);
54 } 56 }
55 }; 57 };
56 58
57 template <typename Second> 59 template <typename Second>
58 struct hash<std::pair<gfx::GenericSharedMemoryId, Second>> { 60 struct hash<std::pair<gfx::GenericSharedMemoryId, Second>> {
59 size_t operator()( 61 size_t operator()(
60 const std::pair<gfx::GenericSharedMemoryId, Second>& pair) const { 62 const std::pair<gfx::GenericSharedMemoryId, Second>& pair) const {
61 return base::HashPair(pair.first.id, pair.second); 63 return base::HashInts(pair.first.id, pair.second);
62 } 64 }
63 }; 65 };
64 66
65 } // namespace BASE_HASH_NAMESPACE 67 } // namespace BASE_HASH_NAMESPACE
66 68
67 #endif // UI_GFX_GENERIC_SHARED_MEMORY_ID_H_ 69 #endif // UI_GFX_GENERIC_SHARED_MEMORY_ID_H_
OLDNEW
« no previous file with comments | « ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698