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
9543366e
Commit
9543366e
authored
Aug 09, 2016
by
John McCutchan
Committed by
GitHub
Aug 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send asset evictions notices to Flutter framework (#5303)
parent
95f2e981
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
1 deletion
+33
-1
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+10
-1
hot.dart
packages/flutter_tools/lib/src/hot.dart
+16
-0
observatory.dart
packages/flutter_tools/lib/src/observatory.dart
+7
-0
No files found.
packages/flutter_tools/lib/src/devfs.dart
View file @
9543366e
...
...
@@ -27,6 +27,7 @@ class DevFSEntry {
final
String
devicePath
;
final
AssetBundleEntry
bundleEntry
;
String
get
assetPath
=>
bundleEntry
.
archivePath
;
final
File
file
;
FileStat
_fileStat
;
...
...
@@ -71,6 +72,8 @@ class DevFSEntry {
bool
get
_isSourceEntry
=>
file
==
null
;
bool
get
_isAssetEntry
=>
bundleEntry
!=
null
;
Future
<
List
<
int
>>
contentsAsBytes
()
async
{
if
(
_isSourceEntry
)
return
bundleEntry
.
contentsAsBytes
();
...
...
@@ -246,6 +249,7 @@ class DevFS {
final
Map
<
String
,
DevFSEntry
>
_entries
=
<
String
,
DevFSEntry
>{};
final
Set
<
DevFSEntry
>
_dirtyEntries
=
new
Set
<
DevFSEntry
>();
final
Set
<
DevFSEntry
>
_deletedEntries
=
new
Set
<
DevFSEntry
>();
final
Set
<
DevFSEntry
>
dirtyAssetEntries
=
new
Set
<
DevFSEntry
>();
final
List
<
Future
<
Response
>>
_pendingOperations
=
new
List
<
Future
<
Response
>>();
...
...
@@ -276,6 +280,8 @@ class DevFS {
_dirtyEntries
.
clear
();
// Clear the deleted entries list.
_deletedEntries
.
clear
();
// Clear the dirty asset entries.
dirtyAssetEntries
.
clear
();
}
Future
<
dynamic
>
update
({
DevFSProgressReporter
progressReporter
,
...
...
@@ -422,8 +428,11 @@ class DevFS {
}
bool
needsWrite
=
entry
.
isModified
;
if
(
needsWrite
)
{
if
(
_dirtyEntries
.
add
(
entry
))
if
(
_dirtyEntries
.
add
(
entry
))
{
_bytes
+=
entry
.
size
;
if
(
entry
.
_isAssetEntry
)
dirtyAssetEntries
.
add
(
entry
);
}
}
}
...
...
packages/flutter_tools/lib/src/hot.dart
View file @
9543366e
...
...
@@ -272,6 +272,21 @@ class HotRunner extends ResidentRunner {
return
true
;
}
Future
<
Null
>
_evictDirtyAssets
()
async
{
if
(
_devFS
==
null
)
{
return
;
}
if
(
_devFS
.
dirtyAssetEntries
.
length
==
0
)
{
return
;
}
if
(
serviceProtocol
.
firstIsolateId
==
null
)
throw
'Application isolate not found'
;
for
(
DevFSEntry
entry
in
_devFS
.
dirtyAssetEntries
)
{
await
serviceProtocol
.
flutterEvictAsset
(
serviceProtocol
.
firstIsolateId
,
entry
.
assetPath
);
}
}
Future
<
Null
>
_cleanupDevFS
()
async
{
if
(
_devFS
!=
null
)
{
// Cleanup the devFS.
...
...
@@ -384,6 +399,7 @@ class HotRunner extends ResidentRunner {
printError
(
'Hot reload failed:
\n
$errorMessage
'
);
return
false
;
}
await
_evictDirtyAssets
();
Status
reassembleStatus
=
logger
.
startProgress
(
'Reassembling application...'
);
try
{
...
...
packages/flutter_tools/lib/src/observatory.dart
View file @
9543366e
...
...
@@ -267,6 +267,13 @@ class Observatory {
}).
then
((
dynamic
result
)
=>
new
Response
(
result
));
}
Future
<
Response
>
flutterEvictAsset
(
String
isolateId
,
String
assetPath
)
{
return
peer
.
sendRequest
(
'ext.flutter.evict'
,
<
String
,
dynamic
>{
'isolateId'
:
isolateId
,
'value'
:
assetPath
}).
then
((
dynamic
result
)
=>
new
Response
(
result
));
}
Future
<
Response
>
flutterExit
(
String
isolateId
)
{
return
peer
.
sendRequest
(
'ext.flutter.exit'
,
<
String
,
dynamic
>{
'isolateId'
:
isolateId
})
...
...
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