1 // Copyright 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CC_RESOURCES_RESOURCE_UPDATE_QUEUE_H_ 6 #define CC_RESOURCES_RESOURCE_UPDATE_QUEUE_H_ 7 8 #include <deque> 9 #include "base/basictypes.h" 10 #include "cc/base/cc_export.h" 11 #include "cc/resources/resource_update.h" 12 13 namespace cc { 14 15 class CC_EXPORT ResourceUpdateQueue { 16 public: 17 ResourceUpdateQueue(); 18 virtual ~ResourceUpdateQueue(); 19 20 void AppendFullUpload(const ResourceUpdate& upload); 21 void AppendPartialUpload(const ResourceUpdate& upload); 22 23 void ClearUploadsToEvictedResources(); 24 25 ResourceUpdate TakeFirstFullUpload(); 26 ResourceUpdate TakeFirstPartialUpload(); 27 28 size_t FullUploadSize() const { return full_entries_.size(); } 29 size_t PartialUploadSize() const { return partial_entries_.size(); } 30 31 bool HasMoreUpdates() const; 32 33 private: 34 void ClearUploadsToEvictedResources(std::deque<ResourceUpdate>* entry_queue); 35 std::deque<ResourceUpdate> full_entries_; 36 std::deque<ResourceUpdate> partial_entries_; 37 38 DISALLOW_COPY_AND_ASSIGN(ResourceUpdateQueue); 39 }; 40 41 } // namespace cc 42 43 #endif // CC_RESOURCES_RESOURCE_UPDATE_QUEUE_H_ 44