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

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

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
Index: gpu/command_buffer/service/program_cache_lru_helper.cc
===================================================================
--- gpu/command_buffer/service/program_cache_lru_helper.cc (revision 147496)
+++ gpu/command_buffer/service/program_cache_lru_helper.cc (working copy)
@@ -1,49 +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.
-
-#include "gpu/command_buffer/service/program_cache_lru_helper.h"
-
-namespace gpu {
-namespace gles2 {
-
-ProgramCacheLruHelper::ProgramCacheLruHelper() {}
-ProgramCacheLruHelper::~ProgramCacheLruHelper() {}
-
-void ProgramCacheLruHelper::Clear() {
- location_map.clear();
- queue.clear();
-}
-
-bool ProgramCacheLruHelper::IsEmpty() {
- return queue.empty();
-}
-
-void ProgramCacheLruHelper::KeyUsed(const std::string& key) {
- IteratorMap::iterator location_iterator = location_map.find(key);
- if (location_iterator != location_map.end()) {
- // already exists, erase it
- queue.erase(location_iterator->second);
- }
- queue.push_front(key);
- location_map[key] = queue.begin();
-}
-
-const std::string* ProgramCacheLruHelper::PeekKey() {
- if (queue.empty()) {
- return NULL;
- }
- return &queue.back();
-}
-
-void ProgramCacheLruHelper::PopKey() {
- if (queue.empty()) {
- return;
- }
- const std::string& last = queue.back();
- location_map.erase(last);
- queue.pop_back();
-}
-
-} // namespace gpu
-} // namespace gles2
« no previous file with comments | « gpu/command_buffer/service/program_cache_lru_helper.h ('k') | gpu/command_buffer/service/program_cache_lru_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698