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
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
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
Brad Leege
aac6b00dd0
Merge branch 'hotfix/android_x86_64' of git://github.com/Malinskiy/mapbox-gl-native into Malinskiy-hotfix/android_x86_64
2016-01-13 10:06:08 -06: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
e7b0b31d58
[core] Privatize SQLiteCache
2016-01-08 12:31:13 -08: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
Anton Malinskiy
a6a3b8a80a
[android] Fixed x86_64 crash on startup: no implementation previously for cache's get/bind by chrono's seconds for x86_64. Explicitly cast to int64_t
2016-01-07 18:32:17 +07:00
Thiago Marcos P. Santos
a5987afeb9
[core] Added versioning to the cache database
...
Force drop the table when the version doesn't match. Previously
it was assumed (my bad) that CREATE TABLE IF NOT EXISTS would
compare the table schema, which is not true.
2016-01-05 17:32:46 +02: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
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
Bruno de Oliveira Abinader
20d2ceef4b
[osx] Use framebuffer width/height in GLFW port
...
Framebuffer width/height takes pixel ration in consideration.
Part of #3294 .
2015-12-18 15:31:36 -08:00
Thiago Marcos P. Santos
a903d2eef0
[glfw] Set viewport size from the Map thread
...
Setting the viewport size from the main thread has no affect
on Linux and thus, the map doesn't scale. We now set the
viewport size on the beforeRender() hook that gets called
from the Map thread.
2015-12-16 17:18:54 -08:00
Konstantin Käfer
4fc8226838
[core] allow changing the orientation
...
You can now change the orientation of north to be to the right, bottom, left in addition to the default of top
2015-12-15 11:41:58 -08:00
Mike Morris
f4d394d935
[node] code review cleanup
2015-12-15 10:19:56 -08:00
Konstantin Käfer
93c000dd18
[core] viewport is handled by embedding applications
2015-12-10 14:16:11 -08:00
Thiago Marcos P. Santos
0a97145d05
[core] Better C++ usage on RunLoop
...
Follow-up of #3179 .
2015-12-08 10:23:11 -08:00
Konstantin Käfer
c279fb1717
[core] throw values, catch references
2015-12-03 15:38:36 +01:00
Konstantin Käfer
0c351eb523
[core] use default instead of empty function body
2015-12-03 15:38:36 +01:00
Konstantin Käfer
478472e501
[core] add std::move to constructors
2015-12-03 15:38:36 +01:00
Konstantin Käfer
d5fb535058
[core] add namespace comment to closing brace
2015-12-03 15:38:36 +01:00
Konstantin Käfer
dc620f48de
[core] Fix std::move() misuse that disables copy elision
2015-12-03 15:38:36 +01:00
John Firebaugh
8afa14fa78
[core] Map::setSprite ⇢ Map::addAnnotationIcon
...
Fixes #3084
2015-12-01 15:10:28 -08:00
John Firebaugh
622f6691b7
[glfw] No longer necessary to wait for style load to add default marker
2015-12-01 09:15:05 -08:00
Thiago Marcos P. Santos
ed29223e5a
[core] Remove mbgl/util/uv.hpp
...
Now only a few things depend on libuv and they can use it directly.
2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
ab6477d906
[core] Removed libuv dependency from AssetZipContext
2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
c117b7e3f4
[core] Removed libuv dependency from AssetFSContext
2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
07c0424ab9
[core] Removed libuv dependency from HTTPCurl*
...
Moved the fd watcher to the RunLoop. So far only needs to
be implemented by platforms using HTTPCurlRequest et al.
2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
62990f0a21
[core] Port uv::tls to pthreads
2015-12-01 11:49:02 +02:00
John Firebaugh
1c63f98f6d
[core] Expose fewer RunLoop implementation details in header
2015-12-01 11:49:02 +02:00
John Firebaugh
f2553fff89
[core] Merge uv_detail.hpp into uv.hpp
2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
9c0eedf836
[curl] Make curl request less dependent on libuv
2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
9b36c19aeb
[core] Introduce Timer abstraction
2015-12-01 00:00:09 +02:00