| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_CONTEXT_MOJO_H_ | 5 #ifndef CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_CONTEXT_MOJO_H_ |
| 6 #define CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_CONTEXT_MOJO_H_ | 6 #define CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_CONTEXT_MOJO_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 mojom::LevelDBWrapperRequest request); | 41 mojom::LevelDBWrapperRequest request); |
| 42 void GetStorageUsage(GetStorageUsageCallback callback); | 42 void GetStorageUsage(GetStorageUsageCallback callback); |
| 43 void DeleteStorage(const url::Origin& origin); | 43 void DeleteStorage(const url::Origin& origin); |
| 44 // Like DeleteStorage(), but also deletes storage for all sub-origins. | 44 // Like DeleteStorage(), but also deletes storage for all sub-origins. |
| 45 void DeleteStorageForPhysicalOrigin(const url::Origin& origin); | 45 void DeleteStorageForPhysicalOrigin(const url::Origin& origin); |
| 46 void Flush(); | 46 void Flush(); |
| 47 | 47 |
| 48 leveldb::mojom::LevelDBDatabaseAssociatedRequest DatabaseRequestForTesting(); | 48 leveldb::mojom::LevelDBDatabaseAssociatedRequest DatabaseRequestForTesting(); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 friend class MojoDOMStorageBrowserTest; |
| 52 |
| 51 class LevelDBWrapperHolder; | 53 class LevelDBWrapperHolder; |
| 52 | 54 |
| 53 // Runs |callback| immediately if already connected to a database, otherwise | 55 // Runs |callback| immediately if already connected to a database, otherwise |
| 54 // delays running |callback| untill after a connection has been established. | 56 // delays running |callback| untill after a connection has been established. |
| 55 // Initiates connecting to the database if no connection is in progres yet. | 57 // Initiates connecting to the database if no connection is in progres yet. |
| 56 void RunWhenConnected(base::OnceClosure callback); | 58 void RunWhenConnected(base::OnceClosure callback); |
| 57 | 59 |
| 58 void OnUserServiceConnectionComplete(); | 60 void OnUserServiceConnectionComplete(); |
| 59 void OnUserServiceConnectionError(); | 61 void OnUserServiceConnectionError(); |
| 60 | 62 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Used to access old data for migration. | 116 // Used to access old data for migration. |
| 115 scoped_refptr<DOMStorageTaskRunner> task_runner_; | 117 scoped_refptr<DOMStorageTaskRunner> task_runner_; |
| 116 base::FilePath old_localstorage_path_; | 118 base::FilePath old_localstorage_path_; |
| 117 | 119 |
| 118 base::WeakPtrFactory<LocalStorageContextMojo> weak_ptr_factory_; | 120 base::WeakPtrFactory<LocalStorageContextMojo> weak_ptr_factory_; |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 } // namespace content | 123 } // namespace content |
| 122 | 124 |
| 123 #endif // CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_CONTEXT_MOJO_H_ | 125 #endif // CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_CONTEXT_MOJO_H_ |
| OLD | NEW |