John Firebaugh
86cccc4d24
[core] Don't allow style mutations to be overwritten by revalidation
...
* Once we get a fresh style, stop revalidating.
* If the style is mutated, stop revalidating and preserve the existing mutations.
2016-08-23 09:55:32 -07:00
Konstantin Käfer
18176605f6
[core] support "scheme": "tms" in TileJSON files
2016-08-16 11:04:30 +02:00
Thiago Marcos P. Santos
389c7615eb
[core] Revert workaround for std::atomic on ARMv5
...
Got fix on r12.
https://github.com/android-ndk/ndk/issues/31
2016-07-13 17:56:51 +03:00
John Firebaugh
6eab895bc0
[core] Use Range<uint8_t> instead of full Tileset where possible
2016-06-14 11:25:45 -07:00
Bruno de Oliveira Abinader
4161d197fd
[tidy] Check modernize-pass-by-value
...
Ref: http://clang.llvm.org/extra/clang-tidy/checks/modernize-pass-by-value.html
2016-06-13 23:32:05 +03:00
Konstantin Käfer
91895b9aec
[core] only perform optional requests if the FileSource supports it
2016-06-10 12:42:14 +02:00
Brad Leege
d67b88dba9
Merge branch 'release-android-v4.1.0'
...
# Conflicts:
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BaseMarkerViewOptions.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
# platform/android/src/jni.cpp
# src/mbgl/geometry/buffer.hpp
# src/mbgl/geometry/glyph_atlas.cpp
# src/mbgl/geometry/glyph_atlas.hpp
# src/mbgl/geometry/line_atlas.cpp
# src/mbgl/geometry/vao.cpp
# src/mbgl/gl/gl_object_store.cpp
# src/mbgl/gl/gl_object_store.hpp
# src/mbgl/renderer/frame_history.cpp
# src/mbgl/shader/shader.cpp
# src/mbgl/sprite/sprite_atlas.cpp
# src/mbgl/sprite/sprite_atlas.hpp
# src/mbgl/text/glyph_pbf.hpp
2016-06-09 14:00:49 -05:00
Thiago Marcos P. Santos
b711979e32
[android] #5254 - fix ARMv5 support
...
Backported patches fixing ARMv5 support for issue #3985 .
2016-06-06 23:31:51 +03:00
John Firebaugh
c902f9098b
[core] Rationalize naming for style-related code
2016-06-02 14:51:39 -07:00
Konstantin Käfer
e2bcea90fc
[core] use #pragma once instead of ifdef include guards
2016-05-25 21:35:37 +02:00
Konstantin Käfer
cd65a43855
[core] move from microsecond precision timestamp to integer second precision
2016-05-13 17:24:22 +02:00
Konstantin Käfer
7332ae0073
[core] retain tiles differently and remove old TileID class
2016-05-10 14:50:56 +02:00
John Firebaugh
b39f22e6b6
[core] Refactor getRegionCompletedStatus; add completedTileCount; add tests
2016-04-27 13:41:29 -07:00
Brent Whitman
a706a2a48d
[ios, osx] Add a property for bytes used by offline tiles
2016-04-27 13:41:29 -07:00
John Firebaugh
5939dd5b41
[core] Use the proper type for font stacks
2016-04-22 15:53:18 -07:00
John Firebaugh
6d88a23a60
[core] Remove internal threading from OnlineFileRequest
...
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.
2016-04-14 14:18:19 -07:00
John Firebaugh
169755e89a
[core] Unify FileRequest and WorkRequest
2016-03-24 10:54:32 -07:00
Thiago Marcos P. Santos
b8b283588f
[core] Remove goOffline() from DefaultFileSource
...
Use the newly added NetworkStatus::Set().
2016-03-08 10:31:01 -03:00
Thiago Marcos P. Santos
fa7c40c37f
[core] Add client defined network status
...
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.
2016-03-08 10:31:01 -03:00
John Firebaugh
065cda83fa
[core] Limit total number of offline Mapbox tiles
2016-02-24 13:38:14 -08:00
John Firebaugh
65c06e6270
[core] status.requiredResourceCountIsIndeterminate ⇢ status.requiredResourceCountIsPrecise
...
Change the name and reverse the sense. Naming things in the positive is better than naming them in the negative.
2016-02-24 13:38:14 -08:00
John Firebaugh
5a6cee0dd0
[core] Add a descriptive comment about maximumCacheSize
2016-02-24 13:38:14 -08:00
Konstantin Käfer
5726d2b357
[core] use std::move() to prevent copies
2016-02-11 12:17:33 +01:00
John Firebaugh
a9e0c1b99a
[core] Eliminate maximumCacheEntrySize
...
Instead, the eviction policy accounts for the actual size needed for an incoming put.
2016-02-10 15:40:20 -08:00
John Firebaugh
db3620c58f
[core] Implement an eviction policy for OfflineDatabase
...
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".
2016-02-10 15:40:20 -08:00
John Firebaugh
5d42321b73
[core] Make {Default,Online}FileSource::Impl more similar
2016-02-10 15:40:20 -08:00
John Firebaugh
c91b44b02f
Add binary for smoke-testing offline downloads
2016-02-10 15:40:20 -08:00
John Firebaugh
c3c4c7b9a6
[core] Interface and implementation for offline
2016-02-10 15:40:20 -08:00
John Firebaugh
e9302c797f
[all] Don't interpret 404s on non-tile resources as "no content"
2016-02-10 15:40:20 -08:00
John Firebaugh
7eb1a91c4e
[all] Do not set Response data for 404s
...
For AssetFileSource and the node FileSource this was already the case; this makes the other implementations consistent.
2016-02-10 15:40:20 -08:00
John Firebaugh
cdedb66387
[core] Reimplement existing caching within an offline-capable database schema
2016-02-10 15:40:20 -08:00
John Firebaugh
dbb8e58aea
[core] Moving caching logic to DefaultFileSource
...
This results in OnlineFileSource containing precisely the logic we want for reuse by OfflineFileSource, and no more.
2016-02-10 15:40:20 -08:00
John Firebaugh
4d29c7d5ce
[core] Remove Response::Error::Reason::Canceled
...
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.
2016-02-04 13:18:14 -08:00
John Firebaugh
2920020fb8
[core] Change TileData pixelRatio to an integer
2016-01-29 17:16:06 -08:00
John Firebaugh
b41a73e1c1
[core] Rationalize Resource initialization
2016-01-29 14:50:15 -08:00
John Firebaugh
849e8b32b4
[core] Ensure that FileSource has access to tile URL, pixelRatio, x, y, z
2016-01-29 14:50:15 -08:00
John Firebaugh
a877b9b192
[core] Include prior values of caching headers in Resource
...
This allows the FileSource interface itself to support revalidation. We could (and probably should) now rewrite HTTPContextBase implementations as FileSource implementations.
2016-01-22 18:42:53 -08:00
John Firebaugh
1c21d0fd4c
[core] Use better types for modified / expires / etag
2016-01-21 11:22:11 -08:00
John Firebaugh
c33ed50c98
[core] Eliminate Response::stale and inline Response::isExpired()
...
Response::isExpired() had subtle and potentially confusing behavior around Seconds::zero(). It's best to inline it and comment why.
2016-01-21 11:22:11 -08:00
John Firebaugh
2aafdbc1b8
[core] Add an explicit "not modified" indicator to Response
2016-01-14 13:46:03 -08:00
John Firebaugh
7fb5e973ed
[core] Eliminate FileCache interface
...
There is only one implementation and we're unlikely to add more.
2016-01-14 13:46:03 -08:00
John Firebaugh
618902e06c
[core] Remove request coalescing in OnlineFileSource
2016-01-13 13:43:05 -08:00
John Firebaugh
5a7d2fd60e
[core] Eliminate platform::assetRoot()
...
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.
2016-01-13 13:40:31 -08:00
John Firebaugh
86c8446d3a
[core] Simplify asset:// implementation
...
* 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.
2016-01-13 13:40:31 -08:00
John Firebaugh
6f9de6ae47
[core] Refactor to instance methods on OnlineFileRequestImpl
2016-01-13 13:38:12 -08:00
John Firebaugh
e7b0b31d58
[core] Privatize SQLiteCache
2016-01-08 12:31:13 -08:00
Thiago Marcos P. Santos
6d0b01c5fb
[core] Make it possible to limit the size of the SQLite cache
2015-12-27 18:15:33 +02:00
John Firebaugh
7a6076ea9d
[tests] Test with OnlineFileSource
...
When we introduce OfflineFileSource, the behavior of existing tests should
not change.
2015-12-23 14:55:12 -08:00
John Firebaugh
913f49c701
[core] Prepare for OfflineFileSource
...
* Rename existing DefaultFileSource to OnlineFileSource
* Restore a DefaultFileSource that's a passthrough to OnlineFileSource
2015-12-21 11:35:00 -08:00
Konstantin Käfer
d5fb535058
[core] add namespace comment to closing brace
2015-12-03 15:38:36 +01:00