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

Side by Side Diff: cc/surfaces/surface_resource_holder.h

Issue 1587283002: Switch cc to std::unordered_*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unordered-map
Patch Set: Fix MSVC build issue 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 | « cc/surfaces/surface_manager.h ('k') | cc/surfaces/surface_sequence.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CC_SURFACES_SURFACE_RESOURCE_HOLDER_H_ 5 #ifndef CC_SURFACES_SURFACE_RESOURCE_HOLDER_H_
6 #define CC_SURFACES_SURFACE_RESOURCE_HOLDER_H_ 6 #define CC_SURFACES_SURFACE_RESOURCE_HOLDER_H_
7 7
8 #include "base/containers/hash_tables.h" 8 #include <unordered_map>
9
9 #include "base/macros.h" 10 #include "base/macros.h"
10 #include "cc/base/resource_id.h" 11 #include "cc/base/resource_id.h"
11 #include "cc/resources/returned_resource.h" 12 #include "cc/resources/returned_resource.h"
12 #include "cc/resources/transferable_resource.h" 13 #include "cc/resources/transferable_resource.h"
13 #include "cc/surfaces/surfaces_export.h" 14 #include "cc/surfaces/surfaces_export.h"
14 15
15 namespace cc { 16 namespace cc {
16 class SurfaceFactoryClient; 17 class SurfaceFactoryClient;
17 18
18 // A SurfaceResourceHolder manages the lifetime of resources submitted by a 19 // A SurfaceResourceHolder manages the lifetime of resources submitted by a
(...skipping 14 matching lines...) Expand all
33 34
34 struct ResourceRefs { 35 struct ResourceRefs {
35 ResourceRefs(); 36 ResourceRefs();
36 37
37 int refs_received_from_child; 38 int refs_received_from_child;
38 int refs_holding_resource_alive; 39 int refs_holding_resource_alive;
39 }; 40 };
40 // Keeps track of the number of users currently in flight for each resource 41 // Keeps track of the number of users currently in flight for each resource
41 // ID we've received from the client. When this counter hits zero for a 42 // ID we've received from the client. When this counter hits zero for a
42 // particular resource, that ID is available to return to the client. 43 // particular resource, that ID is available to return to the client.
43 typedef base::hash_map<ResourceId, ResourceRefs> ResourceIdCountMap; 44 using ResourceIdCountMap = std::unordered_map<ResourceId, ResourceRefs>;
44 ResourceIdCountMap resource_id_use_count_map_; 45 ResourceIdCountMap resource_id_use_count_map_;
45 46
46 DISALLOW_COPY_AND_ASSIGN(SurfaceResourceHolder); 47 DISALLOW_COPY_AND_ASSIGN(SurfaceResourceHolder);
47 }; 48 };
48 49
49 } // namespace cc 50 } // namespace cc
50 51
51 #endif // CC_SURFACES_SURFACE_RESOURCE_HOLDER_H_ 52 #endif // CC_SURFACES_SURFACE_RESOURCE_HOLDER_H_
OLDNEW
« no previous file with comments | « cc/surfaces/surface_manager.h ('k') | cc/surfaces/surface_sequence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698