John Firebaugh
ff15bd51b9
[core] Throttle the number of concurrent requests to 20
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
025375ad0b
[core] Cache with mapbox:// tile URLs
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
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
1766d7dcbf
[core] Eliminate RequestBase
...
HTTPRequestBase can now itself be the base class.
2016-01-21 11:22:11 -08:00
John Firebaugh
0066637e58
[core] Let SQLiteCache decide when store or refresh responses
2016-01-14 13:46:03 -08:00
John Firebaugh
2aafdbc1b8
[core] Add an explicit "not modified" indicator to Response
2016-01-14 13:46:03 -08:00
John Firebaugh
2ee1fe4178
[core] std::shared_ptr<const Response> ⇢ const 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
716a9c92cb
[core] Inline a temporary variable which is now used only once
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
2126e34e52
[core] Further clarify timeout calculations
2016-01-13 13:38:12 -08:00
John Firebaugh
54fc3831f2
[core] Use Seconds::max() rather than -1 for simpler logic
2016-01-13 13:38:12 -08:00
John Firebaugh
96781c0a8d
[core] Inline OnlineFileRequestImpl::setResponse
...
In the cache response case, we don't want the failedRequests logic; cached errors, should they occur, shouldn't affect the scheduling behavior for real requests.
2016-01-13 13:38:12 -08:00
John Firebaugh
601e3d9d45
[core] Refactor down to two methods for scheduling a cache or real request
2016-01-13 13:38:12 -08:00
John Firebaugh
682b2335e5
[core] Inline OnlineFileRequestImpl::getRetryTimeout
2016-01-13 13:38:12 -08:00
John Firebaugh
ea45075e4d
[core] Inline OnlineFileRequestImpl::checkResponseFreshness
2016-01-13 13:38:12 -08:00
John Firebaugh
6f9de6ae47
[core] Refactor to instance methods on OnlineFileRequestImpl
2016-01-13 13:38:12 -08:00
John Firebaugh
e9eb29719b
[core] Simplify logic for notification with pre-existing response
...
We already had a condition that checks if a response is immediately available for an incoming request. Call the callback there, rather than in addObserver.
2016-01-13 13:38:12 -08:00
John Firebaugh
dd3ca81589
[core] Inline sole use of OnlineFileSource::Impl::update
2016-01-13 13:38:12 -08:00
John Firebaugh
f8d3cf41ae
[core] Simplify OnlineFileSource::Impl::reschedule
2016-01-13 13:38:12 -08:00
Thiago Marcos P. Santos
d7fdcc73bf
[core] Get rid of ::unref() for Timer and AsyncTask
...
Not need, legacy from libuv. The RunLoop keep the main
loop running until is explicitly no longer needed.
2016-01-09 01:26:29 +02:00
John Firebaugh
0a8fef1f51
[core] Merge OnlineFileRequestImpl::notify into OnlineFileRequestImpl::setResponse
...
In every case where setResponse is called, notify was called soon after. In one case immediately, in another, after intervening functions which are safe to reorder after notifications.
The null-check of response is safe to eliminate because response must not be null inside setResponse.
2016-01-08 12:29:11 -08:00
John Firebaugh
adf3dea4e5
[core] Simplify OnlineFileSource's Timer use
...
There is no need for the timer to be created only under certain conditions. Stopping a non-started timer is a no-op. Therefore it can simply be a direct member.
While here, rename the variable. It's a timer, not a request.
2016-01-08 12:23:48 -08:00
Konstantin Käfer
a06f28ddb7
[core] only cache successful or NotFound responses
...
We don't want other types of error end up in our cache, since it'll likely evict perfectly good content.
2016-01-08 16:25:54 +01:00
Konstantin Käfer
4479f5db6c
[core] don't consult cache for asset resources
2016-01-08 13:05:51 +01:00
Konstantin Käfer
bc309d84d7
[core] unify URL prefix detection (asset:// and mapbox://)
2016-01-08 12:14:39 +01: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
c972a251da
[core] Remove Resource dependency from low-level classes
...
These classes should not be coupled to domain-specific resource types.
2015-12-23 14:30:20 -08:00
John Firebaugh
ab0efe5d00
[core] Move OnlineFileSource to platform
...
Preparation for OfflineFileSource which depends on SQLite
2015-12-22 12:09:14 -08:00