Mikhail Pozdnyakov
3bf9143079
Emit error message with URL details on load error 404
2020-02-28 12:52:26 +02:00
Mikhail Pozdnyakov
2b1bb1dc4a
[core][offline] Offline download does not hang on 404 error
2020-02-28 12:52:26 +02:00
Mikhail Pozdnyakov
ba4f5efa09
[core] OnlineFileSource is never accessed directly
2020-02-26 22:31:59 +02:00
Mikhail Pozdnyakov
7c48611f9e
[core] Consolidate file source keys in the generic FileSource header
...
Thus we do not need to include specific headers to use `{set|get}Property`
API with key constants.
2020-02-25 23:15:47 +02:00
Mikhail Pozdnyakov
3c05bd984a
[core] Fix offline region download freezing
...
Downloaded resources are put in the buffer and inserted in the database in batches.
Before this change, the buffer was flushed only at the network response callback
and thus it never got flushed if the last required resources were present locally
and did not initiate network requests -> it caused freezing.
Now the buffer is flushed every time the remaining resources container gets empty.
2020-02-25 23:15:47 +02:00
Alexander Shalamov
89eab0530d
[core] Set priorData from cache only if resource is useable
...
In cases when cached resource is useable, yet don't have an expiration
timestamp, we provided data to the requester from the cache and the same
data was returned once 304 response was received from the network.
2020-02-14 11:54:02 +02:00
Mikhail Pozdnyakov
c04551a4e3
Expose READ_ONLY_MODE_KEY property for DatabaseFileSource
2020-02-07 14:39:03 +02:00
Alexander Shalamov
534003495b
[core] Switch unordered_map to map
...
Change container types where number of elements expected
to be rather small. For instance, number of offline packs
or sql statements.
2020-02-06 23:54:19 +02:00
Alexander Shalamov
bb85ec442d
[core] Add hooks for setting experimental thread priorities for mbgl threads
2020-02-06 23:54:19 +02:00
Alexander Shalamov
9ec2e2aff7
[core] Add pause and resume to database filesource implementation
2020-01-27 14:25:37 +03:00
Alexander Shalamov
7bf4de9f39
[core] Move resource loader to dedicated thread with scheduler
2020-01-23 12:55:57 +03:00
Alexander Shalamov
879c44f661
[core] Modularize FileSource codebase ( #15768 )
...
* [core] Introduce FileSourceManager and use it for default platform impl
- Add `FileSourceManager` interface that provides access to `FileSource`
instances and means of registering / unregistering `FileSource` factories
- Split `DefaultFileSource` into smaller parts
- Add `DatabaseFileSource` interface and it's default implementation
- Remove inter-dependencies between concrete `FileSource` classes
* [build] Add files to next build system
* [core] Add generic property setters / getters
* [core] Remove setOnlineStatus from OnlineFileSource interface
* [core] Hide threading implementation details from DatabaseFileSource interface
* [core] Make DB file source methods virtual
* [core] Add documentation for DatabaseFileSource and rename one method
* [core] Use simple callback instead of ActorRef
* [core] Remove ActorRef from OnlineFileSource public header
* [core] Add callback to FileSource::forward async API
* [core] Pass OfflineRegionDefinition by value
* [core] Update tests to use modular file sources
* [core] Update unit tests
* [core] Update unit tests after rebase
* [core] Backport low prio fix for cached requests
* [core] Backport pack database
* [core] Return removed factory from unRegisterFileSourceFactory
* [core] Rename shadowed args in onlinefilesource
* [core] Remove simple std::function callback aliases
* [core] Expose online file source property keys in public header file
* [test-runner] Add proxy file source test runner
* [cache] Update mbgl-cache utility to use new file source
* [metrics] Rebaseline binary size metrics
* [offline] Update offline utility
* [core] Update changelog
2020-01-13 10:57:23 +02:00
Thiago Marcos P. Santos
d08bb49c34
[core] Make it possible to reopen the database read-only for testing
...
Needed for Android, because the database is in readonly filesystem
and also because it is annoying to see files modified every time we
run the tests.
2020-01-08 13:07:12 +02:00
Mikhail Pozdnyakov
28ccb0ccc0
[core] Offline download must clear batch buffer at load interrupt
...
Otherwise, the stale buffer data are processed again at the
repeated load. It is causing various problems like missing load
completion notification or crashes (if the previously used observer
instance has been deleted).
2019-12-18 17:19:15 +02:00
Mikhail Pozdnyakov
4c49f0c9db
[core] Introduce OfflineDatabase::runPackDatabaseAutomatically() API
...
- added a unit test
- Updated inline comments in default_file_source.hpp
2019-12-02 13:46:51 +02:00
Juha Alanen
bdd7e53078
[core] Set the priority of online requests for existing resource to low
2019-11-21 14:39:47 +02:00
Juha Alanen
69d980cdc1
[core] Add new method to DefaultFileSource
...
Add setMaximumConcurrentRequests() method for setting it on the
OnlineFileSource.
2019-11-21 14:39:47 +02:00
Juha Alanen
451e6d40fa
[core] Notify requests about network reachability only when coming back online
2019-11-21 14:39:47 +02:00
Mikhail Pozdnyakov
f567a79dd8
[core] Extend DefaultFileSource API
...
Add `packDatabase()` method and `bool pack` argument to the `deleteOfflineRegion()` method.
2019-11-12 17:24:50 +02:00
Mikhail Pozdnyakov
615e095ed6
[core] OfflineDatabase pack API
...
- introduce `OfflineDatabase::pack()` standing for incremental vacuum
- make pack optional at offline region deletion
- update `OfflineDatabase.DeleteRegion` test accordingly to the items above
2019-11-12 17:24:50 +02:00
Mikhail Pozdnyakov
e1556fc539
[core] Improve OfflineDatabase error handling
...
- fixes missing exception handlers (e.g. runtim error from the `initialize()` method)
- introduces generic exception handling mechanism to reduce the repeated code
2019-11-11 15:33:55 +02:00
Mikko Pulkki
4176b28a77
[Linux] Remove CA certificate bundle
2019-11-11 10:11:49 +02:00
Mikhail Pozdnyakov
55e18a6f81
[core] Use expected.hpp from mapbox-base
2019-11-08 11:27:30 +02:00
Mikhail Pozdnyakov
ab603c5fed
[core] Enable incremental vacuum for Offline DB
...
Thus we avoid re-creating the whole database and keeping the backup file as it happens on calling VACUUM.
2019-10-22 15:51:16 +03:00
Thiago Marcos P. Santos
c7bbd5bbef
[core] Fix performance-move-const-arg
2019-09-25 18:59:07 +03:00
Julian Rex
2b08c1d7bf
[ios, macos] Fix MGLOfflinePack invalidate crash ( #15582 )
2019-09-18 18:13:07 -04:00
Thiago Marcos P. Santos
83a019d021
[build] Fix clang format and tidy checks
2019-09-17 12:28:55 +03:00
Thiago Marcos P. Santos
5cf2c7eb50
[build] Use the system CURL on Linux
...
And we don't need to use Mason anymore.
2019-09-17 12:28:55 +03:00
Bruno de Oliveira Abinader
544aabd020
[core] Add requiredTileCount to OfflineRegionStatus
2019-08-29 18:22:59 +03:00
Mikhail Pozdnyakov
42ba8a7d12
[core] const variables for OfflineDownload batch sizes
2019-08-29 17:28:51 +03:00
Mikhail Pozdnyakov
f84e46ad26
[core] Mark offline region resources in batches
2019-08-29 17:28:51 +03:00
Mikhail Pozdnyakov
0c80f3a383
[core] Add OfflineDatabase::markUsedResources()
2019-08-29 17:28:51 +03:00
Mikhail Pozdnyakov
62e1e03c09
[core] Move semantics for OfflineDownload::ensureResource()
2019-08-29 17:28:51 +03:00
Dane Springmeyer
1165f62df6
[core][test] fix leaks from sqlite usage
2019-08-16 15:51:42 +03:00
Bruno de Oliveira Abinader
6f0cda8c8b
[build] Use mapbox-base optional
2019-07-29 18:36:08 +03:00
Bruno de Oliveira Abinader
1a9e07e4ed
[core] DefaultFileSource dynamic support for cache-only requests
2019-06-25 20:10:21 +03:00
Thiago Marcos P. Santos
ea63541ad1
[core] Fix offline regions reporting the wrong number of tiles
...
- The SQL query used for checking if the tile was already in the
cache was wrong.
- Tiles being refereed by two or more regions were not always
counted as one.
Fixes #13437 .
2019-06-19 17:19:10 +03:00
Thiago Marcos P. Santos
68e3cbacbc
[core] Add method for setting a maximum size for the ambient cache
...
- Removed this parameter from the constructor, now that we
have a method to set it.
- Add the method and enforce the limits if the ambient cache exceeds the
size.
2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
78eeffe171
[core] Clear/Invalidate should also work on non-tile resources
...
These methods were only affecting tiles, but they should really
work on every resource like style, glyphs, etc.
2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
59e7b9a878
[core] Rename resetCache to resetDatabase
...
Avoid confusion about what is being reset. In this case, the whole
database and not only the ambient cache.
2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
bf0be56946
[core] Fix bug of auto_vacuum not working
2019-06-13 22:28:16 +03:00
Thiago Marcos P. Santos
5b4bb1398b
[core] Surface cache management APIs
...
These APIs need to be on the DefaultFileSource in order to
be visible for the SDKs bindings.
2019-06-13 22:28:16 +03:00
Thiago Marcos P. Santos
32e0b7beec
[core] Add API for clearing tile cache
2019-06-13 22:28:16 +03:00
Konstantin Käfer
844299f1c3
[build] remove roundtrip through <experimental/optional> when using optional
2019-06-12 12:04:07 +02:00
Thiago Marcos P. Santos
cc26ef17d5
[core] Introduce usage tag for resources
...
Make the distinction if a resource is being requested for offline
usage or if it will be used immediately.
Fixes #14746
2019-05-28 16:30:49 +03:00
Łukasz Paczos
46ef2d86d2
[core] invoke optional resource path change completion listener
2019-05-24 15:03:55 +02:00
Thiago Marcos P. Santos
1def782cf2
[core] Add API for invalidating tiles
...
Add new APIs for invalidating tiles, effectively forcing Mapbox
GL Native to check with the servers if the tiles are valid before
using them. This is more efficient then deleting tiles, because
in case of valid tiles, they won't get downloaded.
Fixes #4376 .
2019-05-21 01:04:01 +03:00
Mikhail Pozdnyakov
b41f39d545
[core] Make ActorRef methods const
...
So that the lambdas calling these methods do not have to be mutable.
2019-05-10 11:59:02 +03:00
Sudarsana Babu Nagineni
2604991b2b
[core] Introduce resetCache API
...
Add an API to delete existing database and re-initialize.
2019-04-29 17:09:58 +03:00
Konstantin Käfer
3ceabcd3ec
[core] clang-tidy fixes
2019-04-05 11:49:17 +02:00