| 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 "base/containers/hash_tables.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 friend class base::RefCounted<DelegatedFrameResourceCollection>; | 47 friend class base::RefCounted<DelegatedFrameResourceCollection>; |
| 48 ~DelegatedFrameResourceCollection(); | 48 ~DelegatedFrameResourceCollection(); |
| 49 | 49 |
| 50 DelegatedFrameResourceCollectionClient* client_; | 50 DelegatedFrameResourceCollectionClient* client_; |
| 51 scoped_refptr<BlockingTaskRunner> main_thread_runner_; | 51 scoped_refptr<BlockingTaskRunner> main_thread_runner_; |
| 52 | 52 |
| 53 ReturnedResourceArray returned_resources_for_child_compositor_; | 53 ReturnedResourceArray returned_resources_for_child_compositor_; |
| 54 bool lost_all_resources_; | 54 bool lost_all_resources_; |
| 55 | 55 |
| 56 struct RefCount { | 56 struct RefCount { |
| 57 RefCount() |
| 58 : refs_to_return(0), refs_to_wait_for(0), sync_point(0), lost(false) {} |
| 57 int refs_to_return; | 59 int refs_to_return; |
| 58 int refs_to_wait_for; | 60 int refs_to_wait_for; |
| 61 unsigned int sync_point; |
| 62 bool lost; |
| 59 }; | 63 }; |
| 60 typedef base::hash_map<unsigned, RefCount> ResourceIdRefCountMap; | 64 typedef base::hash_map<unsigned, RefCount> ResourceIdRefCountMap; |
| 61 ResourceIdRefCountMap resource_id_ref_count_map_; | 65 ResourceIdRefCountMap resource_id_ref_count_map_; |
| 62 | 66 |
| 63 base::ThreadChecker main_thread_checker_; | 67 base::ThreadChecker main_thread_checker_; |
| 64 base::WeakPtrFactory<DelegatedFrameResourceCollection> weak_ptr_factory_; | 68 base::WeakPtrFactory<DelegatedFrameResourceCollection> weak_ptr_factory_; |
| 65 | 69 |
| 66 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameResourceCollection); | 70 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameResourceCollection); |
| 67 }; | 71 }; |
| 68 | 72 |
| 69 } // namespace cc | 73 } // namespace cc |
| 70 | 74 |
| 71 #endif // CC_LAYERS_DELEGATED_FRAME_RESOURCE_COLLECTION_H_ | 75 #endif // CC_LAYERS_DELEGATED_FRAME_RESOURCE_COLLECTION_H_ |
| OLD | NEW |