| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 from itertools import ifilter | 5 from itertools import ifilter |
| 6 from operator import itemgetter | 6 from operator import itemgetter |
| 7 | 7 |
| 8 from data_source import DataSource | 8 from data_source import DataSource |
| 9 from extensions_paths import PRIVATE_TEMPLATES | 9 from extensions_paths import PRIVATE_TEMPLATES |
| 10 from future import Future | 10 from future import Future |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 for platform, future in permissions_data_futures.iteritems()) | 83 for platform, future in permissions_data_futures.iteritems()) |
| 84 return Future(callback=resolve) | 84 return Future(callback=resolve) |
| 85 | 85 |
| 86 def _GetCachedPermissionsData(self): | 86 def _GetCachedPermissionsData(self): |
| 87 data = self._object_store.Get('permissions_data').Get() | 87 data = self._object_store.Get('permissions_data').Get() |
| 88 if data is None: | 88 if data is None: |
| 89 data = self._CreatePermissionsData().Get() | 89 data = self._CreatePermissionsData().Get() |
| 90 self._object_store.Set('permissions_data', data) | 90 self._object_store.Set('permissions_data', data) |
| 91 return data | 91 return data |
| 92 | 92 |
| 93 def Cron(self): | |
| 94 return self._CreatePermissionsData() | |
| 95 | |
| 96 def get(self, key): | 93 def get(self, key): |
| 97 return self._GetCachedPermissionsData().get(key) | 94 return self._GetCachedPermissionsData().get(key) |
| 95 |
| 96 def Refresh(self, path): |
| 97 return self._CreatePermissionsData() |
| OLD | NEW |