Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
fd8a9603
Unverified
Commit
fd8a9603
authored
Sep 28, 2018
by
shrike69
Committed by
GitHub
Sep 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove waitForViews() during hot reload (#22371)
parent
5f739a1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
17 deletions
+7
-17
fuchsia_reload.dart
packages/flutter_tools/lib/src/commands/fuchsia_reload.dart
+5
-2
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+1
-7
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+1
-8
No files found.
packages/flutter_tools/lib/src/commands/fuchsia_reload.dart
View file @
fd8a9603
...
...
@@ -168,7 +168,7 @@ class FuchsiaReloadCommand extends FlutterCommand {
for
(
int
port
in
ports
)
{
final
VMService
vmService
=
await
_getVMService
(
port
);
await
vmService
.
getVM
();
await
vmService
.
waitFor
Views
();
await
vmService
.
refresh
Views
();
views
.
addAll
(
vmService
.
vm
.
views
);
}
return
views
;
...
...
@@ -268,7 +268,7 @@ class FuchsiaReloadCommand extends FlutterCommand {
for
(
int
port
in
ports
)
{
final
VMService
vmService
=
await
_getVMService
(
port
);
await
vmService
.
getVM
();
await
vmService
.
waitFor
Views
();
await
vmService
.
refresh
Views
();
printStatus
(
_vmServiceToString
(
vmService
));
}
}
...
...
@@ -307,8 +307,10 @@ class FuchsiaReloadCommand extends FlutterCommand {
throwToolExit
(
'Give the GN target with --gn-target(-g).'
);
final
List
<
String
>
targetInfo
=
_extractPathAndName
(
gnTarget
);
_projectRoot
=
targetInfo
[
0
];
printTrace
(
'_projectRoot is
$_projectRoot
'
);
_projectName
=
targetInfo
[
1
];
_fuchsiaProjectPath
=
'
$_buildDir
/../../
$_projectRoot
'
;
printTrace
(
'_fuchsiaProjectPath is
$_fuchsiaProjectPath
'
);
if
(!
_directoryExists
(
_fuchsiaProjectPath
))
throwToolExit
(
'Target does not exist in the Fuchsia tree:
$_fuchsiaProjectPath
.'
);
...
...
@@ -330,6 +332,7 @@ class FuchsiaReloadCommand extends FlutterCommand {
// to locate the .packages file.
final
String
packagesFileName
=
'
${_binaryName}
_dart_library.packages'
;
_dotPackagesPath
=
'
$_buildDir
/dartlang/gen/
$_projectRoot
/
$packagesFileName
'
;
printTrace
(
'_dotPackagesPath is
$_dotPackagesPath
'
);
if
(!
_fileExists
(
_dotPackagesPath
))
throwToolExit
(
'Couldn
\'
t find .packages file at
$_dotPackagesPath
.'
);
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
fd8a9603
...
...
@@ -100,12 +100,6 @@ class FlutterDevice {
await
service
.
getVM
();
}
Future
<
Null
>
waitForViews
()
async
{
// Refresh the view list, and wait a bit for the list to populate.
for
(
VMService
service
in
vmServices
)
await
service
.
waitForViews
();
}
Future
<
Null
>
stopApps
()
async
{
final
List
<
FlutterView
>
flutterViews
=
views
;
if
(
flutterViews
==
null
||
flutterViews
.
isEmpty
)
...
...
@@ -635,7 +629,7 @@ abstract class ResidentRunner {
await
device
.
_connect
(
reloadSources:
reloadSources
,
compileExpression:
compileExpression
);
await
device
.
getVMs
();
await
device
.
waitFor
Views
();
await
device
.
refresh
Views
();
if
(
device
.
views
.
isEmpty
)
printStatus
(
'No Flutter views available on
${device.device.name}
'
);
else
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
fd8a9603
...
...
@@ -344,17 +344,10 @@ class VMService {
return
await
_vm
.
reload
();
}
Future
<
Null
>
waitForViews
({
int
attempts
=
5
,
int
attemptSeconds
=
1
}
)
async
{
Future
<
Null
>
refreshViews
(
)
async
{
if
(!
vm
.
isFlutterEngine
)
return
;
await
vm
.
refreshViews
();
for
(
int
i
=
0
;
(
vm
.
firstView
==
null
)
&&
(
i
<
attempts
);
i
++)
{
// If the VM doesn't yet have a view, wait for one to show up.
printTrace
(
'Waiting for Flutter view'
);
await
Future
<
Null
>.
delayed
(
Duration
(
seconds:
attemptSeconds
));
await
getVM
();
await
vm
.
refreshViews
();
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment