From 7ad4967d1b75afbcded57ee9d5abfacd0b14ccc3 Mon Sep 17 00:00:00 2001 From: Morgan Chen Date: Tue, 8 Aug 2023 11:25:37 -0700 Subject: [PATCH] update thread-safety docs on Storage (#11661) --- FirebaseStorage/Sources/Storage.swift | 2 +- FirebaseStorage/Sources/StorageDownloadTask.swift | 1 - FirebaseStorage/Sources/StorageObservableTask.swift | 1 - FirebaseStorage/Sources/StorageTask.swift | 2 +- FirebaseStorage/Sources/StorageUploadTask.swift | 1 - 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/FirebaseStorage/Sources/Storage.swift b/FirebaseStorage/Sources/Storage.swift index c4e5e85acb6..84c11ff4208 100644 --- a/FirebaseStorage/Sources/Storage.swift +++ b/FirebaseStorage/Sources/Storage.swift @@ -29,7 +29,7 @@ import FirebaseAuthInterop /** * Firebase Storage is a service that supports uploading and downloading binary objects, * such as images, videos, and other files to Google Cloud Storage. Instances of `Storage` - * are not thread-safe. + * are not thread-safe, but can be accessed from any thread. * * If you call `Storage.storage()`, the instance will initialize with the default `FirebaseApp`, * `FirebaseApp.app()`, and the storage location will come from the provided diff --git a/FirebaseStorage/Sources/StorageDownloadTask.swift b/FirebaseStorage/Sources/StorageDownloadTask.swift index d14ab1fbe48..d8628db2a72 100644 --- a/FirebaseStorage/Sources/StorageDownloadTask.swift +++ b/FirebaseStorage/Sources/StorageDownloadTask.swift @@ -28,7 +28,6 @@ import Foundation * Downloads can currently be returned as `Data` in memory, or as a `URL` to a file on disk. * Downloads are performed on a background queue, and callbacks are raised on the developer * specified `callbackQueue` in Storage, or the main queue if left unspecified. - * Currently all downloads must be initiated and managed on the main queue. */ @objc(FIRStorageDownloadTask) open class StorageDownloadTask: StorageObservableTask, StorageTaskManagement { diff --git a/FirebaseStorage/Sources/StorageObservableTask.swift b/FirebaseStorage/Sources/StorageObservableTask.swift index 53a34fc74b4..e207c7b3322 100644 --- a/FirebaseStorage/Sources/StorageObservableTask.swift +++ b/FirebaseStorage/Sources/StorageObservableTask.swift @@ -25,7 +25,6 @@ import Foundation * in task state. * Observers produce a `StorageHandle`, which is used to keep track of and remove specific * observers at a later date. - * This class is not thread safe and can only be called on the main thread. */ @objc(FIRStorageObservableTask) open class StorageObservableTask: StorageTask { /** diff --git a/FirebaseStorage/Sources/StorageTask.swift b/FirebaseStorage/Sources/StorageTask.swift index bd3ab818921..53cd69b99a6 100644 --- a/FirebaseStorage/Sources/StorageTask.swift +++ b/FirebaseStorage/Sources/StorageTask.swift @@ -26,7 +26,7 @@ import Foundation * for metadata and errors. * Callbacks are always fired on the developer-specified callback queue. * If no queue is specified, it defaults to the main queue. - * This class is not thread safe, so only call methods on the main thread. + * This class is thread-safe. */ @objc(FIRStorageTask) open class StorageTask: NSObject { /** diff --git a/FirebaseStorage/Sources/StorageUploadTask.swift b/FirebaseStorage/Sources/StorageUploadTask.swift index e078633ac7e..e921a99d4b9 100644 --- a/FirebaseStorage/Sources/StorageUploadTask.swift +++ b/FirebaseStorage/Sources/StorageUploadTask.swift @@ -28,7 +28,6 @@ import Foundation * Uploads can be initialized from `Data` in memory, or a URL to a file on disk. * Uploads are performed on a background queue, and callbacks are raised on the developer * specified `callbackQueue` in Storage, or the main queue if unspecified. - * Currently all uploads must be initiated and managed on the main queue. */ @objc(FIRStorageUploadTask) open class StorageUploadTask: StorageObservableTask, StorageTaskManagement {