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
edd4c620
Unverified
Commit
edd4c620
authored
Mar 19, 2019
by
Jonah Williams
Committed by
GitHub
Mar 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent stream notifications from interfering with reload (#29467)
parent
03900bc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+24
-5
No files found.
packages/flutter_tools/lib/src/run_hot.dart
View file @
edd4c620
...
...
@@ -215,7 +215,7 @@ class HotRunner extends ResidentRunner {
printStatus
(
'Running in benchmark mode.'
);
// Measure time to perform a hot restart.
printStatus
(
'Benchmarking hot restart'
);
await
restart
(
fullRestart:
true
);
await
restart
(
fullRestart:
true
,
benchmarkMode:
true
);
printStatus
(
'Benchmarking hot reload'
);
// Measure time to perform a hot reload.
await
restart
(
fullRestart:
false
);
...
...
@@ -402,7 +402,7 @@ class HotRunner extends ResidentRunner {
}
Future
<
OperationResult
>
_restartFromSources
({
String
reason
})
async
{
Future
<
OperationResult
>
_restartFromSources
({
String
reason
,
bool
benchmarkMode
=
false
})
async
{
final
Map
<
String
,
String
>
analyticsParameters
=
reason
==
null
?
null
...
...
@@ -465,6 +465,25 @@ class HotRunner extends ResidentRunner {
restartTimer
.
elapsed
.
inMilliseconds
);
flutterUsage
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
analyticsParameters
);
flutterUsage
.
sendTiming
(
'hot'
,
'restart'
,
restartTimer
.
elapsed
);
// In benchmark mode, make sure all stream notifications have finished.
if
(
benchmarkMode
)
{
final
List
<
Future
<
void
>>
isolateNotifications
=
<
Future
<
void
>>[];
for
(
FlutterDevice
device
in
flutterDevices
)
{
for
(
FlutterView
view
in
device
.
views
)
{
isolateNotifications
.
add
(
view
.
owner
.
vm
.
vmService
.
onIsolateEvent
.
then
((
Stream
<
ServiceEvent
>
serviceEvents
)
async
{
await
for
(
ServiceEvent
serviceEvent
in
serviceEvents
)
{
if
(
serviceEvent
.
owner
.
name
.
contains
(
'_spawn'
)
&&
serviceEvent
.
kind
==
ServiceEvent
.
kIsolateExit
)
{
return
;
}
}
}),
);
}
}
await
Future
.
wait
(
isolateNotifications
);
}
return
OperationResult
.
ok
;
}
...
...
@@ -511,7 +530,7 @@ class HotRunner extends ResidentRunner {
bool
get
supportsRestart
=>
true
;
@override
Future
<
OperationResult
>
restart
({
bool
fullRestart
=
false
,
bool
pauseAfterRestart
=
false
,
String
reason
})
async
{
Future
<
OperationResult
>
restart
({
bool
fullRestart
=
false
,
bool
pauseAfterRestart
=
false
,
String
reason
,
bool
benchmarkMode
=
false
})
async
{
final
Stopwatch
timer
=
Stopwatch
()..
start
();
if
(
fullRestart
)
{
if
(!
canHotRestart
)
{
...
...
@@ -525,7 +544,7 @@ class HotRunner extends ResidentRunner {
try
{
if
(!(
await
hotRunnerConfig
.
setupHotRestart
()))
return
OperationResult
(
1
,
'setupHotRestart failed'
);
final
OperationResult
result
=
await
_restartFromSources
(
reason:
reason
);
final
OperationResult
result
=
await
_restartFromSources
(
reason:
reason
,
benchmarkMode:
benchmarkMode
,
);
if
(!
result
.
isOk
)
return
result
;
}
finally
{
...
...
@@ -573,7 +592,7 @@ class HotRunner extends ResidentRunner {
}
}
Future
<
OperationResult
>
_reloadSources
({
bool
pause
=
false
,
String
reason
,
void
Function
(
String
message
)
onSlow
})
async
{
Future
<
OperationResult
>
_reloadSources
({
bool
pause
=
false
,
String
reason
,
void
Function
(
String
message
)
onSlow
,
})
async
{
final
Map
<
String
,
String
>
analyticsParameters
=
<
String
,
String
>{};
if
(
reason
!=
null
)
{
analyticsParameters
[
kEventReloadReasonParameterName
]
=
reason
;
...
...
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