|
19 | 19 | #include "google/cloud/storage/internal/storage_connection.h" |
20 | 20 | #include "google/cloud/storage/parallel_upload.h" |
21 | 21 | #include "google/cloud/storage/version.h" |
| 22 | +#include "google/cloud/internal/generic_background_threads_impl.h" |
| 23 | +#if GOOGLE_CLOUD_CPP_STORAGE_HAVE_GRPC |
| 24 | +#include "google/cloud/background_threads.h" |
| 25 | +#include "google/cloud/completion_queue.h" |
| 26 | +#else |
22 | 27 | #include "google/cloud/internal/rest_pure_background_threads_impl.h" |
| 28 | +#endif |
23 | 29 | #include <memory> |
24 | 30 | #include <string> |
25 | 31 |
|
@@ -204,9 +210,23 @@ class TracingConnection : public storage::internal::StorageConnection { |
204 | 210 |
|
205 | 211 | static BucketMetadataCache& cache(); |
206 | 212 |
|
| 213 | +#if GOOGLE_CLOUD_CPP_STORAGE_HAVE_GRPC |
| 214 | + using StorageBackgroundThreads = google::cloud::BackgroundThreads; |
| 215 | + using AutomaticallyCreatedStorageBackgroundThreads = |
| 216 | + google::cloud::internal::AutomaticallyCreatedBackgroundThreadsImpl< |
| 217 | + google::cloud::CompletionQueue, google::cloud::BackgroundThreads>; |
| 218 | +#else |
| 219 | + using StorageBackgroundThreads = |
| 220 | + google::cloud::rest_internal::RestPureBackgroundThreads; |
| 221 | + using AutomaticallyCreatedStorageBackgroundThreads = |
| 222 | + google::cloud::internal::AutomaticallyCreatedBackgroundThreadsImpl< |
| 223 | + rest_internal::RestPureCompletionQueue, |
| 224 | + rest_internal::RestPureBackgroundThreads, |
| 225 | + rest_internal::RestPureQueueTraits>; |
| 226 | +#endif |
| 227 | + |
207 | 228 | std::shared_ptr<StorageConnection> impl_; |
208 | | - std::unique_ptr<google::cloud::rest_internal::RestPureBackgroundThreads> |
209 | | - background_threads_; |
| 229 | + std::unique_ptr<StorageBackgroundThreads> background_threads_; |
210 | 230 | }; |
211 | 231 |
|
212 | 232 | std::shared_ptr<storage::internal::StorageConnection> MakeTracingClient( |
|
0 commit comments