| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
| |
Introduces "optional" requests. These should be fulfilled by the FileSource only there's a low-cost/easy way to obtain the data (e.g. from a local cache). If the data for an optional request cannot be found, it *must* return a Response object with a NotFound error.
Traditional "required" requests still work the same way, with one change: If you set any prior* field in the Resource (i.e. priorModified, priorEtag, or priorExpires), the DefaultFileSource assumes that you already have the cache value and will not consult the cache before performing the request. If a prior cache lookup didn't turn up any data, and you therefore don't have an Etag or Modified value, you can still skip the cache by setting priorExpires. This will of course always result in a non-conditional HTTP request.
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
No progress events should be processed after deleting a region.
|
|/ |
|
|
|
|
|
| |
The user can now force the Offline mode and set it back
to Online, triggering the requests waiting for network connection.
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
| |
When we introduce OfflineFileSource, the behavior of existing tests should
not change.
|
|
Preparation for OfflineFileSource which depends on SQLite
|