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.
5 #ifndef CC_RESOURCES_RESOURCE_UPDATE_QUEUE_H_
6 #define CC_RESOURCES_RESOURCE_UPDATE_QUEUE_H_
9 #include "base/basictypes.h"
10 #include "cc/base/cc_export.h"
11 #include "cc/resources/resource_update.h"
15 class CC_EXPORT ResourceUpdateQueue
{
17 ResourceUpdateQueue();
18 virtual ~ResourceUpdateQueue();
20 void AppendFullUpload(const ResourceUpdate
& upload
);
21 void AppendPartialUpload(const ResourceUpdate
& upload
);
23 void ClearUploadsToEvictedResources();
25 ResourceUpdate
TakeFirstFullUpload();
26 ResourceUpdate
TakeFirstPartialUpload();
28 size_t FullUploadSize() const { return full_entries_
.size(); }
29 size_t PartialUploadSize() const { return partial_entries_
.size(); }
31 bool HasMoreUpdates() const;
34 void ClearUploadsToEvictedResources(std::deque
<ResourceUpdate
>* entry_queue
);
35 std::deque
<ResourceUpdate
> full_entries_
;
36 std::deque
<ResourceUpdate
> partial_entries_
;
38 DISALLOW_COPY_AND_ASSIGN(ResourceUpdateQueue
);
43 #endif // CC_RESOURCES_RESOURCE_UPDATE_QUEUE_H_