| 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 #ifndef CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ |
| 6 #define CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ | 6 #define CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/files/file_path.h" |
| 13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 14 #include "base/sequenced_task_runner_helpers.h" | 15 #include "base/sequenced_task_runner_helpers.h" |
| 15 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class FilePath; | 19 class FilePath; |
| 19 class Time; | 20 class Time; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace storage { | 23 namespace storage { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 virtual ~ChromeBlobStorageContext(); | 64 virtual ~ChromeBlobStorageContext(); |
| 64 | 65 |
| 65 private: | 66 private: |
| 66 friend class base::DeleteHelper<ChromeBlobStorageContext>; | 67 friend class base::DeleteHelper<ChromeBlobStorageContext>; |
| 67 friend class base::RefCountedThreadSafe<ChromeBlobStorageContext, | 68 friend class base::RefCountedThreadSafe<ChromeBlobStorageContext, |
| 68 ChromeBlobStorageContextDeleter>; | 69 ChromeBlobStorageContextDeleter>; |
| 69 friend struct ChromeBlobStorageContextDeleter; | 70 friend struct ChromeBlobStorageContextDeleter; |
| 70 | 71 |
| 71 void DeleteOnCorrectThread() const; | 72 void DeleteOnCorrectThread() const; |
| 72 | 73 |
| 74 // Called after successfully creating our blob directory. This enables disk |
| 75 // usage on |context_|. |
| 76 void OnBlobDirectoryCreated(const base::FilePath& blob_storage_directory); |
| 77 |
| 78 base::FilePath blob_storage_dir_; |
| 73 std::unique_ptr<storage::BlobStorageContext> context_; | 79 std::unique_ptr<storage::BlobStorageContext> context_; |
| 74 }; | 80 }; |
| 75 | 81 |
| 76 struct ChromeBlobStorageContextDeleter { | 82 struct ChromeBlobStorageContextDeleter { |
| 77 static void Destruct(const ChromeBlobStorageContext* context) { | 83 static void Destruct(const ChromeBlobStorageContext* context) { |
| 78 context->DeleteOnCorrectThread(); | 84 context->DeleteOnCorrectThread(); |
| 79 } | 85 } |
| 80 }; | 86 }; |
| 81 | 87 |
| 82 } // namespace content | 88 } // namespace content |
| 83 | 89 |
| 84 #endif // CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ | 90 #endif // CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ |
| OLD | NEW |