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

Side by Side Diff: chrome/common/extensions/docs/server2/request_scoped_fs_cache.py

Issue 10834329: Extension docs server: many changes to bring down the latency of the server, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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 class RequestScopedFsCache(object):
6 def __init__(self, delegate):
7 self._delegate = delegate
8 self._file_cache = {}
9 self._ls_cache = {}
10
11 def GetFromFile(self, path):
12 if path in self._file_cache:
13 return self._file_cache[path]
14 from_delegate = self._delegate.GetFromFile(path)
15 self._file_cache[path] = from_delegate
16 return from_delegate
17
18 def GetFromFileListing(self, path):
19 if path in self._ls_cache:
20 return self._ls_cache[path]
21 from_delegate = self._delegate.GetFromFileListing(path)
22 self._ls_cache[path] = from_delegate
23 return from_delegate
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698