| 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 #ifndef APPS_SAVED_FILES_SERVICE_H_ | 5 #ifndef APPS_SAVED_FILES_SERVICE_H_ |
| 6 #define APPS_SAVED_FILES_SERVICE_H_ | 6 #define APPS_SAVED_FILES_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
| 9 #include <set> | 10 #include <set> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 14 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 #include "components/keyed_service/core/keyed_service.h" | 16 #include "components/keyed_service/core/keyed_service.h" |
| 17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 19 | 19 |
| 20 class Profile; | 20 class Profile; |
| 21 class SavedFilesServiceUnitTest; | 21 class SavedFilesServiceUnitTest; |
| 22 FORWARD_DECLARE_TEST(SavedFilesServiceUnitTest, RetainTwoFilesTest); | 22 FORWARD_DECLARE_TEST(SavedFilesServiceUnitTest, RetainTwoFilesTest); |
| 23 FORWARD_DECLARE_TEST(SavedFilesServiceUnitTest, EvictionTest); | 23 FORWARD_DECLARE_TEST(SavedFilesServiceUnitTest, EvictionTest); |
| 24 FORWARD_DECLARE_TEST(SavedFilesServiceUnitTest, SequenceNumberCompactionTest); | 24 FORWARD_DECLARE_TEST(SavedFilesServiceUnitTest, SequenceNumberCompactionTest); |
| 25 | 25 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 SavedFiles* GetOrInsert(const std::string& extension_id); | 120 SavedFiles* GetOrInsert(const std::string& extension_id); |
| 121 | 121 |
| 122 // Clears the SavedFiles for |extension_id|. | 122 // Clears the SavedFiles for |extension_id|. |
| 123 void Clear(const std::string& extension_id); | 123 void Clear(const std::string& extension_id); |
| 124 | 124 |
| 125 static void SetMaxSequenceNumberForTest(int max_value); | 125 static void SetMaxSequenceNumberForTest(int max_value); |
| 126 static void ClearMaxSequenceNumberForTest(); | 126 static void ClearMaxSequenceNumberForTest(); |
| 127 static void SetLruSizeForTest(int size); | 127 static void SetLruSizeForTest(int size); |
| 128 static void ClearLruSizeForTest(); | 128 static void ClearLruSizeForTest(); |
| 129 | 129 |
| 130 std::map<std::string, scoped_ptr<SavedFiles>> extension_id_to_saved_files_; | 130 std::map<std::string, std::unique_ptr<SavedFiles>> |
| 131 extension_id_to_saved_files_; |
| 131 content::NotificationRegistrar registrar_; | 132 content::NotificationRegistrar registrar_; |
| 132 Profile* profile_; | 133 Profile* profile_; |
| 133 | 134 |
| 134 DISALLOW_COPY_AND_ASSIGN(SavedFilesService); | 135 DISALLOW_COPY_AND_ASSIGN(SavedFilesService); |
| 135 }; | 136 }; |
| 136 | 137 |
| 137 } // namespace apps | 138 } // namespace apps |
| 138 | 139 |
| 139 #endif // APPS_SAVED_FILES_SERVICE_H_ | 140 #endif // APPS_SAVED_FILES_SERVICE_H_ |
| OLD | NEW |