summaryrefslogtreecommitdiff
path: root/include/mbgl/storage
Commit message (Collapse)AuthorAgeFilesLines
* [core] move from microsecond precision timestamp to integer second precisionKonstantin Käfer2016-05-132-6/+14
|
* [core] retain tiles differently and remove old TileID classKonstantin Käfer2016-05-101-1/+1
|
* [core] Refactor getRegionCompletedStatus; add completedTileCount; add testsJohn Firebaugh2016-04-271-2/+10
|
* [ios, osx] Add a property for bytes used by offline tilesBrent Whitman2016-04-271-1/+6
|
* [core] Use the proper type for font stacksJohn Firebaugh2016-04-221-1/+2
|
* [core] Remove internal threading from OnlineFileRequestJohn Firebaugh2016-04-141-6/+2
| | | | There's no need to do the work that OnlineFileRequest does on a separate thread from the DefaultFileSource thread, and having AsyncTasks proxy to other tasks across a thread boundary adds needless complexity.
* [core] Unify FileRequest and WorkRequestJohn Firebaugh2016-03-243-9/+5
|
* [core] Remove goOffline() from DefaultFileSourceThiago Marcos P. Santos2016-03-082-3/+2
| | | | Use the newly added NetworkStatus::Set().
* [core] Add client defined network statusThiago Marcos P. Santos2016-03-081-0/+10
| | | | | | | | This API will let the client force a network status. If set to Offline, we won't make network requests. When set make to Online, it will trigger the pending requests and try to fetch tiles from the network.
* [core] Limit total number of offline Mapbox tilesJohn Firebaugh2016-02-242-0/+22
|
* [core] status.requiredResourceCountIsIndeterminate ⇢ ↵John Firebaugh2016-02-241-6/+7
| | | | | | status.requiredResourceCountIsPrecise Change the name and reverse the sense. Naming things in the positive is better than naming them in the negative.
* [core] Add a descriptive comment about maximumCacheSizeJohn Firebaugh2016-02-241-0/+7
|
* [core] use std::move() to prevent copiesKonstantin Käfer2016-02-111-1/+1
|
* [core] Eliminate maximumCacheEntrySizeJohn Firebaugh2016-02-101-2/+1
| | | | Instead, the eviction policy accounts for the actual size needed for an incoming put.
* [core] Implement an eviction policy for OfflineDatabaseJohn Firebaugh2016-02-101-20/+9
| | | | | | | | | | | | | When inserting an cached resource, or removing a region, remove least-recently used resources and tiles, not used by offline regions, until the used database size, as calculated by multiplying the number of in-use pages by the page size, is less than the maximum cache size minus 5 times the page size. In addition, OfflineDatabase may be configured to ignore cache puts of individual resources larger than a certain size. This policy is similar but not identical to the former SQLiteCache policy: * It accounts for offline, by exempting resources required by offline regions from eviction. * It must delete from two tables (resources and tiles), rather than one. Currently the strategy is naive: evict 50 rows at a time from each table. * It makes maximumCacheSize and maximumCacheEntrySize completely independent. The SQLiteCache implementation evicted when `usedSize > maximumCacheSize - 2 * maximumCacheEntrySize`. This evicts when `usedSize > maximumCacheSize - 5 * pageSize`. * It uses a non-unlimited default value for maximumCacheSize: 50 MB. We should have always had a limit in place; "a cache without an eviction policy is a resource leak".
* [core] Make {Default,Online}FileSource::Impl more similarJohn Firebaugh2016-02-101-3/+0
|
* Add binary for smoke-testing offline downloadsJohn Firebaugh2016-02-101-0/+2
|
* [core] Interface and implementation for offlineJohn Firebaugh2016-02-102-0/+258
|
* [all] Don't interpret 404s on non-tile resources as "no content"John Firebaugh2016-02-101-0/+4
|
* [all] Do not set Response data for 404sJohn Firebaugh2016-02-101-1/+1
| | | | For AssetFileSource and the node FileSource this was already the case; this makes the other implementations consistent.
* [core] Reimplement existing caching within an offline-capable database schemaJohn Firebaugh2016-02-101-6/+9
|
* [core] Moving caching logic to DefaultFileSourceJohn Firebaugh2016-02-103-5/+10
| | | | This results in OnlineFileSource containing precisely the logic we want for reuse by OfflineFileSource, and no more.
* [core] Remove Response::Error::Reason::CanceledJohn Firebaugh2016-02-041-1/+0
| | | | There is no such thing as a cancelled response, only cancelled requests. A request that is cancelled does not have its callback called with a Response.
* [core] Change TileData pixelRatio to an integerJohn Firebaugh2016-01-291-1/+1
|
* [core] Rationalize Resource initializationJohn Firebaugh2016-01-291-14/+27
|
* [core] Ensure that FileSource has access to tile URL, pixelRatio, x, y, zJohn Firebaugh2016-01-291-0/+12
|
* [core] Include prior values of caching headers in ResourceJohn Firebaugh2016-01-222-14/+15
| | | | This allows the FileSource interface itself to support revalidation. We could (and probably should) now rewrite HTTPContextBase implementations as FileSource implementations.
* [core] Use better types for modified / expires / etagJohn Firebaugh2016-01-211-3/+4
|
* [core] Eliminate Response::stale and inline Response::isExpired()John Firebaugh2016-01-211-5/+0
| | | | Response::isExpired() had subtle and potentially confusing behavior around Seconds::zero(). It's best to inline it and comment why.
* [core] Add an explicit "not modified" indicator to ResponseJohn Firebaugh2016-01-141-0/+3
|
* [core] Eliminate FileCache interfaceJohn Firebaugh2016-01-142-30/+3
| | | | There is only one implementation and we're unlikely to add more.
* [core] Remove request coalescing in OnlineFileSourceJohn Firebaugh2016-01-131-1/+1
|
* [core] Eliminate platform::assetRoot()John Firebaugh2016-01-131-1/+1
| | | | I regenerated assets.zip so that all file paths have an `assets/` prefix, as the Android AssetFileSource implementation asserts, and removed `TEST_DATA` from the paths.
* [core] Simplify asset:// implementationJohn Firebaugh2016-01-131-1/+1
| | | | | | | | * Move asset:// URL handling to DefaultFileSource. * AssetFileSource implements FileSource interface and follows familiar implementation patterns. * Move default implementation to platform/default, zip implementation to platform/android. * Don't bother with modified / expires / etag -- assets are not cached so it doesn't matter. * Don't bother with interleaving individual IO calls on the implementation thread. That adds a lot of complexity for very little benefit.
* [core] Refactor to instance methods on OnlineFileRequestImplJohn Firebaugh2016-01-131-0/+2
|
* [core] Privatize SQLiteCacheJohn Firebaugh2016-01-082-47/+4
|
* [core] Make it possible to limit the size of the SQLite cacheThiago Marcos P. Santos2015-12-271-0/+3
|
* [tests] Test with OnlineFileSourceJohn Firebaugh2015-12-231-0/+34
| | | | | When we introduce OfflineFileSource, the behavior of existing tests should not change.
* [core] Prepare for OfflineFileSourceJohn Firebaugh2015-12-211-14/+7
| | | | | * Rename existing DefaultFileSource to OnlineFileSource * Restore a DefaultFileSource that's a passthrough to OnlineFileSource
* [core] add namespace comment to closing braceKonstantin Käfer2015-12-036-9/+9
|
* [core] Removed dependency on uv_loop from the file sourceThiago Marcos P. Santos2015-12-011-6/+8
|
* [core] Replace time_t with std::chrono::secondsBruno de Oliveira Abinader2015-11-271-2/+4
| | | | | | | Added aliases for std::chrono typedefs (eg. 'Seconds' for std::chrono::seconds). These aliases are used together with templated helper functions to replace time_t with std::chrono::seconds for most cases, in particular for 'modified' and 'expires' values in Response.
* [core] Use std::unique_ptr for FileSource requestJohn Firebaugh2015-11-163-68/+18
|
* [core] Pass a value to response callback, not a referenceJohn Firebaugh2015-11-162-2/+2
|
* [core] Do not pass uv_loop_t aroundThiago Marcos P. Santos2015-11-162-4/+2
| | | | This should be abstracted by util::RunLoop
* [core] move retry logic to DefaultFileSourceKonstantin Käfer2015-11-022-6/+33
|
* [core] reparse tiles when new data arrivesKonstantin Käfer2015-10-261-0/+1
| | | | We're now reparsing tiles when they expire. We're also swapping out buckets atomically to avoid flickering data; i.e. we're displaying the old data as long as we don't have a new parsed bucket for that layer yet. The parsed buckets now live in the *TileData objects rather than in the TileWorker; only partially parsed == pending buckets will remain in the TileWorker. Once they're parsed, they're moved to the *TileData object.
* [core] Make response data shared to avoid excessive copyingKonstantin Käfer2015-10-261-1/+1
|
* [core] do not use std::atomic_* with shared_ptrsKonstantin Käfer2015-10-261-4/+4
| | | | It's not implemented in GCC 4.9.2's stdlib (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57250). Instead, we're now always using a mutex to protect access; we previously created a mutex only on cancelation, but since we're always canceling now, it makes sense to allocate it right away.
* [core] add support for stale responsesKonstantin Käfer2015-10-261-0/+4
| | | | We're now returning stale responses from cache. Those responses will have the `stale` flag set to true. Currently, all requesters in the core code discard stale responses, and cancel the request immediately after they got a non-stale response.