| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Previously, we used the existence of a `prior*` field in the Resource object as an indication for whether we should consult the cache or not. However, this is prone to error, since a failed cache lookup won't set any prior fields. Therefore, we manually set `priorExpires` to 0. This in turn triggered another bug where generated wrong expiration timestamps when the server response we got was expired (or expired between sending and receiving).
This commit changes the flags so that we can now explicitly request CacheOnly/NetworkOnly (or All) loading methods, rather than the implicit Optional/Required naming scheme.
|
|
|
|
| |
This functionality is used for testing to ensure correct offline behavior when connectivity is missing.
|
|
|
|
|
| |
Based on the actor model, can be considered safer to use since
we don't need to worry about object lifetime anymore.
|
|
|
|
|
| |
Now that the old Thread class is gone, we can give ThreadedObject
a better name.
|
|
|
|
| |
Fixes #6426
|
| |
|
|
|
|
| |
requests
|
| |
|
| |
|
|
|
|
|
| |
This caches the base URL and access token values when they are set
so that they can still be retrieved even when the thread is paused.
|
|
|
|
|
| |
It will halt the networking thread completely. Expired and error'ed
tiles won't get re-requested until resume() is called again.
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
add runloop to test
|
| |
|
| |
|
| |
|
|
|
|
| |
Use the newly added NetworkStatus::Set().
|
| |
|
| |
|
|
|
|
| |
Instead, the eviction policy accounts for the actual size needed for an incoming put.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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".
|
| |
|
| |
|
|
|
|
| |
This results in OnlineFileSource containing precisely the logic we want for reuse by OfflineFileSource, and no more.
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
* Rename existing DefaultFileSource to OnlineFileSource
* Restore a DefaultFileSource that's a passthrough to OnlineFileSource
|
| |
|
| |
|
|
|
|
| |
This should be abstracted by util::RunLoop
|
| |
|
|
|
|
|
| |
There are no longer any requests made that don't have a run loop to
dispatch back to.
|
|
|
|
| |
Fixes #1336
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
we are now scoping all file requests to an environment object. The FileSource implementation treats
this as an opaque pointer, but allows canceling all Requests that are associated with that pointer.
This is necessary to abort all file requests that originated from a particular Map object. Aborting
a file request is different from canceling a file request: A canceled request doesn't have its
callback called, while an aborted request will have its callback called with an error, indicating
that the environment is going to be shut down.
|
| |
|
|
|