Skip to content

Commit 461987e

Browse files
authored
Use native finalizer (#41)
* Use NativeFinalizer * Remove dart_dl_api based finalizer logic * Remove Dart SDK vendoring * Regenerate bindings with new ffigen * Regenerate bindings for webcrypto library * New script for updating bindings * Fix lookup on MacOS
1 parent 5a6b16e commit 461987e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1838
-8383
lines changed

android/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ cmake_minimum_required(VERSION 3.6.0)
1616

1717
enable_language(ASM)
1818

19-
# Set as required by ../third_party/dart-sdk/sources.cmake included below
20-
set(DARTSDK_ROOT ../third_party/dart-sdk/)
21-
22-
# Import sources generated by tool/update-dart-sdk.py
23-
# This provides variables, and requires DARTSDK_ROOT to be set.
24-
# - dart_dl_sources
25-
include(
26-
../third_party/dart-sdk/sources.cmake
27-
)
28-
2919
# Set as required by android-sources.cmake included below
3020
set(BORINGSSL_ROOT ../third_party/boringssl/)
3121

@@ -69,9 +59,7 @@ add_library(
6959

7060
# Source files
7161
../src/webcrypto.c
72-
../src/webcrypto_dart_dl.c
7362
../src/symbols.generated.c
74-
${dart_dl_sources}
7563
${crypto_sources}
7664
${crypto_sources_ARCH}
7765
)
@@ -81,7 +69,6 @@ target_include_directories(
8169

8270
PRIVATE
8371

84-
../third_party/dart-sdk/src/runtime/
8572
../third_party/boringssl/src/include/
8673
)
8774

example/pubspec.lock

Lines changed: 31 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ packages:
77
name: _fe_analyzer_shared
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "46.0.0"
10+
version: "47.0.0"
1111
analyzer:
1212
dependency: transitive
1313
description:
1414
name: analyzer
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "4.6.0"
17+
version: "4.7.0"
1818
archive:
1919
dependency: transitive
2020
description:
2121
name: archive
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "3.1.11"
24+
version: "3.3.0"
2525
args:
2626
dependency: transitive
2727
description:
@@ -35,7 +35,7 @@ packages:
3535
name: async
3636
url: "https://pub.dartlang.org"
3737
source: hosted
38-
version: "2.8.2"
38+
version: "2.9.0"
3939
boolean_selector:
4040
dependency: transitive
4141
description:
@@ -49,21 +49,14 @@ packages:
4949
name: characters
5050
url: "https://pub.dartlang.org"
5151
source: hosted
52-
version: "1.2.0"
53-
charcode:
54-
dependency: transitive
55-
description:
56-
name: charcode
57-
url: "https://pub.dartlang.org"
58-
source: hosted
59-
version: "1.3.1"
52+
version: "1.2.1"
6053
clock:
6154
dependency: transitive
6255
description:
6356
name: clock
6457
url: "https://pub.dartlang.org"
6558
source: hosted
66-
version: "1.1.0"
59+
version: "1.1.1"
6760
collection:
6861
dependency: transitive
6962
description:
@@ -77,21 +70,21 @@ packages:
7770
name: convert
7871
url: "https://pub.dartlang.org"
7972
source: hosted
80-
version: "3.0.2"
73+
version: "3.1.1"
8174
coverage:
8275
dependency: transitive
8376
description:
8477
name: coverage
8578
url: "https://pub.dartlang.org"
8679
source: hosted
87-
version: "1.2.0"
80+
version: "1.5.0"
8881
crypto:
8982
dependency: transitive
9083
description:
9184
name: crypto
9285
url: "https://pub.dartlang.org"
9386
source: hosted
94-
version: "3.0.1"
87+
version: "3.0.2"
9588
cupertino_icons:
9689
dependency: "direct main"
9790
description:
@@ -105,7 +98,7 @@ packages:
10598
name: fake_async
10699
url: "https://pub.dartlang.org"
107100
source: hosted
108-
version: "1.3.0"
101+
version: "1.3.1"
109102
ffi:
110103
dependency: transitive
111104
description:
@@ -172,7 +165,7 @@ packages:
172165
name: http_parser
173166
url: "https://pub.dartlang.org"
174167
source: hosted
175-
version: "4.0.1"
168+
version: "4.0.2"
176169
integration_test:
177170
dependency: "direct dev"
178171
description: flutter
@@ -198,28 +191,28 @@ packages:
198191
name: logging
199192
url: "https://pub.dartlang.org"
200193
source: hosted
201-
version: "1.0.2"
194+
version: "1.1.0"
202195
matcher:
203196
dependency: transitive
204197
description:
205198
name: matcher
206199
url: "https://pub.dartlang.org"
207200
source: hosted
208-
version: "0.12.11"
201+
version: "0.12.12"
209202
material_color_utilities:
210203
dependency: transitive
211204
description:
212205
name: material_color_utilities
213206
url: "https://pub.dartlang.org"
214207
source: hosted
215-
version: "0.1.4"
208+
version: "0.1.5"
216209
meta:
217210
dependency: transitive
218211
description:
219212
name: meta
220213
url: "https://pub.dartlang.org"
221214
source: hosted
222-
version: "1.7.0"
215+
version: "1.8.0"
223216
mime:
224217
dependency: transitive
225218
description:
@@ -247,7 +240,7 @@ packages:
247240
name: path
248241
url: "https://pub.dartlang.org"
249242
source: hosted
250-
version: "1.8.1"
243+
version: "1.8.2"
251244
platform:
252245
dependency: transitive
253246
description:
@@ -275,14 +268,14 @@ packages:
275268
name: pub_semver
276269
url: "https://pub.dartlang.org"
277270
source: hosted
278-
version: "2.1.1"
271+
version: "2.1.2"
279272
shelf:
280273
dependency: transitive
281274
description:
282275
name: shelf
283276
url: "https://pub.dartlang.org"
284277
source: hosted
285-
version: "1.3.2"
278+
version: "1.4.0"
286279
shelf_packages_handler:
287280
dependency: transitive
288281
description:
@@ -329,7 +322,7 @@ packages:
329322
name: source_span
330323
url: "https://pub.dartlang.org"
331324
source: hosted
332-
version: "1.8.2"
325+
version: "1.9.0"
333326
stack_trace:
334327
dependency: transitive
335328
description:
@@ -350,49 +343,49 @@ packages:
350343
name: string_scanner
351344
url: "https://pub.dartlang.org"
352345
source: hosted
353-
version: "1.1.0"
346+
version: "1.1.1"
354347
sync_http:
355348
dependency: transitive
356349
description:
357350
name: sync_http
358351
url: "https://pub.dartlang.org"
359352
source: hosted
360-
version: "0.3.0"
353+
version: "0.3.1"
361354
term_glyph:
362355
dependency: transitive
363356
description:
364357
name: term_glyph
365358
url: "https://pub.dartlang.org"
366359
source: hosted
367-
version: "1.2.0"
360+
version: "1.2.1"
368361
test:
369362
dependency: "direct dev"
370363
description:
371364
name: test
372365
url: "https://pub.dartlang.org"
373366
source: hosted
374-
version: "1.21.1"
367+
version: "1.21.4"
375368
test_api:
376369
dependency: transitive
377370
description:
378371
name: test_api
379372
url: "https://pub.dartlang.org"
380373
source: hosted
381-
version: "0.4.9"
374+
version: "0.4.12"
382375
test_core:
383376
dependency: transitive
384377
description:
385378
name: test_core
386379
url: "https://pub.dartlang.org"
387380
source: hosted
388-
version: "0.4.13"
381+
version: "0.4.16"
389382
typed_data:
390383
dependency: transitive
391384
description:
392385
name: typed_data
393386
url: "https://pub.dartlang.org"
394387
source: hosted
395-
version: "1.3.0"
388+
version: "1.3.1"
396389
vector_math:
397390
dependency: transitive
398391
description:
@@ -406,14 +399,14 @@ packages:
406399
name: vm_service
407400
url: "https://pub.dartlang.org"
408401
source: hosted
409-
version: "8.2.2"
402+
version: "9.0.0"
410403
watcher:
411404
dependency: transitive
412405
description:
413406
name: watcher
414407
url: "https://pub.dartlang.org"
415408
source: hosted
416-
version: "1.0.1"
409+
version: "1.0.2"
417410
web_socket_channel:
418411
dependency: transitive
419412
description:
@@ -427,7 +420,7 @@ packages:
427420
path: ".."
428421
relative: true
429422
source: path
430-
version: "0.5.3-dev"
423+
version: "0.5.3"
431424
webdriver:
432425
dependency: transitive
433426
description:
@@ -441,7 +434,7 @@ packages:
441434
name: webkit_inspection_protocol
442435
url: "https://pub.dartlang.org"
443436
source: hosted
444-
version: "1.1.0"
437+
version: "1.2.0"
445438
yaml:
446439
dependency: transitive
447440
description:
@@ -450,5 +443,5 @@ packages:
450443
source: hosted
451444
version: "3.1.1"
452445
sdks:
453-
dart: ">=2.17.0 <3.0.0"
446+
dart: ">=2.18.0 <3.0.0"
454447
flutter: ">=3.0.0"

ios/Classes/include_webcrypto.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@
2222

2323
#include "../../src/symbols.generated.c"
2424
#include "../../src/webcrypto.c"
25-
#include "../../src/webcrypto_dart_dl.c"

ios/webcrypto.podspec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Pod::Spec.new do |s|
2222
# Since we can't embed source from ../third_party/, we have created files
2323
# in ios/third_party/... which simply use #include "../...". This is a hack!
2424
'third_party/boringssl/**/*.{c,h}',
25-
'third_party/dart-sdk/**/*.{c,h}',
2625
]
2726
s.compiler_flags = [
2827
'-DOPENSSL_NO_ASM',
@@ -35,7 +34,6 @@ Pod::Spec.new do |s|
3534
# Enable equivalent of '-Isrc/include' to make '#include <openssl/...>' work
3635
'HEADER_SEARCH_PATHS' => [
3736
'$(PODS_TARGET_SRCROOT)/../third_party/boringssl/src/include',
38-
'$(PODS_TARGET_SRCROOT)/../third_party/dart-sdk/src/runtime',
3937
],
4038
'DEFINES_MODULE' => 'YES',
4139
# Flutter.framework does not contain a i386 slice.
Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
1-
name: WebCryptoDartDL
2-
description: 'Bindings to src/webcrypto_dart_dl.h.'
1+
name: WebCrypto
2+
description: 'Bindings to src/webcrypto.h.'
33
output: 'lib/src/boringssl/bindings/generated_bindings.dart'
44
headers:
55
entry-points:
6-
- src/webcrypto_dart_dl.h
7-
- src/webcrypto.c
8-
compiler-opts: '-Ithird_party/dart-sdk/src/runtime/ -Ithird_party/boringssl/src/include'
6+
- src/webcrypto.h
97
comments:
108
style: any
119
length: full
1210
sort: true
13-
typedef-map:
14-
# TODO(dacoharkes): https://github.com/dart-lang/sdk/issues/42563 https://github.com/dart-lang/ffigen/issues/7
15-
size_t: IntPtr
1611
macros:
17-
include:
18-
- nothing
12+
include: []
1913
enums:
20-
include:
21-
- nothing
14+
include: []
2215
unnamed-enums:
23-
include:
24-
- nothing
16+
include: []
2517
globals:
26-
include:
27-
- nothing
18+
include: []
2819
structs:
29-
include:
30-
- nothing
20+
include: []
3121
dependency-only: opaque
3222
functions:
3323
include:
34-
# Keep consistent with src/symbols.yaml.
35-
- webcrypto_dart_dl_attach_finalizer
36-
- webcrypto_dart_dl_initialize
3724
- webcrypto_lookup_symbol
3825
preamble: |
3926
// Copyright 2021 Google LLC
@@ -51,4 +38,4 @@ preamble: |
5138
// limitations under the License.
5239
//
5340
// ignore_for_file: unused_element
54-
41+
// ignore_for_file: non_constant_identifier_names

0 commit comments

Comments
 (0)