OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LAYERS_DELEGATED_FRAME_RESOURCE_COLLECTION_H_ | 5 #ifndef CC_LAYERS_DELEGATED_FRAME_RESOURCE_COLLECTION_H_ |
6 #define CC_LAYERS_DELEGATED_FRAME_RESOURCE_COLLECTION_H_ | 6 #define CC_LAYERS_DELEGATED_FRAME_RESOURCE_COLLECTION_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 "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
12 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
13 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
14 #include "cc/resources/return_callback.h" | 15 #include "cc/resources/return_callback.h" |
15 #include "cc/resources/returned_resource.h" | 16 #include "cc/resources/returned_resource.h" |
16 #include "cc/resources/transferable_resource.h" | 17 #include "cc/resources/transferable_resource.h" |
17 | 18 |
18 namespace cc { | 19 namespace cc { |
(...skipping 30 matching lines...) Expand all Loading... |
49 | 50 |
50 DelegatedFrameResourceCollectionClient* client_; | 51 DelegatedFrameResourceCollectionClient* client_; |
51 | 52 |
52 ReturnedResourceArray returned_resources_for_child_compositor_; | 53 ReturnedResourceArray returned_resources_for_child_compositor_; |
53 bool lost_all_resources_; | 54 bool lost_all_resources_; |
54 | 55 |
55 struct RefCount { | 56 struct RefCount { |
56 int refs_to_return; | 57 int refs_to_return; |
57 int refs_to_wait_for; | 58 int refs_to_wait_for; |
58 }; | 59 }; |
59 typedef base::hash_map<unsigned, RefCount> ResourceIdRefCountMap; | 60 using ResourceIdRefCountMap = std::unordered_map<unsigned, RefCount>; |
60 ResourceIdRefCountMap resource_id_ref_count_map_; | 61 ResourceIdRefCountMap resource_id_ref_count_map_; |
61 | 62 |
62 base::ThreadChecker main_thread_checker_; | 63 base::ThreadChecker main_thread_checker_; |
63 base::WeakPtrFactory<DelegatedFrameResourceCollection> weak_ptr_factory_; | 64 base::WeakPtrFactory<DelegatedFrameResourceCollection> weak_ptr_factory_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameResourceCollection); | 66 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameResourceCollection); |
66 }; | 67 }; |
67 | 68 |
68 } // namespace cc | 69 } // namespace cc |
69 | 70 |
70 #endif // CC_LAYERS_DELEGATED_FRAME_RESOURCE_COLLECTION_H_ | 71 #endif // CC_LAYERS_DELEGATED_FRAME_RESOURCE_COLLECTION_H_ |
OLD | NEW |