| OLD | NEW | 
|    1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |    1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
|    2 # Use of this source code is governed by a BSD-style license that can be |    2 # Use of this source code is governed by a BSD-style license that can be | 
|    3 # found in the LICENSE file. |    3 # found in the LICENSE file. | 
|    4  |    4  | 
|    5 import os |    5 import os | 
|    6  |    6  | 
|    7 import object_store |    7 import object_store | 
|    8  |    8  | 
|    9 APPS                      = 'Apps' |    9 APPS                      = 'Apps' | 
|   10 APPS_FS                   = 'AppsFileSystem' |   10 APPS_FS                   = 'AppsFileSystem' | 
|   11 CRON                      = 'Cron' |   11 CRON                      = 'Cron' | 
|   12 EXTENSIONS                = 'Extensions' |   12 EXTENSIONS                = 'Extensions' | 
|   13 EXTENSIONS_FS             = 'ExtensionsFileSystem' |   13 EXTENSIONS_FS             = 'ExtensionsFileSystem' | 
|   14 CRON_FILE_LISTING         = 'Cron.FileListing' |   14 CRON_FILE_LISTING         = 'Cron.FileListing' | 
|   15 CRON_GITHUB_INVALIDATION  = 'Cron.GithubInvalidation' |   15 CRON_GITHUB_INVALIDATION  = 'Cron.GithubInvalidation' | 
|   16 CRON_INVALIDATION         = 'Cron.Invalidation' |   16 CRON_INVALIDATION         = 'Cron.Invalidation' | 
|   17 HANDLEBAR                 = 'Handlebar' |   17 HANDLEBAR                 = 'Handlebar' | 
|   18 IDL                       = 'IDL' |   18 IDL                       = 'IDL' | 
 |   19 IDL_NO_REFS               = 'IDLNoRefs' | 
|   19 IDL_NAMES                 = 'IDLNames' |   20 IDL_NAMES                 = 'IDLNames' | 
|   20 INTRO                     = 'Intro' |   21 INTRO                     = 'Intro' | 
|   21 JSON                      = 'JSON' |   22 JSON                      = 'JSON' | 
 |   23 JSON_NO_REFS              = 'JSONNoRefs' | 
|   22 LIST                      = 'List' |   24 LIST                      = 'List' | 
 |   25 NAMES                     = 'Names' | 
|   23 PERMS                     = 'Perms' |   26 PERMS                     = 'Perms' | 
|   24 STATIC                    = 'Static' |   27 STATIC                    = 'Static' | 
|   25 ZIP                       = 'Zip' |   28 ZIP                       = 'Zip' | 
|   26  |   29  | 
|   27 class _CacheEntry(object): |   30 class _CacheEntry(object): | 
|   28   def __init__(self, cache_data, version): |   31   def __init__(self, cache_data, version): | 
|   29     self._cache_data = cache_data |   32     self._cache_data = cache_data | 
|   30     self.version = version |   33     self.version = version | 
|   31  |   34  | 
|   32 class CompiledFileSystem(object): |   35 class CompiledFileSystem(object): | 
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  107         time=0).Get() |  110         time=0).Get() | 
|  108     if (cache_entry is not None) and (version == cache_entry.version): |  111     if (cache_entry is not None) and (version == cache_entry.version): | 
|  109         return cache_entry._cache_data |  112         return cache_entry._cache_data | 
|  110     cache_data = self._populate_function(self._RecursiveList( |  113     cache_data = self._populate_function(self._RecursiveList( | 
|  111         [path + f for f in self._file_system.ReadSingle(path)])) |  114         [path + f for f in self._file_system.ReadSingle(path)])) | 
|  112     self._object_store.Set(self._MakeKey(path), |  115     self._object_store.Set(self._MakeKey(path), | 
|  113                            _CacheEntry(cache_data, version), |  116                            _CacheEntry(cache_data, version), | 
|  114                            object_store.FILE_SYSTEM_CACHE_LISTING, |  117                            object_store.FILE_SYSTEM_CACHE_LISTING, | 
|  115                            time=0) |  118                            time=0) | 
|  116     return cache_data |  119     return cache_data | 
| OLD | NEW |