Bug 525946 [Webkit2] Port download functionality (rewrite some logic)

G_TYPE_CHECK_INSTANCE_TYPE is not a reliable method to check
if type is webview or webcontext at run time.
On my & Roland's system it works, but on Andrey's system it
miss-fires.
This is a macro and by the looks is not reliable method because
we use it with dynamically loaded libraries and via JNI.

Solution:
Rewrite the callback logic to determine types of callback based on
user_data instead of relying on type checking macro.

Also, created task to remove usage of the macro to prevent simmila
issues:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=533833

Tests:
- Environment: Webkit2 2.18, Gtk3.22, Fedora 27, wayland on host, x11
eclipse backend.
- JUnit AllBrowserTests
- ChildEclipse.
- Bug Snippet attached to this patch.
- Also tested with webkit1.
- Andrey reports that this patch fixes his crash issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=533545#c34

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=5259462
Change-Id: I485a54804285dbf114961422799ea34796413404
Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
4 files changed
tree: 43c7f0d5c573469be87242254002197dfffab6af
  1. bundles/
  2. examples/
  3. features/
  4. local-build/
  5. tests/
  6. .gitignore
  7. pom.xml
  8. README.md
README.md

Contributing to SWT

Thanks for your interest in this project.

Developer resources:

See the following description for how to contribute a feature or a bug fix to SWT.

Information regarding source code management, builds, coding standards, and more and be found under the following link.

Contributor License Agreement:

Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).

Contact:

Contact the project developers via the project's “dev” list.

Search for bugs:

This project uses Bugzilla to track ongoing development and issues.

Create a new bug:

Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!