| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_LOCAL_EXTENSION_CACHE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_LOCAL_EXTENSION_CACHE_H_ | 
| 6 #define CHROME_BROWSER_EXTENSIONS_UPDATER_LOCAL_EXTENSION_CACHE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_UPDATER_LOCAL_EXTENSION_CACHE_H_ | 
| 7 | 7 | 
| 8 #include <stddef.h> | 8 #include <stddef.h> | 
| 9 #include <stdint.h> | 9 #include <stdint.h> | 
| 10 | 10 | 
| 11 #include <map> | 11 #include <map> | 
| 12 #include <memory> | 12 #include <memory> | 
| 13 #include <string> | 13 #include <string> | 
| 14 | 14 | 
| 15 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" | 
| 16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" | 
| 17 #include "base/macros.h" | 17 #include "base/macros.h" | 
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" | 
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" | 
| 20 | 20 | 
|  | 21 namespace base { | 
|  | 22 class SequencedTaskRunner; | 
|  | 23 } | 
|  | 24 | 
| 21 namespace extensions { | 25 namespace extensions { | 
| 22 | 26 | 
| 23 // Cache .crx files in some local dir for future use. Cache keeps only latest | 27 // Cache .crx files in some local dir for future use. Cache keeps only latest | 
| 24 // version of the extensions. Only one instance of LocalExtensionCache can work | 28 // version of the extensions. Only one instance of LocalExtensionCache can work | 
| 25 // with the same directory. But LocalExtensionCache instance can be shared | 29 // with the same directory. But LocalExtensionCache instance can be shared | 
| 26 // between multiple clients. Public interface can be used only from UI thread. | 30 // between multiple clients. Public interface can be used only from UI thread. | 
| 27 class LocalExtensionCache { | 31 class LocalExtensionCache { | 
| 28  public: | 32  public: | 
| 29   // Callback invoked on UI thread when PutExtension is completed. | 33   // Callback invoked on UI thread when PutExtension is completed. | 
| 30   typedef base::Callback<void(const base::FilePath& file_path, | 34   typedef base::Callback<void(const base::FilePath& file_path, | 
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 271 | 275 | 
| 272   // Weak factory for callbacks from the backend and delayed tasks. | 276   // Weak factory for callbacks from the backend and delayed tasks. | 
| 273   base::WeakPtrFactory<LocalExtensionCache> weak_ptr_factory_; | 277   base::WeakPtrFactory<LocalExtensionCache> weak_ptr_factory_; | 
| 274 | 278 | 
| 275   DISALLOW_COPY_AND_ASSIGN(LocalExtensionCache); | 279   DISALLOW_COPY_AND_ASSIGN(LocalExtensionCache); | 
| 276 }; | 280 }; | 
| 277 | 281 | 
| 278 }  // namespace extensions | 282 }  // namespace extensions | 
| 279 | 283 | 
| 280 #endif  // CHROME_BROWSER_EXTENSIONS_UPDATER_LOCAL_EXTENSION_CACHE_H_ | 284 #endif  // CHROME_BROWSER_EXTENSIONS_UPDATER_LOCAL_EXTENSION_CACHE_H_ | 
| OLD | NEW | 
|---|