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

Unified Diff: gpu/command_buffer/service/program_cache_lru_helper.h

Issue 10795037: Revert 147328 - Current status of patch: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/program_cache.cc ('k') | gpu/command_buffer/service/program_cache_lru_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/program_cache_lru_helper.h
===================================================================
--- gpu/command_buffer/service/program_cache_lru_helper.h (revision 147496)
+++ gpu/command_buffer/service/program_cache_lru_helper.h (working copy)
@@ -1,51 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_LRU_HELPER_H_
-#define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_LRU_HELPER_H_
-
-#include <list>
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/hash_tables.h"
-#include "gpu/gpu_export.h"
-
-namespace gpu {
-namespace gles2 {
-
-// LRU helper for the program cache, operates in O(1) time.
-// This class uses a linked list with a hash map. Both copy their string keys,
-// so be mindful that keys you insert will be stored again twice in memory.
-class GPU_EXPORT ProgramCacheLruHelper {
- public:
- ProgramCacheLruHelper();
- ~ProgramCacheLruHelper();
-
- // clears the lru queue
- void Clear();
- // returns true if the lru queue is empty
- bool IsEmpty();
- // inserts or refreshes a key in the queue
- void KeyUsed(const std::string& key);
- // Peeks at the next key. Use IsEmpty() first (if the queue is empty then
- // null is returned).
- const std::string* PeekKey();
- // evicts the next key from the queue.
- void PopKey();
-
- private:
- typedef std::list<std::string> StringList;
- typedef base::hash_map<std::string,
- StringList::iterator> IteratorMap;
- StringList queue;
- IteratorMap location_map;
-
- DISALLOW_COPY_AND_ASSIGN(ProgramCacheLruHelper);
-};
-
-} // namespace gles2
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_LRU_HELPER_H_
« no previous file with comments | « gpu/command_buffer/service/program_cache.cc ('k') | gpu/command_buffer/service/program_cache_lru_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698