From 900fc26f78ca587989d157965d989b67d610c55f Mon Sep 17 00:00:00 2001 From: Arsentiy Milchakov Date: Wed, 8 Apr 2020 12:03:04 +0300 Subject: [PATCH] [ios][core] adaptors for background downloader --- storage/CMakeLists.txt | 22 +++- .../downloader_adapter_ios.h | 33 +++++ .../downloader_adapter_ios.mm | 121 ++++++++++++++++++ .../downloader_delegate_ios.h | 18 +++ .../downloader_delegate_ios.mm | 55 ++++++++ .../downloader_queue_ios.cpp | 56 ++++++++ .../downloader_queue_ios.hpp | 48 +++++++ .../downloader_subscriber_adapter_ios.h | 17 +++ .../downloader_subscriber_adapter_ios.mm | 39 ++++++ .../storage/storage.xcodeproj/project.pbxproj | 48 +++++-- 10 files changed, 447 insertions(+), 10 deletions(-) create mode 100644 storage/background_downloading/downloader_adapter_ios.h create mode 100644 storage/background_downloading/downloader_adapter_ios.mm create mode 100644 storage/background_downloading/downloader_delegate_ios.h create mode 100644 storage/background_downloading/downloader_delegate_ios.mm create mode 100644 storage/background_downloading/downloader_queue_ios.cpp create mode 100644 storage/background_downloading/downloader_queue_ios.hpp create mode 100644 storage/background_downloading/downloader_subscriber_adapter_ios.h create mode 100644 storage/background_downloading/downloader_subscriber_adapter_ios.mm diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt index 997f81ab06..9c155c2d0a 100644 --- a/storage/CMakeLists.txt +++ b/storage/CMakeLists.txt @@ -33,8 +33,6 @@ set( downloader_queue_universal.hpp downloading_policy.cpp downloading_policy.hpp - http_map_files_downloader.cpp - http_map_files_downloader.hpp map_files_downloader.cpp map_files_downloader.hpp map_files_downloader_with_ping.cpp @@ -53,6 +51,26 @@ set( storage_helpers.hpp ) +if(${PLATFORM_IPHONE}) + append( + SRC + background_downloading/downloader_adapter_ios.h + background_downloading/downloader_adapter_ios.mm + background_downloading/downloader_delegate_ios.h + background_downloading/downloader_delegate_ios.mm + background_downloading/downloader_subscriber_adapter_ios.h + background_downloading/downloader_subscriber_adapter_ios.mm + background_downloading/downloader_queue_ios.hpp + background_downloading/downloader_queue_ios.cpp + ) +else() + append( + SRC + http_map_files_downloader.cpp + http_map_files_downloader.hpp + ) +endif() + omim_add_library(${PROJECT_NAME} ${SRC}) omim_add_test_subdirectory(storage_tests) diff --git a/storage/background_downloading/downloader_adapter_ios.h b/storage/background_downloading/downloader_adapter_ios.h new file mode 100644 index 0000000000..94fa08b905 --- /dev/null +++ b/storage/background_downloading/downloader_adapter_ios.h @@ -0,0 +1,33 @@ +#pragma once + +#import "storage/background_downloading/downloader_subscriber_adapter_ios.h" + +#include "storage/background_downloading/downloader_queue_ios.hpp" +#include "storage/map_files_downloader_with_ping.hpp" + +namespace storage +{ +class BackgroundDownloaderAdapter : public storage::MapFilesDownloaderWithPing +{ +public: + BackgroundDownloaderAdapter(); + + // MapFilesDownloader overrides: + void Remove(storage::CountryId const & countryId) override; + + void Clear() override; + + storage::QueueInterface const & GetQueue() const override; + +private: + // MapFilesDownloaderWithServerList overrides: + void Download(storage::QueuedCountry & queuedCountry) override; + + // Trying to download mwm from different servers recursively. + void DownloadFromAnyUrl(CountryId const & countryId, std::string const & downloadPath, + std::vector const & urls); + + storage::BackgroundDownloaderQueue m_queue; + SubscriberAdapter * m_subscriberAdapter; +}; +} // namespace storage diff --git a/storage/background_downloading/downloader_adapter_ios.mm b/storage/background_downloading/downloader_adapter_ios.mm new file mode 100644 index 0000000000..c4b58ec6eb --- /dev/null +++ b/storage/background_downloading/downloader_adapter_ios.mm @@ -0,0 +1,121 @@ +#import "storage/background_downloading/downloader_adapter_ios.h" + +#import "storage/background_downloading/downloader_delegate_ios.h" +#import "platform/background_downloader_ios.h" + +#include "storage/downloader.hpp" + +#include "base/assert.hpp" +#include "base/file_name_utils.hpp" + +#include +#include + +namespace storage +{ +BackgroundDownloaderAdapter::BackgroundDownloaderAdapter() +{ + m_subscriberAdapter = [[SubscriberAdapter alloc] initWithSubscribers:m_subscribers]; + BackgroundDownloader * downloader = [BackgroundDownloader sharedBackgroundMapDownloader]; + [downloader subscribe:m_subscriberAdapter]; +} + +void BackgroundDownloaderAdapter::Remove(storage::CountryId const & countryId) +{ + MapFilesDownloader::Remove(countryId); + + if(!m_queue.Contains(countryId)) + return; + + BackgroundDownloader * downloader = [BackgroundDownloader sharedBackgroundMapDownloader]; + auto const taskIdentifier = m_queue.GetTaskIdByCountryId(countryId); + if (taskIdentifier) + [downloader cancelWithTaskIdentifier:*taskIdentifier]; + m_queue.Remove(countryId); +} + +void BackgroundDownloaderAdapter::Clear() +{ + MapFilesDownloader::Clear(); + + BackgroundDownloader * downloader = [BackgroundDownloader sharedBackgroundMapDownloader]; + [downloader clear]; + m_queue.Clear(); +}; + +storage::QueueInterface const & BackgroundDownloaderAdapter::GetQueue() const +{ + if (m_queue.IsEmpty()) + return MapFilesDownloader::GetQueue(); + + return m_queue; +} + +void BackgroundDownloaderAdapter::Download(storage::QueuedCountry & queuedCountry) +{ + if (!IsDownloadingAllowed()) + { + queuedCountry.OnDownloadFinished(downloader::DownloadStatus::Failed); + if (m_queue.IsEmpty()) + { + for (auto const & subscriber : m_subscribers) + subscriber->OnFinishDownloading(); + } + return; + } + + auto const countryId = queuedCountry.GetCountryId(); + auto const urls = MakeUrlList(queuedCountry.GetRelativeUrl()); + + m_queue.Append(std::move(queuedCountry)); + + DownloadFromAnyUrl(countryId, queuedCountry.GetFileDownloadPath(), urls); +} + +void BackgroundDownloaderAdapter::DownloadFromAnyUrl(CountryId const & countryId, + std::string const & downloadPath, + std::vector const & urls) +{ + if (urls.empty()) + return; + + auto onFinish = [this, countryId, downloadPath, urls = urls](downloader::DownloadStatus status) mutable { + if (!m_queue.Contains(countryId)) + return; + + if (status == downloader::DownloadStatus::Failed && urls.size() > 1) + { + urls.pop_back(); + DownloadFromAnyUrl(countryId, downloadPath, urls); + } + else + { + m_queue.GetCountryById(countryId).OnDownloadFinished(status); + m_queue.Remove(countryId); + } + }; + + auto onProgress = [this, countryId](int64_t totalWritten, int64_t totalExpected) { + if (!m_queue.Contains(countryId)) + return; + + auto const & country = m_queue.GetCountryById(countryId); + country.OnDownloadProgress({totalWritten, totalExpected}); + }; + + DownloaderDelegate * downloaderDelegate = + [[DownloaderDelegate alloc] initWithDownloadPath:@(downloadPath.c_str()) + onFinishDownloading:onFinish + onProgress:onProgress]; + NSURL * url = [NSURL URLWithString:@(urls.back().c_str())]; + BackgroundDownloader * downloader = [BackgroundDownloader sharedBackgroundMapDownloader]; + NSUInteger taskId = [downloader downloadWithUrl:url delegate:downloaderDelegate]; + + m_queue.SetTaskIdForCountryId(countryId, taskId); +} + +std::unique_ptr GetDownloader() +{ + return std::make_unique(); +} +} // namespace storage diff --git a/storage/background_downloading/downloader_delegate_ios.h b/storage/background_downloading/downloader_delegate_ios.h new file mode 100644 index 0000000000..bac47edb2a --- /dev/null +++ b/storage/background_downloading/downloader_delegate_ios.h @@ -0,0 +1,18 @@ +#pragma once + +#import "platform/background_downloader_ios.h" + +#include "storage/background_downloading/downloader_queue_ios.hpp" + +#include "platform/downloader_defines.hpp" + +typedef void (^OnFinishDownloadingBlock)(downloader::DownloadStatus); +typedef void (^OnProgressBlock)(int64_t bytesWritten, int64_t bytesExpected); + +@interface DownloaderDelegate : NSObject + +- (instancetype)initWithDownloadPath:(NSString *)downloadPath + onFinishDownloading:(OnFinishDownloadingBlock)onFinishDownloading + onProgress:(OnProgressBlock)onProgress; + +@end diff --git a/storage/background_downloading/downloader_delegate_ios.mm b/storage/background_downloading/downloader_delegate_ios.mm new file mode 100644 index 0000000000..6ff28cfbea --- /dev/null +++ b/storage/background_downloading/downloader_delegate_ios.mm @@ -0,0 +1,55 @@ +#import "storage/background_downloading/downloader_delegate_ios.h" + +@interface DownloaderDelegate () + +@property(copy, nonatomic) NSString *downloadPath; +@property(copy, nonatomic) OnFinishDownloadingBlock onFinish; +@property(copy, nonatomic) OnProgressBlock onProgress; + +@end + +@implementation DownloaderDelegate + +- (instancetype)initWithDownloadPath:(NSString *)downloadPath + onFinishDownloading:(OnFinishDownloadingBlock)onFinishDownloading + onProgress:(OnProgressBlock)onProgress; +{ + self = [super init]; + + if (self) { + _downloadPath = downloadPath; + _onFinish = onFinishDownloading; + _onProgress = onProgress; + } + + return self; +} + +- (void)didFinishDownloadingToURL:(NSURL *)location { + NSURL *destinationUrl = [NSURL fileURLWithPath:self.downloadPath]; + BOOL result = YES; + if (![location isEqual:destinationUrl]) { + result = [[NSFileManager defaultManager] moveItemAtURL:location.filePathURL toURL:destinationUrl error:nil]; + } + + downloader::DownloadStatus status = + result ? downloader::DownloadStatus::Completed : downloader::DownloadStatus::Failed; + self.onFinish(status); +} + +- (void)didCompleteWithError:(NSError *)error { + if (!error || error.code == NSURLErrorCancelled) + return; + + downloader::DownloadStatus status = error.code == NSURLErrorFileDoesNotExist + ? downloader::DownloadStatus::FileNotFound + : downloader::DownloadStatus::Failed; + self.onFinish(status); +} + +- (void)downloadingProgressWithTotalBytesWritten:(int64_t)totalBytesWritten + totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite { + self.onProgress(totalBytesWritten, totalBytesExpectedToWrite); +} + +@end diff --git a/storage/background_downloading/downloader_queue_ios.cpp b/storage/background_downloading/downloader_queue_ios.cpp new file mode 100644 index 0000000000..f9629134ca --- /dev/null +++ b/storage/background_downloading/downloader_queue_ios.cpp @@ -0,0 +1,56 @@ +#import "storage/background_downloading/downloader_queue_ios.hpp" + +#include + +namespace storage +{ +bool BackgroundDownloaderQueue::IsEmpty() const +{ + return m_queue.empty(); +} + +bool BackgroundDownloaderQueue::Contains(CountryId const & country) const +{ + return m_queue.find(country) != m_queue.cend(); +} + +void BackgroundDownloaderQueue::ForEachCountry(ForEachCountryFunction const & fn) const +{ + for (auto const & item : m_queue) + { + fn(item.second.m_queuedCountry); + } +} + +void BackgroundDownloaderQueue::SetTaskIdForCountryId(CountryId const & country, uint64_t taskId) +{ + auto const it = m_queue.find(country); + CHECK(it != m_queue.cend(), ()); + + it->second.m_taskId = taskId; +} + +boost::optional BackgroundDownloaderQueue::GetTaskIdByCountryId(CountryId const & country) const +{ + auto const it = m_queue.find(country); + if (it == m_queue.cend()) + return {}; + + return it->second.m_taskId; +} + +QueuedCountry & BackgroundDownloaderQueue::GetCountryById(CountryId const & countryId) +{ + return m_queue.at(countryId).m_queuedCountry; +} + +void BackgroundDownloaderQueue::Remove(CountryId const & countryId) +{ + m_queue.erase(countryId); +} + +void BackgroundDownloaderQueue::Clear() +{ + m_queue.clear(); +} +} // namespace storage diff --git a/storage/background_downloading/downloader_queue_ios.hpp b/storage/background_downloading/downloader_queue_ios.hpp new file mode 100644 index 0000000000..4df37d8c32 --- /dev/null +++ b/storage/background_downloading/downloader_queue_ios.hpp @@ -0,0 +1,48 @@ +#pragma once + +#include "storage/downloader_queue.hpp" +#include "storage/queued_country.hpp" +#include "storage/storage_defines.hpp" + +#include +#include +#include + +#include + +namespace storage +{ +class BackgroundDownloaderQueue : public QueueInterface +{ +public: + bool IsEmpty() const override; + bool Contains(CountryId const & country) const override; + void ForEachCountry(ForEachCountryFunction const & fn) const override; + + void Append(QueuedCountry && country) + { + auto const countryId = country.GetCountryId(); + auto const result = m_queue.emplace(countryId, std::move(country)); + result.first->second.m_queuedCountry.OnCountryInQueue(); + } + + void SetTaskIdForCountryId(CountryId const & countryId, uint64_t taskId); + boost::optional GetTaskIdByCountryId(CountryId const & countryId) const; + + QueuedCountry & GetCountryById(CountryId const & countryId); + + void Remove(CountryId const & country); + void Clear(); + +private: + struct TaskData + { + explicit TaskData(QueuedCountry && country) : m_queuedCountry(std::move(country)) {} + + QueuedCountry m_queuedCountry; + boost::optional m_taskId; + }; + + std::unordered_map m_queue; +}; +} // namespace storage diff --git a/storage/background_downloading/downloader_subscriber_adapter_ios.h b/storage/background_downloading/downloader_subscriber_adapter_ios.h new file mode 100644 index 0000000000..3224cdb82b --- /dev/null +++ b/storage/background_downloading/downloader_subscriber_adapter_ios.h @@ -0,0 +1,17 @@ +#pragma once + +#import +#import "platform/background_downloader_ios.h" + +#include "storage/map_files_downloader.hpp" + +#include + +@interface SubscriberAdapter : NSObject + +- (instancetype)initWithSubscribers:(std::vector &)subscribers; + +- (void)didDownloadingStarted; +- (void)didDownloadingFinished; + +@end diff --git a/storage/background_downloading/downloader_subscriber_adapter_ios.mm b/storage/background_downloading/downloader_subscriber_adapter_ios.mm new file mode 100644 index 0000000000..2aeba3841f --- /dev/null +++ b/storage/background_downloading/downloader_subscriber_adapter_ios.mm @@ -0,0 +1,39 @@ +#import "storage/downloader_subscriber_adapter_ios.h" + +using namespace storage; + +@interface SubscriberAdapter() +{ + std::vector * m_subscribers; +} + +- (void)didDownloadingStarted; +- (void)didDownloadingFinished; + +@end + +@implementation SubscriberAdapter + +- (instancetype)initWithSubscribers:(std::vector &)subscribers +{ + self = [super init]; + + if (self) + m_subscribers = &subscribers; + + return self; +} + +- (void)didDownloadingStarted +{ + for (auto const & subscriber : *m_subscribers) + subscriber->OnStartDownloading(); +} + +- (void)didDownloadingFinished +{ + for (auto const & subscriber : *m_subscribers) + subscriber->OnFinishDownloading(); +} + +@end diff --git a/xcode/storage/storage.xcodeproj/project.pbxproj b/xcode/storage/storage.xcodeproj/project.pbxproj index e691456798..c587573dc6 100644 --- a/xcode/storage/storage.xcodeproj/project.pbxproj +++ b/xcode/storage/storage.xcodeproj/project.pbxproj @@ -40,6 +40,14 @@ 3DFACF40243C985A00A29A94 /* downloader_queue_universal.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3DFACF3C243C985A00A29A94 /* downloader_queue_universal.hpp */; }; 3DFACF41243C985A00A29A94 /* downloader_queue_universal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3DFACF3D243C985A00A29A94 /* downloader_queue_universal.cpp */; }; 3DFACF42243C985A00A29A94 /* downloader_queue.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3DFACF3E243C985A00A29A94 /* downloader_queue.hpp */; }; + 3DFACF4C243CB1AB00A29A94 /* downloader_delegate_ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3DFACF44243CB1AB00A29A94 /* downloader_delegate_ios.mm */; }; + 3DFACF4D243CB1AB00A29A94 /* downloader_subscriber_adapter_ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DFACF45243CB1AB00A29A94 /* downloader_subscriber_adapter_ios.h */; }; + 3DFACF4E243CB1AB00A29A94 /* downloader_queue_ios.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3DFACF46243CB1AB00A29A94 /* downloader_queue_ios.hpp */; }; + 3DFACF4F243CB1AB00A29A94 /* downloader_adapter_ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DFACF47243CB1AB00A29A94 /* downloader_adapter_ios.h */; }; + 3DFACF50243CB1AB00A29A94 /* downloader_delegate_ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DFACF48243CB1AB00A29A94 /* downloader_delegate_ios.h */; }; + 3DFACF51243CB1AB00A29A94 /* downloader_adapter_ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3DFACF49243CB1AB00A29A94 /* downloader_adapter_ios.mm */; }; + 3DFACF52243CB1AB00A29A94 /* downloader_subscriber_adapter_ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3DFACF4A243CB1AB00A29A94 /* downloader_subscriber_adapter_ios.mm */; }; + 3DFACF53243CB1AB00A29A94 /* downloader_queue_ios.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3DFACF4B243CB1AB00A29A94 /* downloader_queue_ios.cpp */; }; 401ECED41F56C50900DFDF76 /* country_parent_getter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 401ECED21F56C50900DFDF76 /* country_parent_getter.cpp */; }; 401ECED51F56C50900DFDF76 /* country_parent_getter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 401ECED31F56C50900DFDF76 /* country_parent_getter.hpp */; }; 402873422295A91F0036AA1C /* country_tree.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4028733F2295A91E0036AA1C /* country_tree.hpp */; }; @@ -76,8 +84,6 @@ 67247FCF1C60BA8A00EDE56A /* fake_map_files_downloader.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 67247FC51C60BA8A00EDE56A /* fake_map_files_downloader.hpp */; }; 67247FD41C60BA8A00EDE56A /* task_runner.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 67247FCA1C60BA8A00EDE56A /* task_runner.hpp */; }; 67247FD61C60BA8A00EDE56A /* test_map_files_downloader.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 67247FCC1C60BA8A00EDE56A /* test_map_files_downloader.hpp */; }; - 6741251E1B4C05FA00A3E828 /* http_map_files_downloader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 674125181B4C05FA00A3E828 /* http_map_files_downloader.cpp */; }; - 6741251F1B4C05FA00A3E828 /* http_map_files_downloader.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 674125191B4C05FA00A3E828 /* http_map_files_downloader.hpp */; }; 674125201B4C05FA00A3E828 /* map_files_downloader.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6741251A1B4C05FA00A3E828 /* map_files_downloader.hpp */; }; 674125231B4C05FA00A3E828 /* storage_defines.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6741251D1B4C05FA00A3E828 /* storage_defines.cpp */; }; 675343091A3F5A2600A0A8C3 /* country_decl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675342F21A3F5A2600A0A8C3 /* country_decl.cpp */; }; @@ -260,6 +266,14 @@ 3DFACF3C243C985A00A29A94 /* downloader_queue_universal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = downloader_queue_universal.hpp; sourceTree = ""; }; 3DFACF3D243C985A00A29A94 /* downloader_queue_universal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = downloader_queue_universal.cpp; sourceTree = ""; }; 3DFACF3E243C985A00A29A94 /* downloader_queue.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = downloader_queue.hpp; sourceTree = ""; }; + 3DFACF44243CB1AB00A29A94 /* downloader_delegate_ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = downloader_delegate_ios.mm; sourceTree = ""; }; + 3DFACF45243CB1AB00A29A94 /* downloader_subscriber_adapter_ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = downloader_subscriber_adapter_ios.h; sourceTree = ""; }; + 3DFACF46243CB1AB00A29A94 /* downloader_queue_ios.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = downloader_queue_ios.hpp; sourceTree = ""; }; + 3DFACF47243CB1AB00A29A94 /* downloader_adapter_ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = downloader_adapter_ios.h; sourceTree = ""; }; + 3DFACF48243CB1AB00A29A94 /* downloader_delegate_ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = downloader_delegate_ios.h; sourceTree = ""; }; + 3DFACF49243CB1AB00A29A94 /* downloader_adapter_ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = downloader_adapter_ios.mm; sourceTree = ""; }; + 3DFACF4A243CB1AB00A29A94 /* downloader_subscriber_adapter_ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = downloader_subscriber_adapter_ios.mm; sourceTree = ""; }; + 3DFACF4B243CB1AB00A29A94 /* downloader_queue_ios.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = downloader_queue_ios.cpp; sourceTree = ""; }; 401ECED21F56C50900DFDF76 /* country_parent_getter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = country_parent_getter.cpp; sourceTree = ""; }; 401ECED31F56C50900DFDF76 /* country_parent_getter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = country_parent_getter.hpp; sourceTree = ""; }; 4028733F2295A91E0036AA1C /* country_tree.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = country_tree.hpp; sourceTree = ""; }; @@ -312,8 +326,6 @@ 67247FFF1C60BD7E00EDE56A /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 6724800E1C60CE7300EDE56A /* storage_group_download_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = storage_group_download_tests.cpp; sourceTree = ""; }; 6724800F1C60CE7300EDE56A /* storage_http_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = storage_http_tests.cpp; sourceTree = ""; }; - 674125181B4C05FA00A3E828 /* http_map_files_downloader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = http_map_files_downloader.cpp; sourceTree = ""; }; - 674125191B4C05FA00A3E828 /* http_map_files_downloader.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = http_map_files_downloader.hpp; sourceTree = ""; }; 6741251A1B4C05FA00A3E828 /* map_files_downloader.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map_files_downloader.hpp; sourceTree = ""; }; 6741251D1B4C05FA00A3E828 /* storage_defines.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = storage_defines.cpp; sourceTree = ""; }; 674709A51C6213F10093DD1B /* libmap.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmap.a; path = "../../../omim-xcode-build/Debug/libmap.a"; sourceTree = ""; }; @@ -528,6 +540,21 @@ name = Frameworks; sourceTree = ""; }; + 3DFACF43243CB1AB00A29A94 /* background_downloading */ = { + isa = PBXGroup; + children = ( + 3DFACF44243CB1AB00A29A94 /* downloader_delegate_ios.mm */, + 3DFACF45243CB1AB00A29A94 /* downloader_subscriber_adapter_ios.h */, + 3DFACF46243CB1AB00A29A94 /* downloader_queue_ios.hpp */, + 3DFACF47243CB1AB00A29A94 /* downloader_adapter_ios.h */, + 3DFACF48243CB1AB00A29A94 /* downloader_delegate_ios.h */, + 3DFACF49243CB1AB00A29A94 /* downloader_adapter_ios.mm */, + 3DFACF4A243CB1AB00A29A94 /* downloader_subscriber_adapter_ios.mm */, + 3DFACF4B243CB1AB00A29A94 /* downloader_queue_ios.cpp */, + ); + path = background_downloading; + sourceTree = ""; + }; 67247FBD1C60B89B00EDE56A /* storage_tests */ = { isa = PBXGroup; children = ( @@ -626,6 +653,7 @@ 675342E21A3F59EF00A0A8C3 /* storage */ = { isa = PBXGroup; children = ( + 3DFACF43243CB1AB00A29A94 /* background_downloading */, 3DFACF3D243C985A00A29A94 /* downloader_queue_universal.cpp */, 3DFACF3C243C985A00A29A94 /* downloader_queue_universal.hpp */, 3DFACF3E243C985A00A29A94 /* downloader_queue.hpp */, @@ -663,8 +691,6 @@ 34B0931E1C61F9BA0066F4C3 /* storage_helpers.hpp */, 67AF49FE1BC579DD0048B1ED /* country_info_getter.cpp */, 67AF49FF1BC579DD0048B1ED /* country_info_getter.hpp */, - 674125181B4C05FA00A3E828 /* http_map_files_downloader.cpp */, - 674125191B4C05FA00A3E828 /* http_map_files_downloader.hpp */, 6741251A1B4C05FA00A3E828 /* map_files_downloader.hpp */, 6741251D1B4C05FA00A3E828 /* storage_defines.cpp */, 675342F21A3F5A2600A0A8C3 /* country_decl.cpp */, @@ -716,6 +742,7 @@ files = ( 674125201B4C05FA00A3E828 /* map_files_downloader.hpp in Headers */, 56D8CB9A1CAC17A80003F420 /* test_defines.hpp in Headers */, + 3DFACF50243CB1AB00A29A94 /* downloader_delegate_ios.h in Headers */, F68CC5C01F38B967007527C7 /* diff_types.hpp in Headers */, 3DFACF3F243C985A00A29A94 /* downloader.hpp in Headers */, 402AD2E424A200F600DE5CB1 /* country_tree_helpers.hpp in Headers */, @@ -723,9 +750,9 @@ 3DF528E22386B966000ED0D5 /* diffs_data_source.hpp in Headers */, 34C9BCFD1C6CCF85000DC38D /* country_name_getter.hpp in Headers */, 3DFACF40243C985A00A29A94 /* downloader_queue_universal.hpp in Headers */, - 6741251F1B4C05FA00A3E828 /* http_map_files_downloader.hpp in Headers */, 67BE1DC61CD2180D00572709 /* downloading_policy.hpp in Headers */, 675343191A3F5A2600A0A8C3 /* storage_defines.hpp in Headers */, + 3DFACF4E243CB1AB00A29A94 /* downloader_queue_ios.hpp in Headers */, 3DF528E12386B966000ED0D5 /* apply_diff.hpp in Headers */, 67247FD41C60BA8A00EDE56A /* task_runner.hpp in Headers */, 56D0E4801F8E40340084B18C /* routing_helpers.hpp in Headers */, @@ -736,6 +763,7 @@ 3D497EA223292706000FB57D /* map_files_downloader_with_ping.hpp in Headers */, 6753430A1A3F5A2600A0A8C3 /* country_decl.hpp in Headers */, 67247FCF1C60BA8A00EDE56A /* fake_map_files_downloader.hpp in Headers */, + 3DFACF4F243CB1AB00A29A94 /* downloader_adapter_ios.h in Headers */, 3DFACF42243C985A00A29A94 /* downloader_queue.hpp in Headers */, 67AF4A011BC579DD0048B1ED /* country_info_getter.hpp in Headers */, 3DD84014233A38DE0008D0ED /* diff_scheme_loader.hpp in Headers */, @@ -743,6 +771,7 @@ 402873442295A91F0036AA1C /* downloader_search_params.hpp in Headers */, 6753431B1A3F5A2600A0A8C3 /* storage.hpp in Headers */, 67247FD61C60BA8A00EDE56A /* test_map_files_downloader.hpp in Headers */, + 3DFACF4D243CB1AB00A29A94 /* downloader_subscriber_adapter_ios.h in Headers */, 34B093231C61F9BA0066F4C3 /* storage_helpers.hpp in Headers */, 402873422295A91F0036AA1C /* country_tree.hpp in Headers */, ); @@ -915,17 +944,20 @@ 34B093221C61F9BA0066F4C3 /* storage_helpers.cpp in Sources */, 675343091A3F5A2600A0A8C3 /* country_decl.cpp in Sources */, 3DCD414720D80C0900143533 /* country_info_reader_light.cpp in Sources */, + 3DFACF4C243CB1AB00A29A94 /* downloader_delegate_ios.mm in Sources */, + 3DFACF52243CB1AB00A29A94 /* downloader_subscriber_adapter_ios.mm in Sources */, 56DAC38523992819000BC50D /* queued_country.cpp in Sources */, 6753431A1A3F5A2600A0A8C3 /* storage.cpp in Sources */, 674125231B4C05FA00A3E828 /* storage_defines.cpp in Sources */, 3DFACF41243C985A00A29A94 /* downloader_queue_universal.cpp in Sources */, 3DCD414920D80C1B00143533 /* lightweight_matching_tests.cpp in Sources */, 67BE1DC51CD2180D00572709 /* downloading_policy.cpp in Sources */, + 3DFACF51243CB1AB00A29A94 /* downloader_adapter_ios.mm in Sources */, 402AD2E524A200F600DE5CB1 /* country_tree_helpers.cpp in Sources */, 402873432295A91F0036AA1C /* country_tree.cpp in Sources */, F6BC312C2034366100F677FE /* pinger.cpp in Sources */, + 3DFACF53243CB1AB00A29A94 /* downloader_queue_ios.cpp in Sources */, 34C9BCFC1C6CCF85000DC38D /* country_name_getter.cpp in Sources */, - 6741251E1B4C05FA00A3E828 /* http_map_files_downloader.cpp in Sources */, 3DF528E32386B966000ED0D5 /* diffs_data_source.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0;