54 Commits

Author SHA1 Message Date
David Worsham
7b5f79f1a1
fuchsia: Ensure full-screen input interceptor (#22687) 2020-11-25 19:10:29 -08:00
Adam Barth
638c182366
[fuchsia] zx::vmar::map migration (#22003)
The new map() method receives its arguments in the same order as the
underlying C system call. This patch should not change any behavior.
2020-10-20 21:59:46 +00:00
Clement Skau
e78e405e6a
Enable lazy-async-stacks by-default in all modes (Take 4) (#21802) 2020-10-20 10:31:15 +02:00
Chris Bracken
49c35b6177
Eliminate unnecessary linter opt-outs (#21935)
Eliminates FLUTTER_NOLINT where they can be landed without triggering
lint failures.
2020-10-16 17:24:23 -07:00
Chinmay Garde
5bd7260a1e
Enable loading snapshots with sound null safety enabled. (#21820)
Snapshots compiled with sound null-safety enabled require changes to the way in
which isolates are launched. Specifically, the `Dart_IsolateFlags::null_safety`
field needs to be known upfront. The value of this field can only be determined
once the kernel snapshot is available. This poses a problem in the engine
because the engine used to launch the isolate at shell initialization and only
need the kernel mappings later at isolate launch (when transitioning the root
isolate to the `DartIsolate::Phase::Running` phase). This patch delays launch of
the isolate on the UI task runner till a kernel mapping is available. The side
effects of this delay (callers no longer having access to the non-running
isolate handle) have been addressed in this patch. The DartIsolate API has also
been amended to hide the method that could return a non-running isolate to the
caller.  Instead, it has been replaced with a method that requires a valid
isolate configuration that returns a running root isolate. The isolate will be
launched by asking the isolate configuration for its null-safety
characteristics.

A side effect of enabling null-safety is that Dart APIs that work with legacy
types will now terminate the process if used with an isolate that has sound
null-safety enabled. These APIs may no longer be used in the engine. This
primarily affects the Dart Convertors in Tonic that convert certain C++ objects
into the Dart counterparts. All known Dart Converters have been updated to
convert C++ objects to non-nullable Dart types inferred using type traits of the
corresponding C++ object. The few spots in the engine that used the old Dart
APIs directly have been manually updated. To ensure that no usage of the legacy
APIs remain in the engine (as these would cause runtime process terminations),
the legacy APIs were prefixed with the `DART_LEGACY_API` macro and the macro
defined to `[[deprecated]]` in all engine translation units. While the engine
now primarily works with non-nullable Dart types, callers can still use
`Dart_TypeToNonNullableType` to acquire nullable types for use directly or with
Tonic. One use case that is not addressed with the Tonic Dart Convertors is the
creation of non-nullable lists of nullable types. This hasn’t come up so far in
the engine.

A minor related change is reworking tonic to define a single library target.
This allows the various tonic subsystems to depend on one another. Primarily,
this is used to make the Dart convertors use the logging utilities. This now
allows errors to be more descriptive as the presence of error handles is caught
(and logged) earlier.

Fixes https://github.com/flutter/flutter/issues/59879
2020-10-16 14:53:26 -07:00
Alexander Markov
0d151816c3
Remove uses of Dart VM bytecode mode from Flutter engine (#21741) 2020-10-09 16:34:08 -07:00
Chris Bracken
08dabe9601
Clean up C++ includes (#21127)
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.

Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.

Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676

This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
2020-09-11 21:18:35 -07:00
Zachary Anderson
f7c7b41f0a
Revert "Enable lazy-async-stacks by-default in all modes (Take 3) (#20895)" (#21043)
This reverts commit 575a51948d81756c778352b40f639fa557325fd7.
2020-09-09 09:25:17 -07:00
Clement Skau
575a51948d
Enable lazy-async-stacks by-default in all modes (Take 3) (#20895)
Lazy async stacks were already enabled by-default in AOT mode in [0] - which made the
gen_snapshot invocations use "--lazy-async-stacks --no-causal-async-stacks".

This change does the same with the engine defaults, which makes this be enabled
by-default in JIT mode as well.

See go/dart-10x-faster-async for more information.

This is a re-land: A fix for what we believe to have caused the last revert has landed upstream in Dart in dart-lang/sdk@0004589

[0] flutter/flutter@3478232
2020-09-07 10:55:48 +02:00
David Worsham
07e2520d5d
fuchsia: create new flutter_runner render path (#19584) 2020-08-28 14:17:17 -07:00
David Worsham
5a2bf6aa4c
Reland: "fuchsia: Remove dead code / break dependencies" (#20532)
Reland #19396 with a fix for improper scale that was affecting internal tests

Tested: Ran all unittests, ran internal tests, and ran workstation on Fuchsia
BUG: 53062, 53063
2020-08-14 20:41:18 -07:00
Zachary Anderson
47c1c61a92
Revert "fuchsia: Remove dead code / break dependencies (#19396)" (#20302)
This reverts commit 12a37478de2cc9aff7f8fc72bc3a47f5f02e083c.
2020-08-06 12:06:06 -07:00
David Worsham
12a37478de
fuchsia: Remove dead code / break dependencies (#19396)
The fuchsia code around metrics and sizing was just sending this
information through a side-channel, when the engine already had the
information available. So, delete all of it to make future CLs simpler.

Additionally, the SceneUpdateContext has many unneccesary dependencies
re: metrics and PaintTasks. Break those to make future CLs simpler.

Tested: Ran all unittests and ran workstation on Fuchsia
BUG: 53062, 53063
2020-08-03 22:09:26 -07:00
Jason Simmons
ee4d50cd07
Revert "Enable lazy-async-stacks by-default in all modes (2) (#19270)" (#20165)
This reverts commit 06fef5e36360e61a557fed546d12048427eb2340.
2020-07-30 18:34:51 -07:00
Clement Skau
06fef5e363
Enable lazy-async-stacks by-default in all modes (2) (#19270) 2020-07-29 12:25:30 +02:00
James Robinson
e3fdb23304
[fuchsia] Add ability to configure separate data and asset dirs (#18858)
This allows Fuchsia components executed by the Flutter runner to
specify a directory containing assets if they wish to store assets
separate from program data. This is specified in the program metadata
field within the component's specification with the new "assets"
attribute. If this attribute is absent, assets are loaded relative to
the path specified in the "data" attribute as before.

This is useful in the short term to use a location in the package where
we can store small files more efficiently. It is also potentially
useful longer term to enforce a stronger separatation between
executable program data and non-executable assets.

This commit adds some basic unit testing for the data parsing to the
flutter_runner_tests suite.
2020-06-12 14:41:27 -07:00
David Worsham
c9f9891454
Reland "fuchsia: Implement CreateViewWithViewProvider" (#18615)
The last commit was a bad push -- this one compiles.

Tested: Manual test via workstation product
BUG: 50875
2020-05-26 19:29:11 -07:00
David Worsham
b0008b0080
Revert "fuchsia: Implement CreateViewWithViewProvider (#18280)" (#18614)
This reverts commit 40043b5faccaa97cf2ffa483c5ff03fc1117c7db.
2020-05-26 17:12:34 -07:00
David Worsham
40043b5fac
fuchsia: Implement CreateViewWithViewProvider (#18280)
Tested: Manual test via workstation product
BUG: 50875
2020-05-26 16:27:15 -07:00
Felipe Archondo
24df4a2768
[fuchsia] set vsync_offset based on config file (#18006)
In order to better support different products on Fuchsia, we should
change performance-sensitive attributes based on config files passed in.
This change does so for `vsync_offset`.
2020-05-01 08:45:53 -07:00
Drew Fisher
fb841071c2
fuchsia: remove use of replace_as_executable (second try) (#17313)
On Fuchsia, we can now get executable VMOs from trusted backing
filesystems.  This allows us to remove the use of replace_as_executable
in favor of opening files with `fdio_open_fd_at` with the
`OPEN_RIGHT_EXECUTABLE` flag and getting VMOs by calling
`fdio_get_vmo_exec`.

By moving the responsibility for executability into the filesystem, we
are able to remove `deprecated-ambient-replace-as-executable` from
component manifests for non-JIT runners (the JIT runners still call
replace_as_executable in Dart's allocator).  It wasn't abundantly clear
whether .cmx files for tests were used purely in AOT runtime
environments or also saw JIT usage, so I left those as-is.

For context: this is a second attempt at #16690, which was reverted
because it broke the Dart JIT runner.  The primary difference is that
this time around, we correctly handle absolute vs relative paths,
depending on whether library loading bottoms out in `fdio_open_fd` or
`fdio_open_fd_at`.  I've added additional assertions to help ensure any
new usages use the correct shape of path.

Testing: I verified locally that the flutter product runner works on
Astro, and also successfully ran the Dart JIT example test (which was
the thing blocking the google3 roll with the previous attempt at this
patchset).

Co-authored-by: Drew Fisher <zarvox@google.com>
2020-03-25 13:17:28 -07:00
Kaushik Iska
a16d97e507
Revert "fuchsia: remove use of replace_as_executable (#16690)" (#16829)
This reverts commit ff921cd608efaf3aecd3e3e0feb14bb540cc22ed.
2020-02-27 10:13:26 -08:00
Drew Fisher
ff921cd608
fuchsia: remove use of replace_as_executable (#16690)
On Fuchsia, we can now get executable VMOs from trusted backing
filesystems.  This allows us to remove the use of replace_as_executable
in favor of opening files with `fdio_open_fd_at` with the
`OPEN_RIGHT_EXECUTABLE` flag and getting VMOs by calling
`fdio_get_vmo_exec`.

By moving the responsibility for executability into the filesystem, we
should be able to remove deprecated-ambient-replace-as-executable from
component manifests for non-JIT runners (the JIT runners still call
replace_as_executable in Dart's allocator).

Test: verified locally that this works on Astro on a _user build with
the runtime allowlist tightened.
2020-02-25 13:24:07 -08:00
Dan Field
888a62cf22
Revert "Enable lazy-async-stacks by-default in all modes (#16556)" (#16781)
This reverts commit fdabcaddf45deaf93a5238c99c2acbeb25a3a027.
2020-02-24 20:04:40 -08:00
Martin Kustermann
fdabcaddf4
Enable lazy-async-stacks by-default in all modes (#16556)
This was already enabled by-default in AOT mode in [0] - which made the
gen_snapshot invocations use "--lazy-async-stacks --no-causal-async-stacks".

See go/dart-10x-faster-async for more information.

[0] https://github.com/flutter/flutter/commit/347823234fd
2020-02-20 18:31:26 +01:00
George Wright
f5de1acf94
Revert "Migrate flutter_runner from flutter_runner::{Thread,Loop} to fml::{Thread,MessageLoop} (#15118)" (#16277)
This reverts commit 41e8ed071454cfd9ae02e34198250dea0edab9c4.
2020-01-30 17:19:13 -08:00
Kaushik Iska
bd8c955502
[fuchsia] Expose view_ref as part of dart:fuchsia initialization (#15958)
fixes https://github.com/flutter/flutter/issues/47178
2020-01-24 13:42:19 -08:00
George Wright
41e8ed0714 Migrate flutter_runner from flutter_runner::{Thread,Loop} to fml::{Thread,MessageLoop} (#15118) 2020-01-23 18:54:49 -08:00
George Wright
69bc783016
Revert "Migrate flutter_runner from flutter_runner::{Thread,Loop} to fml::{Thread,MessageLoop} (#15118)" (#15903)
This reverts commit a50f1ef56a05999bfa97a777cca14fd7a00e8454.
2020-01-22 20:35:41 -08:00
sjindel-google
343d9f2a03
Re-land "Use ELF for Dart AOT snapshots on Fuchsia. #13896" (#15360)
The bug in the original CL was that we were not running replace_as_executable in OpenVmo if the namespace was not provided.

This was a divergence in behavior for MappedResource::LoadFromNamespace compared to the current implementation.
2020-01-10 14:34:59 +01:00
Miguel
b98e299645 [fuchsia] Add diagnostics directory to the remote dirs and ensure entry exists (#15258)
This reverts commit 4312d37eb1cdd0ed2e7b44647c7156499b741ac7.

Once https://fuchsia-review.googlesource.com/c/topaz/+/351729 lands, the
diagnostics directory will be present, this would be safe to do and the
roller won't be blocked again.
2020-01-09 17:28:16 -08:00
George Wright
a50f1ef56a
Migrate flutter_runner from flutter_runner::{Thread,Loop} to fml::{Thread,MessageLoop} (#15118) 2020-01-07 19:24:45 -08:00
Francisco Magdaleno
bdc9708d23
Revert "Use ELF for Dart AOT snapshots on Fuchsia. (#13896)" (#14823)
This reverts commit 09c434d265ea9adf3f7ebd46c72fe6a0ba0b28ad.
2019-12-27 16:15:24 -08:00
Dan Field
129c0e30d8
View ref pair (#14602) 2019-12-20 15:55:02 -08:00
sjindel-google
09c434d265
Use ELF for Dart AOT snapshots on Fuchsia. (#13896)
We will still support loading blobs until build rules in Fuchsia are updated.
2019-12-19 14:11:20 +01:00
Kaushik Iska
4312d37eb1
Revert "[fuchsia] Add diagnostics directory to the set of remote dirs (#14470)" (#14566)
This reverts commit 94654dbe63125efca843775f4178409e8c1f052f.
2019-12-18 18:58:37 -08:00
Miguel
94654dbe63 [fuchsia] Add diagnostics directory to the set of remote dirs (#14470) 2019-12-12 14:50:49 -08:00
Nathan Rogers
1ce85bec2f
[flutter_runner] Enable Skia tracing by default on Fuchsia (#13457)
Since Flutter tracing is wired up to Fuchsia system level tracing (and
that includes Skia tracing within Flutter), it makes more sense to
enable Skia tracing by default on Fuchsia, and to control Flutter Skia
tracing, rely on whether Fuchsia system tracing is enabled, in progress,
and contains the "skia" category.
2019-12-11 21:03:12 -08:00
Craig Stout
b2ab78fb41 [shell][fuchsia] Add lib/async/default.h
For async_get_default_dispatcher().
2019-12-09 15:21:45 -08:00
Jason Simmons
f0c9edcfa5
Do not request executable permission on Fuchsia file mappings unless it is required (#13290)
Fixes https://github.com/flutter/flutter/issues/43273
2019-10-22 11:24:51 -07:00
Kaushik Iska
7b4f7564ee
[flutter_runner] Make rd and rx uniform (#12733)
* [flutter_runner] Make rd and rx uniform

Currently we pass paths for readonly files and pass
in fds for rx. Now passing in fds everywhere.

* pass full paths
2019-10-01 19:24:19 -07:00
Kaushik Iska
c53b076673
[flutter_runner] Verified Execution for read exec on Fuchsia (#12703)
Note: `fdio_open_fd` does not default to `AT_FDCWD` so we need to
specify absolute paths.
2019-09-30 14:04:40 -07:00
Kaushik Iska
6fcd795b4c
[flutter_runner] Refactor thread_application pair to ActiveApplication (#12573) 2019-09-27 13:38:25 -07:00
George Wright
d1901a2d15
Reword confusing messaging surrounding unhandled exception in flutter_runner on Fuchsia (#12428)
- Don't use 'unhandled' as that implies fatality which this is not
- Don't mention shutdown because this is not necessarily an exception-after-shutdown issue

Follow-up issue filed https://github.com/flutter/flutter/issues/41506 to implement the unit test for this.
2019-09-27 12:50:20 -07:00
Dan Field
819a9f5898
Sync dart_runner (#12375) 2019-09-20 12:58:08 -07:00
Kaushik Iska
eed16d34bd
[flutter_runner] Explicitly set |trace_skia| to false (#12349)
Explicitly set |Application|'s |flutter::Settings| |trace_skia| field to
false (it currently defaults to false), in order to slightly simplify
the enabling skia trace events workflow.

PT-145 #comment-patch

Change-Id: Ib40f9ed3dc6f824056465db2cd45309c78b7e3b4
2019-09-18 18:02:43 -07:00
Kaushik Iska
e0a24d6369
[flutter_runner] Remove usages of shared snapshots from CC sources (#12343)
Build rules still reference creating share snapshot data and instructions. This makes the engine to always pass them as empty to the dart vm. To be followed up with a change to alter the build rules to stop referencing the shared snapshots.

This is not being used currently and the fact that the runner will be built outside of the flutter tree means that the apps will not have much to gain via shared snapshots. The rationale behind this change is to partially make migrating the runner out of topaz tree easier.

Change-Id: Ibc4dd6a298d65082416af753522f5a17c88a750a
2019-09-18 17:31:54 -07:00
Dan Field
00a12c411f
Add missing CL, fix targets for Fuchsia (#12338) 2019-09-18 15:06:50 -07:00
Jason Simmons
2592d6efe2
[flutter_runner] Port the accessibility bridge from Topaz (#12054) 2019-09-10 11:29:08 -07:00
Kaushik Iska
453d06b1ab
[flutter_runner] Plumb Flutter component arguments to the Dart entrypoint (#12026)
port of Change-Id: Ibcd4a110b84805af02a436a2a5bcf2cf3d2029a4
2019-09-06 14:16:13 -07:00