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
b7ababe6
Commit
b7ababe6
authored
Jul 17, 2017
by
Todd Volkert
Committed by
GitHub
Jul 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused DevFsProgressReporter (#11249)
Discovered dead code during review of #10791
parent
5756d629
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
41 deletions
+14
-41
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+13
-36
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+0
-2
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+1
-3
No files found.
packages/flutter_tools/lib/src/devfs.dart
View file @
b7ababe6
...
...
@@ -16,8 +16,6 @@ import 'dart/package_map.dart';
import
'globals.dart'
;
import
'vmservice.dart'
;
typedef
void
DevFSProgressReporter
(
int
progress
,
int
max
);
class
DevFSConfig
{
/// Should DevFS assume that symlink targets are stable?
bool
cacheSymlinks
=
false
;
...
...
@@ -240,23 +238,18 @@ class _DevFSHttpWriter {
Map
<
Uri
,
DevFSContent
>
_outstanding
;
Completer
<
Null
>
_completer
;
HttpClient
_client
;
int
_done
;
int
_max
;
Future
<
Null
>
write
(
Map
<
Uri
,
DevFSContent
>
entries
,
{
DevFSProgressReporter
progressReporter
})
async
{
Future
<
Null
>
write
(
Map
<
Uri
,
DevFSContent
>
entries
)
async
{
_client
=
new
HttpClient
();
_client
.
maxConnectionsPerHost
=
kMaxInFlight
;
_completer
=
new
Completer
<
Null
>();
_outstanding
=
new
Map
<
Uri
,
DevFSContent
>.
from
(
entries
);
_done
=
0
;
_max
=
_outstanding
.
length
;
_scheduleWrites
(
progressReporter
);
_scheduleWrites
();
await
_completer
.
future
;
_client
.
close
();
}
void
_scheduleWrites
(
DevFSProgressReporter
progressReporter
)
{
void
_scheduleWrites
()
{
while
(
_inFlight
<
kMaxInFlight
)
{
if
(
_outstanding
.
isEmpty
)
{
// Finished.
...
...
@@ -264,15 +257,14 @@ class _DevFSHttpWriter {
}
final
Uri
deviceUri
=
_outstanding
.
keys
.
first
;
final
DevFSContent
content
=
_outstanding
.
remove
(
deviceUri
);
_scheduleWrite
(
deviceUri
,
content
,
progressReporter
);
_scheduleWrite
(
deviceUri
,
content
);
_inFlight
++;
}
}
Future
<
Null
>
_scheduleWrite
(
Uri
deviceUri
,
DevFSContent
content
,
DevFSProgressReporter
progressReporter
,
[
DevFSContent
content
,
[
int
retry
=
0
,
])
async
{
try
{
...
...
@@ -293,21 +285,17 @@ class _DevFSHttpWriter {
}
catch
(
e
)
{
if
(
retry
<
kMaxRetries
)
{
printTrace
(
'Retrying writing "
$deviceUri
" to DevFS due to error:
$e
'
);
_scheduleWrite
(
deviceUri
,
content
,
progressReporter
,
retry
+
1
);
_scheduleWrite
(
deviceUri
,
content
,
retry
+
1
);
return
;
}
else
{
printError
(
'Error writing "
$deviceUri
" to DevFS:
$e
'
);
}
}
if
(
progressReporter
!=
null
)
{
_done
++;
progressReporter
(
_done
,
_max
);
}
_inFlight
--;
if
((
_outstanding
.
isEmpty
)
&&
(
_inFlight
==
0
))
{
_completer
.
complete
(
null
);
}
else
{
_scheduleWrites
(
progressReporter
);
_scheduleWrites
();
}
}
}
...
...
@@ -372,10 +360,11 @@ class DevFS {
}
/// Update files on the device and return the number of bytes sync'd
Future
<
int
>
update
({
DevFSProgressReporter
progressReporter
,
AssetBundle
bundle
,
bool
bundleDirty:
false
,
Set
<
String
>
fileFilter
})
async
{
Future
<
int
>
update
({
AssetBundle
bundle
,
bool
bundleDirty:
false
,
Set
<
String
>
fileFilter
,
})
async
{
// Mark all entries as possibly deleted.
for
(
DevFSContent
content
in
_entries
.
values
)
{
content
.
_exists
=
false
;
...
...
@@ -440,8 +429,7 @@ class DevFS {
printTrace
(
'Updating files'
);
if
(
_httpWriter
!=
null
)
{
try
{
await
_httpWriter
.
write
(
dirtyEntries
,
progressReporter:
progressReporter
);
await
_httpWriter
.
write
(
dirtyEntries
);
}
on
SocketException
catch
(
socketException
,
stackTrace
)
{
printTrace
(
"DevFS sync failed. Lost connection to device:
$socketException
"
);
throw
new
DevFSException
(
'Lost connection to device.'
,
socketException
,
stackTrace
);
...
...
@@ -457,17 +445,6 @@ class DevFS {
if
(
operation
!=
null
)
_pendingOperations
.
add
(
operation
);
});
if
(
progressReporter
!=
null
)
{
final
int
max
=
_pendingOperations
.
length
;
int
complete
=
0
;
_pendingOperations
.
forEach
((
Future
<
dynamic
>
f
)
=>
f
.
whenComplete
(()
{
// TODO(ianh): If one of the pending operations fail, we'll keep
// calling progressReporter long after update() has completed its
// future, assuming that doesn't crash the app.
complete
+=
1
;
progressReporter
(
complete
,
max
);
}));
}
await
Future
.
wait
(
_pendingOperations
,
eagerError:
true
);
_pendingOperations
.
clear
();
}
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
b7ababe6
...
...
@@ -314,7 +314,6 @@ class FlutterDevice {
}
Future
<
bool
>
updateDevFS
({
DevFSProgressReporter
progressReporter
,
AssetBundle
bundle
,
bool
bundleDirty:
false
,
Set
<
String
>
fileFilter
...
...
@@ -326,7 +325,6 @@ class FlutterDevice {
int
bytes
=
0
;
try
{
bytes
=
await
devFS
.
update
(
progressReporter:
progressReporter
,
bundle:
bundle
,
bundleDirty:
bundleDirty
,
fileFilter:
fileFilter
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
b7ababe6
...
...
@@ -12,7 +12,6 @@ import 'base/logger.dart';
import
'base/utils.dart'
;
import
'build_info.dart'
;
import
'dart/dependencies.dart'
;
import
'devfs.dart'
;
import
'device.dart'
;
import
'globals.dart'
;
import
'resident_runner.dart'
;
...
...
@@ -223,7 +222,7 @@ class HotRunner extends ResidentRunner {
return
devFSUris
;
}
Future
<
bool
>
_updateDevFS
(
{
DevFSProgressReporter
progressReporter
}
)
async
{
Future
<
bool
>
_updateDevFS
()
async
{
if
(!
_refreshDartDependencies
())
{
// Did not update DevFS because of a Dart source error.
return
false
;
...
...
@@ -238,7 +237,6 @@ class HotRunner extends ResidentRunner {
for
(
FlutterDevice
device
in
flutterDevices
)
{
final
bool
result
=
await
device
.
updateDevFS
(
progressReporter:
progressReporter
,
bundle:
assetBundle
,
bundleDirty:
rebuildBundle
,
fileFilter:
_dartDependencies
,
...
...
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