Commit Graph

161 Commits

Author SHA1 Message Date
Mike Morris
7315212cb8 Merge pull request #136 from mapbox/mbgl-v0.3.5
bump mbgl to v0.3.5
2015-06-16 15:35:19 -04:00
Mike Morris
a25fa2e076 bump mbgl to v0.3.5
add geojsonvt dependency in Makefile

update changelog
2015-06-16 14:21:27 -04:00
Mike Morris
254a437051 Merge pull request #135 from mapbox/travis-publish
fix clang CXX matching
2015-06-16 13:35:57 -04:00
Mike Morris
7be5f15e50 fix clang CXX matching [publish binary]
explicitly set CXX on OS X
2015-06-16 12:54:00 -04:00
Mike Morris
b8c45b6273 match all clang++ versions [publish binary] 2015-06-15 17:56:22 -04:00
Mike Morris
6f4e727654 add npm badge [skip ci] 2015-06-15 17:15:58 -04:00
Mike Morris
5c8107ee3b v1.1.0 [publish binary] 2015-06-15 17:04:53 -04:00
Mike Morris
a29c7c34dc Merge pull request #130 from mapbox/changelog
update changelog and readme
2015-06-15 16:57:47 -04:00
Mike Morris
73abfc3d08 update changelog and readme [skip ci]
- Document Node.js v0.12.x and io.js support
- Document map.release functionality.
- Add notes on garbage collection and request handling.
- Update binary platforms and build instructions.
- Document API token FileSource implementation from
  https://github.com/mapbox/mapbox-gl-native/pull/1607
- Update Kind enum values.
2015-06-15 16:53:40 -04:00
Mike Morris
e2c56742a8 Merge pull request #129 from mapbox/129-pending_requests_hanging
Map destruction hanging with pending requests
2015-06-15 16:47:53 -04:00
Mike Morris
e06bf232f4 request coalescing fixes #114 2015-06-15 14:52:35 -04:00
Thiago Marcos P. Santos
a6ea979ec5 Add test case for the request coalescing 2015-06-15 13:54:20 +03:00
Thiago Marcos P. Santos
0d2543675f Update the tests
Reflect the changes on the previous MBGL version bump and
unskip tests that should pass now.
2015-06-15 13:54:20 +03:00
Thiago Marcos P. Santos
b602835626 Fix invalid NodeRequest reference
On the code path built with node v0.12.4, we are storing
an invalid reference to NodeRequest on the "pending" list. It will
crash when we need to access it like we do when canceling a request.

Ideally we should just have a "std::unordered_map<mbgl::Resource,
v8::UniquePersistent>" but that is not possible because the move
semantics are not fully implemented until V8 v4.3.22. It can be used
on a std::vector but not on a std::map.

See: https://code.google.com/p/v8/issues/detail?id=3669

The solution for keep using C++11 move semantics is to declare the
v8::CopyablePersistentTraits shenanigans and explicitly clear the
v8::Persistent (like we do already for node v0.10).

When Node gets V8 v4.3.22+ we can go back to v8::UniquePersistent
with a more clear implementation.
2015-06-15 13:54:20 +03:00
Thiago Marcos P. Santos
34ef7ac003 Implement request coalescing and synchronous request cancellation
When requests are made to the FileSource, we now group them by
resource, similarly to what is done on the native implementation. The
file source will reuse the same Response for all the requests on the
observer list.

The NodeRequest no longer holds a reference to the mbgl::Request, so
we can cancel it synchronously. This is needed to avoid a deadlock
when releasing the NodeMap resources with pending requests.

Before:

- Main thread | NodeMap::release()
- Main thread | mbgl::~Map()
- Main thread | Blocks waiting for the Map thread to join
- Map thread  | mbgl::Request::cancel()
- Map thread  | NodeFileSource posts the "cancel" message to main thread
- *deadlock*  | Map thread cannot join because mbgl::Request holds a
                reference to the Map thread main loop. Main thread is
                blocked, never gets the "cancel" message.

Now:

- Main thread | NodeMap::release()
- Main thread | mbgl::~Map()
- Main thread | Blocks waiting for the Map thread to join
- Map thread  | Request::cancel()
- Map thread  | NodeFileSource::cancel(), destroys the mbgl::Request
                synchronously, mutex guarded access. We also send
                a notification to cancel the NodeRequest on the main
                thread.
- Map thread  | Map thread joins.
- Main thread | NodeMap::release() returns
- Main thread | NodeRequest gets canceled. If NodeRequest replies
                before it gets the "cancel" message, nothing happens,
                notification gets discarded.
2015-06-15 01:52:15 +03:00
Thiago Marcos P. Santos
d515f8d77d Bump Mapbox GL Native to v0.3.3 2015-06-12 13:51:52 +03:00
Thiago Marcos P. Santos
e07ecfaa5f Merge pull request #133 from mapbox/remove_unused
Removed unused method on NodeFileSource
2015-06-09 11:04:04 +03:00
Thiago Marcos P. Santos
b4f21b73d0 Removed unused method on NodeFileSource 2015-06-08 15:40:45 +03:00
Mike Morris
efb583186f Merge pull request #127 from mapbox/collect-garbage
Collect garbage
2015-05-28 14:30:33 -04:00
Mike Morris
691ccff978 fix unhandled gzip test
Refs https://github.com/mapbox/mapbox-gl-native/pull/1632
2015-05-28 13:35:00 -04:00
Mike Morris
ed648f9eff skip failed request test 2015-05-28 13:35:00 -04:00
Mike Morris
9214584efb drop extraneous NodeFileSource v8::Persistent
Remove from NodeRequest to stop preventing garbage collection.
2015-05-28 13:35:00 -04:00
Mike Morris
fe3d6bbbd5 expose map.release() method 2015-05-28 13:35:00 -04:00
Mike Morris
e4536789eb Merge pull request #128 from mapbox/mapbox-protocol
drop SetAccessToken from NodeMap
2015-05-27 19:09:38 -04:00
Mike Morris
cb47f902e1 #include <memory> in node_file_source.hpp 2015-05-27 18:40:53 -04:00
Mike Morris
44490f620c drop SetAccessToken from NodeMap
Handle this is JavaScript where necessary.
2015-05-27 18:24:43 -04:00
Mike Morris
2e73682de0 std::make_unique 2015-05-27 16:54:09 -04:00
Mike Morris
3e9feb7cec Merge pull request #125 from mapbox/failed-requests
Handle failed requests
2015-05-22 11:17:28 -04:00
Mike Morris
16ec628d8e return an error if map.renderStill returns a std::exception_ptr
store exception_ptr on NodeMap

add test for map.render returning an error
2015-05-22 11:09:50 -04:00
Mike Morris
c439024f47 Merge pull request #124 from mapbox/pngjs
Drop compressPNG, use pngjs for tests
2015-05-18 17:54:41 -04:00
Mike Morris
7ed3667092 pack images with pngjs
https://www.npmjs.com/package/pngjs
2015-05-18 16:12:41 -04:00
Mike Morris
830a9b3972 drop CompressPNG 2015-05-15 13:24:04 -04:00
Mike Morris
2d5a73b25b Merge pull request #88 from mapbox/node-exe
Add support for and test against Node.js v0.12 and io.js v2.0.1
2015-05-15 12:27:10 -04:00
Mike Morris
2da70779c6 gcc -Wshadow is annoying 2015-05-14 15:39:48 -04:00
Mike Morris
99e24102c5 drop FLAVOR env var 2015-05-14 13:57:44 -04:00
Mike Morris
068491711b test against io.js 2.0.1 2015-05-14 13:56:47 -04:00
Mike Morris
b7ab9485d4 upgrade node modules, switch from tap-spec to faucet 2015-05-14 13:53:05 -04:00
Mike Morris
11b214fed6 if/else on NODE_MODULE_VERSION instead of UV_VERSION 2015-05-14 12:55:54 -04:00
Mike Morris
c0fe624ecd add node v0.12 and io.js compatibility 2015-05-14 12:55:54 -04:00
Mike Morris
1455822111 BIG matrix with multiple node versions and iojs 2015-05-14 12:23:42 -04:00
Mike Morris
78df900284 break out NODE_EXE env var 2015-05-14 12:17:28 -04:00
Mike Morris
79c73f990b Merge pull request #121 from mapbox/source-madness
Don't do things that set -e in Travis's shell
2015-05-14 11:39:26 -04:00
Mike Morris
1942333685 bump mbgl 2015-05-14 11:14:47 -04:00
Mike Morris
0117921017 Merge pull request #118 from mapbox/separate-threads
separate threads
2015-05-13 14:47:58 -04:00
Mike Morris
40ad3501a7 Merge pull request #119 from mapbox/travis-1339
update travis script
2015-05-13 13:46:01 -04:00
Mike Morris
99b37c64f9 compile OS X with --std=c++1y
because Travis uses Apple LLVM 6.0 and full c++14 support landed in 6.1
https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/WhatsNewXcode.pdf
2015-05-13 12:58:34 -04:00
Mike Morris
1b9f98440a ignore GCC diagnostics for node.h 2015-05-13 12:58:34 -04:00
Mike Morris
1eeb7b65e9 update travis script for https://github.com/mapbox/mapbox-gl-native/pull/1339
refactor mbgl travis scripts

source travis_helper.sh, run setup.sh

pushd/popd

sudo false

travis matrix with c++14 support?

drop setup_mesa.sh

update binding.gyp

language: c

drop thread_object, add async_queue

fix async_queue.hpp includes

std::make_unique

pip install awscli
2015-05-13 12:58:04 -04:00
Mike Morris
62816a9476 skip unhandled bad gzip test 2015-05-05 13:44:52 -04:00
Mike Morris
3eb8ec9ca6 map.resize, close server after tests, not inside 2015-05-05 13:44:52 -04:00