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
39ebae2b
Unverified
Commit
39ebae2b
authored
Apr 04, 2019
by
Zachary Anderson
Committed by
GitHub
Apr 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fuchsia] Fix isolate filter (#30458)
parent
9fe6be8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
24 deletions
+7
-24
dart_vm.dart
...s/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart
+3
-9
fuchsia_remote_connection.dart
...ote_debug_protocol/lib/src/fuchsia_remote_connection.dart
+1
-8
dart_vm_test.dart
...sia_remote_debug_protocol/test/src/dart/dart_vm_test.dart
+3
-7
No files found.
packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart
View file @
39ebae2b
...
...
@@ -128,24 +128,18 @@ class DartVm {
/// Returns a [List] of [IsolateRef] objects whose name matches `pattern`.
///
/// This is not limited to Isolates running Flutter, but to any Isolate on the
/// VM.
///
/// `includeNonFlutterIsolates` makes sure to add non-flutter Dart isolates,
/// and defaults to `false`.
/// VM. Therefore, the [pattern] argument should be written to exclude
/// matching unintended isolates.
Future
<
List
<
IsolateRef
>>
getMainIsolatesByPattern
(
Pattern
pattern
,
{
Duration
timeout
=
_kRpcTimeout
,
bool
includeNonFlutterIsolates
=
false
,
})
async
{
final
Map
<
String
,
dynamic
>
jsonVmRef
=
await
invokeRpc
(
'getVM'
,
timeout:
timeout
);
final
List
<
IsolateRef
>
result
=
<
IsolateRef
>[];
for
(
Map
<
String
,
dynamic
>
jsonIsolate
in
jsonVmRef
[
'isolates'
])
{
final
String
name
=
jsonIsolate
[
'name'
];
// `:main()` is included at the end of a flutter isolate, whereas the
// name of a dart Isolate is concluded as if the name were a function.
if
(
name
.
contains
(
pattern
)
&&
(
includeNonFlutterIsolates
||
name
.
contains
(
RegExp
(
r':main\(\)'
))))
{
if
(
pattern
.
matchAsPrefix
(
name
)
!=
null
)
{
_log
.
fine
(
'Found Isolate matching "
$pattern
": "
$name
"'
);
result
.
add
(
IsolateRef
.
_fromJson
(
jsonIsolate
,
this
));
}
...
...
packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart
View file @
39ebae2b
...
...
@@ -289,14 +289,10 @@ class FuchsiaRemoteConnection {
/// If there are no live Dart VM's or the Isolate cannot be found, waits until
/// either `timeout` is reached, or a Dart VM starts up with a name that
/// matches `pattern`.
///
/// `includeNonFlutterIsolates` can be set to true to include all isolates
/// found instead of just Flutter Isolates.
Future
<
List
<
IsolateRef
>>
getMainIsolatesByPattern
(
Pattern
pattern
,
{
Duration
timeout
=
_kIsolateFindTimeout
,
Duration
vmConnectionTimeout
=
_kDartVmConnectionTimeout
,
bool
includeNonFlutterIsolates
=
false
,
})
async
{
// If for some reason there are no Dart VM's that are alive, wait for one to
// start with the Isolate in question.
...
...
@@ -315,10 +311,7 @@ class FuchsiaRemoteConnection {
if
(
vmService
==
null
)
{
continue
;
}
isolates
.
add
(
vmService
.
getMainIsolatesByPattern
(
pattern
,
includeNonFlutterIsolates:
includeNonFlutterIsolates
,
));
isolates
.
add
(
vmService
.
getMainIsolatesByPattern
(
pattern
));
}
final
List
<
IsolateRef
>
result
=
await
Future
.
wait
<
List
<
IsolateRef
>>(
isolates
)
...
...
packages/fuchsia_remote_debug_protocol/test/src/dart/dart_vm_test.dart
View file @
39ebae2b
...
...
@@ -241,7 +241,7 @@ void main() {
'type'
:
'@Isolate'
,
'fixedId'
:
'true'
,
'id'
:
'isolates/3'
,
'name'
:
'f
ile://flutterBinary2:main()
'
,
'name'
:
'f
lutterBinary.cmx
'
,
'number'
:
'3'
,
},
<
String
,
dynamic
>{
...
...
@@ -268,13 +268,9 @@ void main() {
await
DartVm
.
connect
(
Uri
.
parse
(
'http://whatever.com/ws'
));
expect
(
vm
,
isNot
(
null
));
final
List
<
IsolateRef
>
matchingFlutterIsolates
=
await
vm
.
getMainIsolatesByPattern
(
'flutterBinary'
);
await
vm
.
getMainIsolatesByPattern
(
'flutterBinary
.cmx
'
);
expect
(
matchingFlutterIsolates
.
length
,
1
);
final
List
<
IsolateRef
>
allFlutterIsolates
=
await
vm
.
getMainIsolatesByPattern
(
''
);
expect
(
allFlutterIsolates
.
length
,
2
);
final
List
<
IsolateRef
>
allIsolates
=
await
vm
.
getMainIsolatesByPattern
(
''
,
includeNonFlutterIsolates:
true
);
final
List
<
IsolateRef
>
allIsolates
=
await
vm
.
getMainIsolatesByPattern
(
''
);
expect
(
allIsolates
.
length
,
4
);
});
...
...
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