text
stringlengths 6
13.6M
| id
stringlengths 13
176
| metadata
dict | __index_level_0__
int64 0
1.69k
|
---|---|---|---|
#include "../../Flutter/Flutter-Debug.xcconfig"
#include "Warnings.xcconfig"
| devtools/case_study/memory_leaks/images_1/macos/Runner/Configs/Debug.xcconfig/0 | {
"file_path": "devtools/case_study/memory_leaks/images_1/macos/Runner/Configs/Debug.xcconfig",
"repo_id": "devtools",
"token_count": 32
} | 122 |
# leaking_counter_1
This is memory leaking application to test memory debugging tools.
## Leak debugging lab
1. Setup the lab:
a. Start the latest version of DevTools by following [BETA_TESTING.md](https://github.com/polina-c/devtools/blob/master/BETA_TESTING.md)
b. in another console tabs navigate to the DevTools directory (`cd devtools`) and start the app:
cd case_study/memory_leaks/leaking_counter_1
flutter run -d macos --profile
c. Copy the Observatory URL displayed in the console to the connection box in DevTools
2. Solve the puzzle:
Users report the app consumes more and more memory with every button click.
Your task is to fix the leak using the tab Memory > Diff, assuming the application is too large to find the issue by
simply reviewing the code of the button handler.
| devtools/case_study/memory_leaks/leaking_counter_1/README.md/0 | {
"file_path": "devtools/case_study/memory_leaks/leaking_counter_1/README.md",
"repo_id": "devtools",
"token_count": 249
} | 123 |
name: leaking_counter_1
description: A new Flutter project.
publish_to: none
environment:
sdk: ^3.0.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^3.0.1
flutter:
uses-material-design: true
| devtools/case_study/memory_leaks/leaking_counter_1/pubspec.yaml/0 | {
"file_path": "devtools/case_study/memory_leaks/leaking_counter_1/pubspec.yaml",
"repo_id": "devtools",
"token_count": 110
} | 124 |
package github.nisrulz.usingtabs;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
| devtools/case_study/memory_leaks/memory_leak_app/android/app/src/main/java/github/nisrulz/usingtabs/MainActivity.java/0 | {
"file_path": "devtools/case_study/memory_leaks/memory_leak_app/android/app/src/main/java/github/nisrulz/usingtabs/MainActivity.java",
"repo_id": "devtools",
"token_count": 116
} | 125 |
#include "Generated.xcconfig"
| devtools/case_study/memory_leaks/memory_leak_app/ios/Flutter/Release.xcconfig/0 | {
"file_path": "devtools/case_study/memory_leaks/memory_leak_app/ios/Flutter/Release.xcconfig",
"repo_id": "devtools",
"token_count": 12
} | 126 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/material.dart';
import '../common.dart';
import '../logging.dart';
// class Logger extends StatelessWidget {
class Logger extends StatefulWidget {
final Logging _logging = Logging.logging;
@override
State<Logger> createState() => LoggerState(_logging);
}
class LoggerState extends State<Logger> {
LoggerState(this._logging);
final Logging _logging;
final List<String> _saved = [];
final _biggerFont = const TextStyle(fontSize: 18.0);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text(appName),
),
body: _buildSuggestions(),
);
}
// ignore: unused_element
void _pushSaved() {
unawaited(
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
final tiles = _saved.map(
(itemValue) {
return ListTile(
title: Text(
itemValue,
style: _biggerFont,
),
);
},
);
final divided = ListTile.divideTiles(
context: context,
tiles: tiles,
).toList();
return Scaffold(
appBar: AppBar(
title: const Text('Saved lists'),
),
body: ListView(children: divided),
);
},
),
),
);
}
Widget _buildRow(String logEntry) {
return ListTile(
title: Text(
'LOG: $logEntry',
style: _biggerFont,
),
trailing: const Icon(
// alreadySaved ? Icons.favorite : Icons.favorite_border,
// color: alreadySaved ? Colors.red : null,
Icons.favorite_border,
),
onTap: () {
setState(() {
_saved.add('LOG: $logEntry');
});
},
);
}
Widget _buildSuggestions() {
return ListView.builder(
padding: const EdgeInsets.all(16.0),
// The itemBuilder callback is called once per suggested word pairing,
// and places each suggestion into a ListTile row.
// For even rows, the function adds a ListTile row for the word pairing.
// For odd rows, the function adds a Divider widget to visually
// separate the entries. Note that the divider may be difficult
// to see on smaller devices.
itemBuilder: (context, i) {
// Add a one-pixel-high divider widget before each row in theListView.
if (i.isOdd) return const Divider();
// The syntax "i ~/ 2" divides i by 2 and returns an integer result.
// For example: 1, 2, 3, 4, 5 becomes 0, 1, 1, 2, 2.
// This calculates the actual number of word pairings in the ListView,
// minus the divider widgets.
final index = i ~/ 2;
if (index < _logging.logs.length) {
return _buildRow(_logging.logs[index]);
} else {
return null;
}
// // Emits Idle... lots of them every 100ms.
// // TOOD(terry): UI needs to appear sluggish clue to look for leaks, etc.
// else
// return _buildRow('Idle...');
},
);
}
}
| devtools/case_study/memory_leaks/memory_leak_app/lib/tabs/logger.dart/0 | {
"file_path": "devtools/case_study/memory_leaks/memory_leak_app/lib/tabs/logger.dart",
"repo_id": "devtools",
"token_count": 1502
} | 127 |
---
redirect_to: https://flutter.dev/docs/development/tools/devtools/android-studio
---
| devtools/docs/android_studio.md/0 | {
"file_path": "devtools/docs/android_studio.md",
"repo_id": "devtools",
"token_count": 30
} | 128 |
{
"dart.showTodos": false,
}
| devtools/packages/devtools_app/.vscode/settings.json/0 | {
"file_path": "devtools/packages/devtools_app/.vscode/settings.json",
"repo_id": "devtools",
"token_count": 19
} | 129 |
targets:
$default:
builders:
build_web_compilers|entrypoint:
options:
dart2js_args:
- -O1
# We don't generate any mocks in this package.
mockito|mockBuilder:
enabled: false
stager|stagerAppBuilder:
generate_for:
- test/test_infra/scenes/**.dart
| devtools/packages/devtools_app/build.yaml/0 | {
"file_path": "devtools/packages/devtools_app/build.yaml",
"repo_id": "devtools",
"token_count": 163
} | 130 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_test/helpers.dart';
import 'package:devtools_test/integration_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
// To run:
// dart run integration_test/run_tests.dart --target=integration_test/test/live_connection/app_test.dart
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
late TestApp testApp;
setUpAll(() {
testApp = TestApp.fromEnvironment();
expect(testApp.vmServiceUri, isNotNull);
});
tearDown(() async {
await resetHistory();
});
testWidgets('connect to app and switch tabs', (tester) async {
await pumpAndConnectDevTools(tester, testApp);
// For the sake of this test, do not show extension screens by default.
preferences.devToolsExtensions.showOnlyEnabledExtensions.value = true;
await tester.pumpAndSettle(shortPumpDuration);
logStatus('verify that we can load each DevTools screen');
await navigateThroughDevToolsScreens(tester);
});
}
| devtools/packages/devtools_app/integration_test/test/live_connection/app_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/integration_test/test/live_connection/app_test.dart",
"repo_id": "devtools",
"token_count": 396
} | 131 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// The DevTools application version
// This version should only be updated by running tools/update_version.dart
// that updates all versions for DevTools.
// Note: a regexp in tools/update_version.dart matches
// the constant declaration `const String version =`.
// If you change the declaration you must also modify the regex in
// tools/update_version.dart.
const String version = '2.34.0-dev.12';
| devtools/packages/devtools_app/lib/devtools.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/devtools.dart",
"repo_id": "devtools",
"token_count": 146
} | 132 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_shared/devtools_extensions.dart';
import 'package:flutter/material.dart';
import '../shared/analytics/analytics.dart' as ga;
import '../shared/analytics/constants.dart' as gac;
import '../shared/common_widgets.dart';
import '../shared/globals.dart';
/// A [ScaffoldAction] that, when clicked, will open a dialog menu for
/// managing DevTools extension states.
class ExtensionSettingsAction extends ScaffoldAction {
ExtensionSettingsAction({super.key, Color? color})
: super(
icon: Icons.extension_outlined,
tooltip: 'DevTools Extensions',
color: color,
onPressed: (context) {
unawaited(
showDialog(
context: context,
builder: (context) => const ExtensionSettingsDialog(),
),
);
},
);
}
class ExtensionSettingsDialog extends StatelessWidget {
const ExtensionSettingsDialog({super.key});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final availableExtensions = extensionService.availableExtensions.value;
// This dialog needs a fixed height because it contains a scrollable list.
final dialogHeight = scaleByFontFactor(300.0);
return DevToolsDialog(
title: const DialogTitleText('DevTools Extensions'),
content: SizedBox(
width: defaultDialogWidth,
height: dialogHeight,
child: Column(
children: [
const Text(
'Extensions are provided by the pub packages used in your '
'application. When activated, the tools provided by these '
'extensions will be available in a separate DevTools tab.',
),
const SizedBox(height: defaultSpacing),
CheckboxSetting(
notifier:
preferences.devToolsExtensions.showOnlyEnabledExtensions,
title: 'Only show screens for enabled extensions',
tooltip:
'Only show top-level DevTools tabs for extensions that are '
'enabled\n(i.e. do not show tabs for extensions that have no '
'preference set).',
),
const PaddedDivider(),
Expanded(
child: availableExtensions.isEmpty
? Center(
child: Text(
'No extensions available.',
style: theme.subtleTextStyle,
),
)
: _ExtensionsList(extensions: availableExtensions),
),
],
),
),
actions: const [
DialogCloseButton(),
],
);
}
}
class _ExtensionsList extends StatefulWidget {
const _ExtensionsList({required this.extensions});
final List<DevToolsExtensionConfig> extensions;
@override
State<_ExtensionsList> createState() => __ExtensionsListState();
}
class __ExtensionsListState extends State<_ExtensionsList> {
late ScrollController scrollController;
@override
void initState() {
super.initState();
scrollController = ScrollController();
}
@override
void dispose() {
scrollController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scrollbar(
controller: scrollController,
thumbVisibility: true,
child: ListView.builder(
controller: scrollController,
itemCount: widget.extensions.length,
itemBuilder: (context, index) => ExtensionSetting(
extension: widget.extensions[index],
),
),
);
}
}
@visibleForTesting
class ExtensionSetting extends StatelessWidget {
const ExtensionSetting({super.key, required this.extension});
final DevToolsExtensionConfig extension;
@override
Widget build(BuildContext context) {
final buttonStates = [
(
title: 'Enabled',
isSelected: (ExtensionEnabledState state) =>
state == ExtensionEnabledState.enabled,
onPressed: () {
ga.select(
gac.DevToolsExtensionEvents.extensionSettingsId.name,
gac.DevToolsExtensionEvents.extensionEnableManual(extension),
);
unawaited(
extensionService.setExtensionEnabledState(
extension,
enable: true,
),
);
},
),
(
title: 'Disabled',
isSelected: (ExtensionEnabledState state) =>
state == ExtensionEnabledState.disabled,
onPressed: () {
ga.select(
gac.DevToolsExtensionEvents.extensionSettingsId.name,
gac.DevToolsExtensionEvents.extensionDisableManual(extension),
);
unawaited(
extensionService.setExtensionEnabledState(
extension,
enable: false,
),
);
},
),
];
final theme = Theme.of(context);
final extensionName = extension.name.toLowerCase();
return ValueListenableBuilder(
valueListenable: extensionService.enabledStateListenable(extensionName),
builder: (context, enabledState, _) {
return Padding(
padding: const EdgeInsets.only(bottom: denseSpacing),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'package:$extensionName',
overflow: TextOverflow.ellipsis,
style: theme.fixedFontStyle,
),
DevToolsToggleButtonGroup(
fillColor: theme.colorScheme.primary,
selectedColor: theme.colorScheme.onPrimary,
onPressed: (index) => buttonStates[index].onPressed(),
selectedStates: [
for (final state in buttonStates)
state.isSelected(enabledState),
],
children: [
for (final state in buttonStates)
Padding(
padding: const EdgeInsets.symmetric(
vertical: densePadding,
horizontal: denseSpacing,
),
child: Text(state.title),
),
],
),
],
),
);
},
);
}
}
| devtools/packages/devtools_app/lib/src/extensions/extension_settings.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/extensions/extension_settings.dart",
"repo_id": "devtools",
"token_count": 2996
} | 133 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/material.dart';
import '../../shared/charts/treemap.dart';
import '../../shared/primitives/byte_utils.dart';
import '../../shared/primitives/utils.dart';
import '../../shared/table/table.dart';
import '../../shared/table/table_data.dart';
import '../../shared/ui/colors.dart';
import 'app_size_controller.dart';
class AppSizeAnalysisTable extends StatelessWidget {
factory AppSizeAnalysisTable({
required TreemapNode rootNode,
required AppSizeController controller,
}) {
final treeColumn = _NameColumn(
currentRootLevel: controller.isDeferredApp.value
? rootNode.children.first.level
: rootNode.level,
);
final sizeColumn = _SizeColumn();
final columns = List<ColumnData<TreemapNode>>.unmodifiable([
treeColumn,
sizeColumn,
_SizePercentageColumn(
totalSize: controller.isDeferredApp.value
? rootNode.children[0].root.byteSize
: rootNode.root.byteSize,
),
]);
return AppSizeAnalysisTable._(
rootNode,
treeColumn,
sizeColumn,
columns,
controller,
);
}
const AppSizeAnalysisTable._(
this.rootNode,
this.treeColumn,
this.sortColumn,
this.columns,
this.controller,
);
final TreemapNode rootNode;
final TreeColumnData<TreemapNode> treeColumn;
final ColumnData<TreemapNode> sortColumn;
final List<ColumnData<TreemapNode>> columns;
final AppSizeController controller;
@override
Widget build(BuildContext context) {
return TreeTable<TreemapNode>(
keyFactory: (node) => PageStorageKey<String>(node.name),
dataRoots:
controller.isDeferredApp.value ? rootNode.children : [rootNode],
dataKey: 'app-size-analysis',
columns: columns,
treeColumn: treeColumn,
defaultSortColumn: sortColumn,
defaultSortDirection: SortDirection.descending,
selectionNotifier: controller.analysisRoot,
autoExpandRoots: true,
);
}
}
class _NameColumn extends TreeColumnData<TreemapNode> {
_NameColumn({required this.currentRootLevel}) : super('Library or Class');
final int currentRootLevel;
@override
String getValue(TreemapNode dataObject) => dataObject.name;
@override
String? getCaption(TreemapNode dataObject) => dataObject.caption;
@override
bool get supportsSorting => true;
@override
String getTooltip(TreemapNode dataObject) => dataObject.displayText();
@override
double getNodeIndentPx(TreemapNode dataObject) {
final relativeLevel = dataObject.level - currentRootLevel;
return relativeLevel * TreeColumnData.treeToggleWidth;
}
}
class _SizeColumn extends ColumnData<TreemapNode> {
_SizeColumn()
: super(
'Size',
alignment: ColumnAlignment.right,
fixedWidthPx: scaleByFontFactor(100.0),
);
@override
Comparable getValue(TreemapNode dataObject) => dataObject.byteSize;
@override
String getDisplayValue(TreemapNode dataObject) {
return prettyPrintBytes(dataObject.byteSize, includeUnit: true)!;
}
@override
bool get supportsSorting => true;
@override
int compare(TreemapNode a, TreemapNode b) {
final Comparable valueA = getValue(a);
final Comparable valueB = getValue(b);
return valueA.compareTo(valueB);
}
}
class _SizePercentageColumn extends ColumnData<TreemapNode> {
_SizePercentageColumn({required this.totalSize})
: super(
'% of Total Size',
alignment: ColumnAlignment.right,
fixedWidthPx: scaleByFontFactor(100.0),
);
final int totalSize;
@override
double getValue(TreemapNode dataObject) =>
(dataObject.byteSize / totalSize) * 100;
@override
String getDisplayValue(TreemapNode dataObject) =>
'${getValue(dataObject).toStringAsFixed(2)} %';
@override
bool get supportsSorting => true;
@override
int compare(TreemapNode a, TreemapNode b) {
final Comparable valueA = getValue(a);
final Comparable valueB = getValue(b);
return valueA.compareTo(valueB);
}
}
class AppSizeDiffTable extends StatelessWidget {
factory AppSizeDiffTable({required TreemapNode rootNode}) {
final treeColumn = _NameColumn(currentRootLevel: rootNode.level);
final diffColumn = _DiffColumn();
final columns = List<ColumnData<TreemapNode>>.unmodifiable([
treeColumn,
diffColumn,
]);
return AppSizeDiffTable._(
rootNode,
treeColumn,
diffColumn,
columns,
);
}
const AppSizeDiffTable._(
this.rootNode,
this.treeColumn,
this.sortColumn,
this.columns,
);
final TreemapNode rootNode;
final TreeColumnData<TreemapNode> treeColumn;
final ColumnData<TreemapNode> sortColumn;
final List<ColumnData<TreemapNode>> columns;
// TODO(petedjlee): Ensure the sort column is descending with the absolute value of the size
// if the table is only showing negative values.
@override
Widget build(BuildContext context) {
return TreeTable<TreemapNode>(
keyFactory: (node) => PageStorageKey<String>(node.name),
dataRoots: [rootNode],
dataKey: 'app-size-diff',
columns: columns,
treeColumn: treeColumn,
defaultSortColumn: sortColumn,
defaultSortDirection: SortDirection.descending,
autoExpandRoots: true,
);
}
}
// TODO(peterdjlee): Add an opaque overlay / background to differentiate from
// other columns.
class _DiffColumn extends ColumnData<TreemapNode> {
_DiffColumn()
: super(
'Change',
alignment: ColumnAlignment.right,
fixedWidthPx: scaleByFontFactor(100.0),
);
// Ensure sort by absolute size.
@override
int getValue(TreemapNode dataObject) => dataObject.unsignedByteSize;
// TODO(peterdjlee): Add up or down arrows indicating increase or decrease for display value.
@override
String getDisplayValue(TreemapNode dataObject) => dataObject.prettyByteSize();
@override
bool get supportsSorting => true;
@override
int compare(TreemapNode a, TreemapNode b) {
final Comparable valueA = getValue(a);
final Comparable valueB = getValue(b);
return valueA.compareTo(valueB);
}
@override
Color getTextColor(TreemapNode dataObject) {
return dataObject.byteSize < 0 ? tableDecreaseColor : tableIncreaseColor;
}
}
// TODO(peterdjlee): Add diff percentage column where we calculate percentage by
// (new - old) / new for every diff.
| devtools/packages/devtools_app/lib/src/screens/app_size/app_size_table.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/app_size/app_size_table.dart",
"repo_id": "devtools",
"token_count": 2431
} | 134 |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:vm_service/vm_service.dart';
import '../../shared/diagnostics/primitives/source_location.dart';
import '../../shared/globals.dart';
import '../../shared/primitives/trees.dart';
import '../vm_developer/vm_service_private_extensions.dart';
import 'debugger_model.dart';
import 'program_explorer_controller.dart';
/// A node in a tree of VM service objects.
///
/// A node can represent one of the following:
/// - Directory
/// - Library (with or without a script)
/// - Script
/// - Class
/// - Field
/// - Function
/// - Code
class VMServiceObjectNode extends TreeNode<VMServiceObjectNode> {
VMServiceObjectNode(
this.controller,
String? name,
this.object, {
this.isSelectable = true,
}) : name = name ?? '';
static const dartPrefix = 'dart:';
static const packagePrefix = 'package:';
final ProgramExplorerController controller;
final String name;
bool isSelectable;
ObjRef? object;
ScriptRef? script;
ScriptLocation? location;
/// This exists to allow for O(1) lookup of children when building the tree.
final _childrenAsMap = <String, VMServiceObjectNode>{};
@override
bool shouldShow() {
return true;
}
// TODO(bkonyi): handle empty classes
@override
bool get isExpandable => super.isExpandable || object is ClassRef;
bool get isDirectory => script == null && object == null;
List<VMServiceObjectNode>? _outline;
Future<List<VMServiceObjectNode>?> get outline async {
if (_outline != null) {
return _outline;
}
final root = VMServiceObjectNode(
controller,
'<root>',
ObjRef(id: '0'),
);
String uri;
Library lib;
if (object is Library) {
lib = object as Library;
uri = lib.uri ?? '';
} else {
// Try to find the library in the tree. If the current node isn't a
// library node, it's likely one of its parents are.
VMServiceObjectNode? libNode = this;
while (libNode != null && libNode.object is! Library) {
libNode = libNode.parent;
}
// In the case of patch files, the parent nodes won't include a library.
// We'll need to search for the library URI that is a prefix of the
// script's URI.
if (libNode == null) {
final service = serviceConnection.serviceManager.service!;
final isolate = serviceConnection
.serviceManager.isolateManager.selectedIsolate.value!;
final libRef = serviceConnection.serviceManager.isolateManager
.isolateState(isolate)
.isolateNow!
.libraries!
.firstWhere(
(lib) => script!.uri!.startsWith(lib.uri!),
);
lib = await service.getObject(isolate.id!, libRef.id!) as Library;
} else {
lib = libNode.object as Library;
}
final ScriptRef s = (object is ScriptRef) ? object as ScriptRef : script!;
uri = s.uri ?? '';
}
for (final clazzRef in lib.classes!) {
// Don't surface synthetic classes created by mixin applications.
if (clazzRef.name!.contains('&')) {
continue;
}
if (clazzRef.location?.script?.uri == uri) {
final clazzNode = VMServiceObjectNode(
controller,
clazzRef.name,
clazzRef,
);
await controller.populateNode(clazzNode);
root.addChild(clazzNode);
}
}
for (final function in lib.functions!) {
if (function.location?.script?.uri == uri) {
final node = VMServiceObjectNode(
controller,
function.name,
function,
);
await controller.populateNode(node);
_buildCodeNodes(node.object as Func, node);
root.addChild(node);
}
}
for (final field in lib.variables!) {
if (field.location?.script?.uri == uri) {
final node = VMServiceObjectNode(
controller,
field.name,
field,
);
await controller.populateNode(node);
root.addChild(node);
}
}
// Clear out the _childrenAsMap map.
root._trimChildrenAsMapEntries();
root._sortEntriesByType();
_outline = root.children;
return _outline;
}
/// Given a flat list of service protocol scripts, return a tree of scripts
/// representing the best hierarchical grouping.
static List<VMServiceObjectNode> createRootsFrom(
ProgramExplorerController controller,
List<LibraryRef> libs,
) {
if (libs.isEmpty) {
return [];
}
// The name of this node is not exposed to users.
final root = VMServiceObjectNode(controller, '<root>', ObjRef(id: '0'));
final scripts = scriptManager.sortedScripts.value;
for (final script in scripts) {
_buildScriptNode(root, script);
}
for (final lib in libs) {
for (final child in root.children) {
if (child.script?.uri == lib.uri) {
child.object = lib;
}
}
}
// Clear out the _childrenAsMap map.
root._trimChildrenAsMapEntries();
final processed = root.children
.map((e) => e._collapseSingleChildDirectoryNodes())
.toList();
root.children.clear();
root.addAllChildren(processed);
// Sort each subtree to use the following ordering:
// - Scripts
// - Classes
// - Functions
// - Variables
root._sortEntriesByType();
// Place the root library's parent node at the top of the explorer if it's
// part of a package. Otherwise, it's a file path and its directory should
// appear near the top of the list anyway.
final rootLibUri = serviceConnection.serviceManager.isolateManager
.mainIsolateState?.isolateNow?.rootLib?.uri;
if (rootLibUri != null) {
if (rootLibUri.startsWith('package:') ||
rootLibUri.startsWith('google3:')) {
final parts = rootLibUri.split('/')..removeLast();
final path = parts.join('/');
for (int i = 0; i < root.children.length; ++i) {
if (root.children[i].name.startsWith(path)) {
final VMServiceObjectNode rootLibNode = root.removeChildAtIndex(i);
root.addChild(rootLibNode, index: 0);
break;
}
}
}
}
return root.children;
}
static VMServiceObjectNode _buildScriptNode(
VMServiceObjectNode node,
ScriptRef script, {
LibraryRef? lib,
}) {
final parts = script.uri!.split('/');
final name = parts.removeLast();
for (final part in parts) {
// Directory nodes shouldn't be selectable unless they're a library node.
node = node._lookupOrCreateChild(
part,
null,
isSelectable: false,
);
}
node = node._lookupOrCreateChild(name, script);
if (!node.isSelectable) {
node.isSelectable = true;
}
node.script = script;
// If this is a top-level node and a library is specified, this must be a
// library node.
if (parts.isEmpty && lib != null) {
node.object = lib;
}
return node;
}
void _buildCodeNodes(Func function, VMServiceObjectNode node) {
if (!node.controller.showCodeNodes) {
return;
}
final code = function.code;
if (code != null) {
node.addChild(
VMServiceObjectNode(
controller,
code.name,
code,
),
);
final unoptimizedCode = function.unoptimizedCode;
// It's possible for `function.code` to be unoptimized code, so don't
// create a duplicate node in that situation.
if (unoptimizedCode != null && unoptimizedCode.id! != code.id!) {
node.addChild(
VMServiceObjectNode(
controller,
unoptimizedCode.name,
unoptimizedCode,
),
);
}
}
}
VMServiceObjectNode _lookupOrCreateChild(
String name,
ObjRef? object, {
bool isSelectable = true,
}) {
return _childrenAsMap.putIfAbsent(
name,
() => _createChild(name, object, isSelectable: isSelectable),
);
}
VMServiceObjectNode _createChild(
String? name,
ObjRef? object, {
bool isSelectable = true,
}) {
final child = VMServiceObjectNode(
controller,
name,
object,
isSelectable: isSelectable,
);
addChild(child);
return child;
}
VMServiceObjectNode _collapseSingleChildDirectoryNodes() {
if (children.length == 1) {
final VMServiceObjectNode child = children.first;
if (child.isDirectory) {
final collapsed = VMServiceObjectNode(
controller,
'$name/${child.name}',
null,
isSelectable: false,
);
collapsed.addAllChildren(child.children);
return collapsed._collapseSingleChildDirectoryNodes();
}
return this;
}
final updated = children
.map(
(e) => e._collapseSingleChildDirectoryNodes(),
)
.toList();
children.clear();
addAllChildren(updated);
return this;
}
void updateObject(Obj object, {bool forceUpdate = false}) {
if ((this.object is! Class || forceUpdate) && object is Class) {
for (final function in object.functions?.cast<Func>() ?? <Func>[]) {
final node = _createChild(function.name, function);
_buildCodeNodes(function, node);
}
for (final field in object.fields ?? <FieldRef>[]) {
_createChild(field.name, field);
}
_sortEntriesByType();
}
this.object = object;
}
Future<void> populateLocation() async {
if (location != null) {
return;
}
ScriptRef? scriptRef = script;
int? tokenPos = 0;
final object = this.object;
final SourceLocation? sourceLocation = switch (object) {
FieldRef(:final location) ||
FuncRef(:final location) ||
ClassRef(:final location) =>
location,
_ => null,
};
if (sourceLocation != null) {
tokenPos = sourceLocation.tokenPos;
scriptRef = sourceLocation.script;
}
if (scriptRef != null) {
final fetchedScript = await scriptManager.getScript(scriptRef);
final position = tokenPos == 0
? null
: SourcePosition.calculatePosition(fetchedScript, tokenPos!);
location = ScriptLocation(
scriptRef,
location: position,
);
}
}
/// Clear the _childrenAsMap map recursively to save memory.
void _trimChildrenAsMapEntries() {
_childrenAsMap.clear();
for (var child in children) {
child._trimChildrenAsMapEntries();
}
}
void _sortEntriesByType() {
final userDirectoryNodes = <VMServiceObjectNode>[];
final userLibraryNodes = <VMServiceObjectNode>[];
final scriptNodes = <VMServiceObjectNode>[];
final classNodes = <VMServiceObjectNode>[];
final functionNodes = <VMServiceObjectNode>[];
final variableNodes = <VMServiceObjectNode>[];
final codeNodes = <VMServiceObjectNode>[];
final packageAndCoreLibLibraryNodes = <VMServiceObjectNode>[];
final packageAndCoreLibDirectoryNodes = <VMServiceObjectNode>[];
for (final child in children) {
if (child.object == null && child.script == null) {
// Child is a directory node. Treat it as if it were a library/script
// for sorting purposes.
if (child.name.startsWith(dartPrefix) ||
child.name.startsWith(packagePrefix)) {
packageAndCoreLibDirectoryNodes.add(child);
} else {
userDirectoryNodes.add(child);
}
} else {
switch (child.object.runtimeType) {
case ScriptRef:
case Script:
scriptNodes.add(child);
break;
case LibraryRef:
case Library:
final obj = child.object as LibraryRef;
if (obj.uri!.startsWith(dartPrefix) ||
obj.uri!.startsWith(packagePrefix)) {
packageAndCoreLibLibraryNodes.add(child);
} else {
userLibraryNodes.add(child);
}
break;
case ClassRef:
case Class:
classNodes.add(child);
break;
case FuncRef:
case Func:
functionNodes.add(child);
break;
case FieldRef:
case Field:
variableNodes.add(child);
break;
case CodeRef:
case Code:
codeNodes.add(child);
break;
default:
throw StateError('Unexpected type: ${child.object.runtimeType}');
}
}
child._sortEntriesByType();
}
userDirectoryNodes.sort((a, b) {
return a.name.compareTo(b.name);
});
scriptNodes.sort((a, b) {
return a.name.compareTo(b.name);
});
userLibraryNodes.sort((a, b) {
return a.name.compareTo(b.name);
});
classNodes.sort((a, b) {
final objA = a.object as ClassRef;
final objB = b.object as ClassRef;
return objA.name!.compareTo(objB.name!);
});
functionNodes.sort((a, b) {
final objA = a.object as FuncRef;
final objB = b.object as FuncRef;
return objA.name!.compareTo(objB.name!);
});
variableNodes.sort((a, b) {
final objA = a.object as FieldRef;
final objB = b.object as FieldRef;
return objA.name!.compareTo(objB.name!);
});
packageAndCoreLibDirectoryNodes.sort((a, b) {
return a.name.compareTo(b.name);
});
packageAndCoreLibLibraryNodes.sort((a, b) {
return a.name.compareTo(b.name);
});
children
..clear()
..addAll([
...userLibraryNodes,
...userDirectoryNodes,
...scriptNodes,
...classNodes,
...functionNodes,
...variableNodes,
...codeNodes,
// We treat core libraries and packages as their own category as users
// are likely more interested in code within their own project.
// TODO(bkonyi): do we need custom google3 heuristics here?
...packageAndCoreLibLibraryNodes,
...packageAndCoreLibDirectoryNodes,
]);
}
@override
int get hashCode => script?.uri.hashCode ?? object?.hashCode ?? name.hashCode;
@override
bool operator ==(Object other) {
if (other is! VMServiceObjectNode) return false;
final VMServiceObjectNode node = other;
return node.name == name &&
node.object == object &&
node.script?.uri == script?.uri;
}
@override
TreeNode<VMServiceObjectNode> shallowCopy() {
throw UnimplementedError(
'This method is not implemented. Implement if you '
'need to call `shallowCopy` on an instance of this class.',
);
}
}
| devtools/packages/devtools_app/lib/src/screens/debugger/program_explorer_model.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/debugger/program_explorer_model.dart",
"repo_id": "devtools",
"token_count": 6177
} | 135 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:collection';
import 'dart:math';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:logging/logging.dart';
import '../../shared/analytics/analytics.dart' as ga;
import '../../shared/analytics/constants.dart' as gac;
import '../../shared/analytics/metrics.dart';
import '../../shared/collapsible_mixin.dart';
import '../../shared/common_widgets.dart';
import '../../shared/console/eval/inspector_tree.dart';
import '../../shared/console/widgets/description.dart';
import '../../shared/diagnostics/diagnostics_node.dart';
import '../../shared/diagnostics_text_styles.dart';
import '../../shared/error_badge_manager.dart';
import '../../shared/globals.dart';
import '../../shared/primitives/utils.dart';
import '../../shared/ui/colors.dart';
import '../../shared/ui/search.dart';
import '../../shared/ui/utils.dart';
import '../../shared/utils.dart';
import 'inspector_breadcrumbs.dart';
import 'inspector_controller.dart';
final _log = Logger('inspector_tree_controller');
/// Presents a [TreeNode].
class _InspectorTreeRowWidget extends StatefulWidget {
/// Constructs a [_InspectorTreeRowWidget] that presents a line in the
/// Inspector tree.
const _InspectorTreeRowWidget({
required Key key,
required this.row,
required this.inspectorTreeState,
this.error,
required this.scrollControllerX,
required this.viewportWidth,
}) : super(key: key);
final _InspectorTreeState inspectorTreeState;
InspectorTreeNode get node => row.node;
final InspectorTreeRow row;
final ScrollController scrollControllerX;
final double viewportWidth;
/// A [DevToolsError] that applies to the widget in this row.
///
/// This will be null if there is no error for this row.
final DevToolsError? error;
@override
_InspectorTreeRowState createState() => _InspectorTreeRowState();
}
class _InspectorTreeRowState extends State<_InspectorTreeRowWidget>
with TickerProviderStateMixin, CollapsibleAnimationMixin {
@override
Widget build(BuildContext context) {
return SizedBox(
height: inspectorRowHeight,
child: InspectorRowContent(
row: widget.row,
error: widget.error,
expandArrowAnimation: expandArrowAnimation,
controller: widget.inspectorTreeState.treeController!,
scrollControllerX: widget.scrollControllerX,
viewportWidth: widget.viewportWidth,
onToggle: () {
setExpanded(!isExpanded);
},
),
);
}
@override
bool get isExpanded => widget.node.isExpanded;
@override
void onExpandChanged(bool expanded) {
setState(() {
final row = widget.row;
if (expanded) {
widget.inspectorTreeState.treeController!.onExpandRow(row);
} else {
widget.inspectorTreeState.treeController!.onCollapseRow(row);
}
});
}
@override
bool shouldShow() => widget.node.shouldShow;
}
class InspectorTreeController extends DisposableController
with SearchControllerMixin<InspectorTreeRow> {
InspectorTreeController({this.gaId}) {
ga.select(
gac.inspector,
gac.inspectorTreeControllerInitialized,
nonInteraction: true,
screenMetricsProvider: () => InspectorScreenMetrics(
inspectorTreeControllerId: gaId,
rootSetCount: _rootSetCount,
rowCount: _root?.subtreeSize,
),
);
}
/// Clients the controller notifies to trigger changes to the UI.
final Set<InspectorControllerClient> _clients = {};
/// Identifier used when sending Google Analytics about events in this
/// [InspectorTreeController].
final int? gaId;
InspectorTreeNode createNode() => InspectorTreeNode();
SearchTargetType _searchTarget = SearchTargetType.widget;
int _rootSetCount = 0;
void addClient(InspectorControllerClient value) {
final firstClient = _clients.isEmpty;
_clients.add(value);
if (firstClient) {
config.onClientActiveChange?.call(true);
}
}
void removeClient(InspectorControllerClient value) {
_clients.remove(value);
if (_clients.isEmpty) {
config.onClientActiveChange?.call(false);
}
}
// Method defined to avoid a direct Flutter dependency.
void setState(VoidCallback fn) {
fn();
for (var client in _clients) {
client.onChanged();
}
}
void requestFocus() {
for (var client in _clients) {
client.requestFocus();
}
}
InspectorTreeNode? get root => _root;
InspectorTreeNode? _root;
set root(InspectorTreeNode? node) {
setState(() {
_root = node;
_populateSearchableCachedRows();
ga.select(
gac.inspector,
gac.inspectorTreeControllerRootChange,
nonInteraction: true,
screenMetricsProvider: () => InspectorScreenMetrics(
inspectorTreeControllerId: gaId,
rootSetCount: ++_rootSetCount,
rowCount: _root?.subtreeSize,
),
);
});
}
InspectorTreeNode? get selection => _selection;
InspectorTreeNode? _selection;
late final InspectorTreeConfig config;
set selection(InspectorTreeNode? node) {
if (node == _selection) return;
setState(() {
_selection?.selected = false;
_selection = node;
_selection?.selected = true;
final configLocal = config;
if (configLocal.onSelectionChange != null) {
configLocal.onSelectionChange!();
}
});
}
InspectorTreeNode? get hover => _hover;
InspectorTreeNode? _hover;
double? lastContentWidth;
final cachedRows = <InspectorTreeRow?>[];
InspectorTreeRow? _cachedSelectedRow;
/// All cached rows of the tree.
///
/// Similar to [cachedRows] but:
/// * contains every row in the tree (including collapsed rows)
/// * items don't change when nodes are expanded or collapsed
/// * items are populated only when root is changed
final _searchableCachedRows = <InspectorTreeRow?>[];
void setSearchTarget(SearchTargetType searchTarget) {
_searchTarget = searchTarget;
refreshSearchMatches();
}
// TODO: we should add a listener instead that clears the cache when the
// root is marked as dirty.
void _maybeClearCache() {
final rootLocal = root;
if (rootLocal != null && rootLocal.isDirty) {
cachedRows.clear();
_cachedSelectedRow = null;
rootLocal.isDirty = false;
lastContentWidth = null;
}
}
void _populateSearchableCachedRows() {
_searchableCachedRows.clear();
for (int i = 0; i < numRows; i++) {
_searchableCachedRows.add(getCachedRow(i));
}
}
InspectorTreeRow? getCachedRow(int index) {
if (index < 0) return null;
_maybeClearCache();
while (cachedRows.length <= index) {
cachedRows.add(null);
}
cachedRows[index] ??= root?.getRow(index);
final cachedRow = cachedRows[index];
cachedRow?.isSearchMatch =
_searchableCachedRows.safeGet(index)?.isSearchMatch ?? false;
if (cachedRow?.isSelected == true) {
_cachedSelectedRow = cachedRow;
}
return cachedRow;
}
double getRowOffset(int index) {
return (getCachedRow(index)?.depth ?? 0) * inspectorColumnWidth;
}
List<InspectorTreeNode> getPathFromSelectedRowToRoot() {
final selectedItem = _cachedSelectedRow?.node;
if (selectedItem == null) return [];
final pathToRoot = <InspectorTreeNode>[selectedItem];
InspectorTreeNode? nextParentNode = selectedItem.parent;
while (nextParentNode != null) {
pathToRoot.add(nextParentNode);
nextParentNode = nextParentNode.parent;
}
return pathToRoot.reversed.toList();
}
set hover(InspectorTreeNode? node) {
if (node == _hover) {
return;
}
setState(() {
_hover = node;
// TODO(jacobr): we could choose to repaint only a portion of the UI
});
}
void navigateUp() {
_navigateHelper(-1);
}
void navigateDown() {
_navigateHelper(1);
}
void navigateLeft() {
final selectionLocal = selection;
// This logic is consistent with how IntelliJ handles tree navigation on
// on left arrow key press.
if (selectionLocal == null) {
_navigateHelper(-1);
return;
}
if (selectionLocal.isExpanded) {
setState(() {
selectionLocal.isExpanded = false;
});
return;
}
if (selectionLocal.parent != null) {
selection = selectionLocal.parent;
}
}
void navigateRight() {
// This logic is consistent with how IntelliJ handles tree navigation on
// on right arrow key press.
final selectionLocal = selection;
if (selectionLocal == null || selectionLocal.isExpanded) {
_navigateHelper(1);
return;
}
setState(() {
selectionLocal.isExpanded = true;
});
}
void _navigateHelper(int indexOffset) {
if (numRows == 0) return;
if (selection == null) {
selection = root;
return;
}
final rootLocal = root!;
selection = rootLocal
.getRow(
(rootLocal.getRowIndex(selection!) + indexOffset)
.clamp(0, numRows - 1),
)
?.node;
}
double get horizontalPadding => 10.0;
double getDepthIndent(int depth) {
return (depth + 1) * inspectorColumnWidth + horizontalPadding;
}
double rowYTop(int index) {
return inspectorRowHeight * index;
}
void nodeChanged(InspectorTreeNode node) {
setState(() {
node.isDirty = true;
});
}
void removeNodeFromParent(InspectorTreeNode node) {
setState(() {
node.parent?.removeChild(node);
});
}
void appendChild(InspectorTreeNode node, InspectorTreeNode child) {
setState(() {
node.appendChild(child);
});
}
void expandPath(InspectorTreeNode? node) {
setState(() {
_expandPath(node);
});
}
void _expandPath(InspectorTreeNode? node) {
while (node != null) {
if (!node.isExpanded) {
node.isExpanded = true;
}
node = node.parent;
}
}
void collapseToSelected() {
setState(() {
_collapseAllNodes(root!);
if (selection == null) return;
_expandPath(selection);
});
}
void _collapseAllNodes(InspectorTreeNode root) {
root.isExpanded = false;
root.children.forEach(_collapseAllNodes);
}
int get numRows => root?.subtreeSize ?? 0;
int getRowIndex(double y) => max(0, y ~/ inspectorRowHeight);
InspectorTreeRow? getRowForNode(InspectorTreeNode node) {
final rootLocal = root;
if (rootLocal == null) return null;
return getCachedRow(rootLocal.getRowIndex(node));
}
InspectorTreeRow? getRow(Offset offset) {
final rootLocal = root;
if (rootLocal == null) return null;
final int row = getRowIndex(offset.dy);
return row < rootLocal.subtreeSize ? getCachedRow(row) : null;
}
void onExpandRow(InspectorTreeRow row) {
setState(() {
final onExpand = config.onExpand;
row.node.isExpanded = true;
if (onExpand != null) {
onExpand(row.node);
}
});
}
void onCollapseRow(InspectorTreeRow row) {
setState(() {
row.node.isExpanded = false;
});
}
void onSelectRow(InspectorTreeRow row) {
onSelectNode(row.node);
}
void onSelectNode(InspectorTreeNode? node) {
selection = node;
ga.select(
gac.inspector,
gac.treeNodeSelection,
);
expandPath(node);
}
Rect getBoundingBox(InspectorTreeRow row) {
// For future reference: the bounding box likely needs to be in terms of
// positions after the current animations are complete so that computations
// to start animations to show specific widget scroll to where the target
// nodes will be displayed rather than where they are currently displayed.
final diagnostic = row.node.diagnostic;
// The node width is approximated since the widgets are not available at the
// time of calculating the bounding box.
final approximateNodeWidth =
DiagnosticsNodeDescription.approximateNodeWidth(diagnostic);
return Rect.fromLTWH(
getDepthIndent(row.depth),
rowYTop(row.index),
approximateNodeWidth,
inspectorRowHeight,
);
}
void scrollToRect(Rect targetRect) {
for (var client in _clients) {
client.scrollToRect(targetRect);
}
}
/// Width each row in the tree should have ignoring its indent.
///
/// Content in rows should wrap if it exceeds this width.
final double rowWidth = 1200;
/// Maximum indent of the tree in pixels.
double? _maxIndent;
double get maxRowIndent {
if (lastContentWidth == null) {
double maxIndent = 0;
for (int i = 0; i < numRows; i++) {
final row = getCachedRow(i);
if (row != null) {
maxIndent = max(maxIndent, getDepthIndent(row.depth));
}
}
lastContentWidth = maxIndent + maxIndent;
_maxIndent = maxIndent;
}
return _maxIndent!;
}
void animateToTargets(List<InspectorTreeNode> targets) {
Rect? targetRect;
for (InspectorTreeNode target in targets) {
final row = getRowForNode(target);
if (row != null) {
final rowRect = getBoundingBox(row);
targetRect =
targetRect == null ? rowRect : targetRect.expandToInclude(rowRect);
}
}
if (targetRect == null || targetRect.isEmpty) return;
scrollToRect(targetRect);
}
bool expandPropertiesByDefault(DiagnosticsTreeStyle style) {
// This code matches the text style defaults for which styles are
// by default and which aren't.
switch (style) {
case DiagnosticsTreeStyle.none:
case DiagnosticsTreeStyle.singleLine:
case DiagnosticsTreeStyle.errorProperty:
return false;
case DiagnosticsTreeStyle.sparse:
case DiagnosticsTreeStyle.offstage:
case DiagnosticsTreeStyle.dense:
case DiagnosticsTreeStyle.transition:
case DiagnosticsTreeStyle.error:
case DiagnosticsTreeStyle.whitespace:
case DiagnosticsTreeStyle.flat:
case DiagnosticsTreeStyle.shallow:
case DiagnosticsTreeStyle.truncateChildren:
return true;
}
}
InspectorTreeNode setupInspectorTreeNode(
InspectorTreeNode node,
RemoteDiagnosticsNode diagnosticsNode, {
required bool expandChildren,
required bool expandProperties,
}) {
node.diagnostic = diagnosticsNode;
final configLocal = config;
if (configLocal.onNodeAdded != null) {
configLocal.onNodeAdded!(node, diagnosticsNode);
}
if (diagnosticsNode.hasChildren ||
diagnosticsNode.inlineProperties.isNotEmpty) {
if (diagnosticsNode.childrenReady || !diagnosticsNode.hasChildren) {
final bool styleIsMultiline =
expandPropertiesByDefault(diagnosticsNode.style);
setupChildren(
diagnosticsNode,
node,
node.diagnostic!.childrenNow,
expandChildren: expandChildren && styleIsMultiline,
expandProperties: expandProperties && styleIsMultiline,
);
} else {
node.clearChildren();
node.appendChild(createNode());
}
}
return node;
}
void setupChildren(
RemoteDiagnosticsNode parent,
InspectorTreeNode treeNode,
List<RemoteDiagnosticsNode>? children, {
required bool expandChildren,
required bool expandProperties,
}) {
treeNode.isExpanded = expandChildren;
if (treeNode.children.isNotEmpty) {
// Only case supported is this is the loading node.
assert(treeNode.children.length == 1);
removeNodeFromParent(treeNode.children.first);
}
final inlineProperties = parent.inlineProperties;
for (RemoteDiagnosticsNode property in inlineProperties) {
appendChild(
treeNode,
setupInspectorTreeNode(
createNode(),
property,
// We are inside a property so only expand children if
// expandProperties is true.
expandChildren: expandProperties,
expandProperties: expandProperties,
),
);
}
if (children != null) {
for (RemoteDiagnosticsNode child in children) {
appendChild(
treeNode,
setupInspectorTreeNode(
createNode(),
child,
expandChildren: expandChildren,
expandProperties: expandProperties,
),
);
}
}
}
Future<void> maybePopulateChildren(InspectorTreeNode treeNode) async {
final RemoteDiagnosticsNode? diagnostic = treeNode.diagnostic;
if (diagnostic != null &&
diagnostic.hasChildren &&
(treeNode.hasPlaceholderChildren || treeNode.children.isEmpty)) {
try {
final children = await diagnostic.children;
if (treeNode.hasPlaceholderChildren || treeNode.children.isEmpty) {
setupChildren(
diagnostic,
treeNode,
children,
expandChildren: true,
expandProperties: false,
);
nodeChanged(treeNode);
if (treeNode == selection) {
expandPath(treeNode);
}
}
} catch (e, st) {
_log.shout(e, e, st);
}
}
}
/* Search support */
@override
void onMatchChanged(int index) {
onSelectRow(searchMatches.value[index]);
}
@override
Duration get debounceDelay => const Duration(milliseconds: 300);
@override
List<InspectorTreeRow> matchesForSearch(
String search, {
bool searchPreviousMatches = false,
}) {
final matches = <InspectorTreeRow>[];
if (searchPreviousMatches) {
final List<InspectorTreeRow> previousMatches = searchMatches.value;
for (final previousMatch in previousMatches) {
if (previousMatch.node.diagnostic!.searchValue
.caseInsensitiveContains(search)) {
matches.add(previousMatch);
}
}
if (matches.isNotEmpty) return matches;
}
int debugStatsSearchOps = 0;
final debugStatsWidgets = _searchableCachedRows.length;
final inspectorService = serviceConnection.inspectorService;
if (search.isEmpty ||
inspectorService == null ||
inspectorService.isDisposed) {
assert(
() {
debugPrint('Search completed, no search');
return true;
}(),
);
return matches;
}
assert(
() {
debugPrint('Search started: $_searchTarget');
return true;
}(),
);
for (final row in _searchableCachedRows) {
final diagnostic = row!.node.diagnostic;
if (diagnostic == null) continue;
// Widget search begin
if (_searchTarget == SearchTargetType.widget) {
debugStatsSearchOps++;
if (diagnostic.searchValue.caseInsensitiveContains(search)) {
matches.add(row);
continue;
}
}
// Widget search end
}
assert(
() {
debugPrint(
'Search completed with $debugStatsWidgets widgets, $debugStatsSearchOps ops',
);
return true;
}(),
);
return matches;
}
}
extension RemoteDiagnosticsNodeExtension on RemoteDiagnosticsNode {
String get searchValue {
final description = toStringShort();
final textPreview = json['textPreview'];
return textPreview is String
? '$description ${textPreview.replaceAll('\n', ' ')}'
: description;
}
}
abstract class InspectorControllerClient {
void onChanged();
void scrollToRect(Rect rect);
void requestFocus();
}
class InspectorTree extends StatefulWidget {
const InspectorTree({
Key? key,
required this.treeController,
this.summaryTreeController,
this.isSummaryTree = false,
this.widgetErrors,
this.screenId,
}) : assert(isSummaryTree == (summaryTreeController == null)),
super(key: key);
final InspectorTreeController? treeController;
/// Stores the summary tree controller when this instance of [InspectorTree]
/// is for the details tree (i.e. when [isSummaryTree] is false).
///
/// This value should be null when this instance of [InspectorTree] is for the
/// summary tree itself.
final InspectorTreeController? summaryTreeController;
final bool isSummaryTree;
final LinkedHashMap<String, InspectableWidgetError>? widgetErrors;
final String? screenId;
@override
State<InspectorTree> createState() => _InspectorTreeState();
}
// AutomaticKeepAlive is necessary so that the tree does not get recreated when we switch tabs.
class _InspectorTreeState extends State<InspectorTree>
with
SingleTickerProviderStateMixin,
AutomaticKeepAliveClientMixin<InspectorTree>,
AutoDisposeMixin,
ProvidedControllerMixin<InspectorController, InspectorTree>
implements InspectorControllerClient {
InspectorTreeController? get treeController => widget.treeController;
late ScrollController _scrollControllerY;
late ScrollController _scrollControllerX;
Future<void>? _currentAnimateY;
Rect? _currentAnimateTarget;
AnimationController? _constraintDisplayController;
late FocusNode _focusNode;
/// When autoscrolling, the number of rows to pad the target location with.
static const int _scrollPadCount = 3;
@override
void initState() {
super.initState();
_scrollControllerX = ScrollController();
_scrollControllerY = ScrollController();
// TODO(devoncarew): Commented out as per flutter/devtools/pull/2001.
//_scrollControllerY.addListener(_onScrollYChange);
if (widget.isSummaryTree) {
_constraintDisplayController = longAnimationController(this);
}
_focusNode = FocusNode(debugLabel: 'inspector-tree');
autoDisposeFocusNode(_focusNode);
final mainIsolateState =
serviceConnection.serviceManager.isolateManager.mainIsolateState;
if (mainIsolateState != null) {
callOnceWhenReady<bool>(
trigger: mainIsolateState.isPaused,
callback: _bindToController,
readyWhen: (triggerValue) => !triggerValue,
);
}
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
initController();
}
@override
void didUpdateWidget(InspectorTree oldWidget) {
final InspectorTreeController? oldTreeController = oldWidget.treeController;
if (oldTreeController != widget.treeController) {
oldTreeController?.removeClient(this);
// TODO(elliette): Figure out if we can remove this. See explanation:
// https://github.com/flutter/devtools/pull/1290/files#r342399899.
cancelListeners();
_bindToController();
}
super.didUpdateWidget(oldWidget);
}
@override
void dispose() {
super.dispose();
treeController?.removeClient(this);
_scrollControllerX.dispose();
_scrollControllerY.dispose();
_constraintDisplayController?.dispose();
}
@override
void requestFocus() {
_focusNode.requestFocus();
}
// TODO(devoncarew): Commented out as per flutter/devtools/pull/2001.
// void _onScrollYChange() {
// if (controller == null) return;
//
// // If the vertical position is already being animated we should not trigger
// // a new animation of the horizontal position as a more direct animation of
// // the horizontal position has already been triggered.
// if (currentAnimateY != null) return;
//
// final x = _computeTargetX(_scrollControllerY.offset);
// _scrollControllerX.animateTo(
// x,
// duration: defaultDuration,
// curve: defaultCurve,
// );
// }
@override
Future<void> scrollToRect(Rect rect) async {
if (rect == _currentAnimateTarget) {
// We are in the middle of an animation to this exact rectangle.
return;
}
final initialX = rect.left;
final initialY = rect.top;
final yOffsetAtViewportTop = _scrollControllerY.hasClients
? _scrollControllerY.offset
: _scrollControllerY.initialScrollOffset;
final xOffsetAtViewportLeft = _scrollControllerX.hasClients
? _scrollControllerX.offset
: _scrollControllerX.initialScrollOffset;
final viewPortInScrollControllerSpace = Rect.fromLTWH(
xOffsetAtViewportLeft,
yOffsetAtViewportTop,
safeViewportWidth,
safeViewportHeight,
);
final isRectInViewPort =
viewPortInScrollControllerSpace.contains(rect.topLeft) &&
viewPortInScrollControllerSpace.contains(rect.bottomRight);
if (isRectInViewPort) {
// The rect is already in view, don't scroll
return;
}
_currentAnimateTarget = rect;
final targetY = _padTargetY(initialY: initialY);
if (_scrollControllerY.hasClients) {
_currentAnimateY = _scrollControllerY.animateTo(
targetY,
duration: longDuration,
curve: defaultCurve,
);
} else {
_currentAnimateY = null;
_scrollControllerY = ScrollController(initialScrollOffset: targetY);
}
final targetX = _padTargetX(initialX: initialX);
if (_scrollControllerX.hasClients) {
unawaited(
_scrollControllerX.animateTo(
targetX,
duration: longDuration,
curve: defaultCurve,
),
);
} else {
_scrollControllerX = ScrollController(initialScrollOffset: targetX);
}
try {
await _currentAnimateY;
} catch (e) {
// Doesn't matter if the animation was cancelled.
}
_currentAnimateY = null;
_currentAnimateTarget = null;
}
// TODO(jacobr): resolve cases where we need to know the viewport height
// before it is available so we don't need this approximation.
/// Placeholder viewport height to use if we don't yet know the real
/// viewport height.
static const _placeholderViewportSize = Size(1000.0, 1000.0);
double get safeViewportHeight {
return _scrollControllerY.hasClients
? _scrollControllerY.position.viewportDimension
: _placeholderViewportSize.height;
}
double get safeViewportWidth {
return _scrollControllerX.hasClients
? _scrollControllerX.position.viewportDimension
: _placeholderViewportSize.width;
}
/// Pad [initialX] with the horizontal indentation of [padCount] rows.
double _padTargetX({
required double initialX,
int padCount = _scrollPadCount,
}) {
return initialX - inspectorColumnWidth * padCount;
}
/// Pad [initialY] so that a row would be placed in the vertical center of
/// the screen.
double _padTargetY({
required double initialY,
}) {
return initialY - (safeViewportHeight / 2) + inspectorRowHeight / 2;
}
/// Handle arrow keys for the InspectorTree. Ignore other key events so that
/// other widgets have a chance to respond to them.
KeyEventResult _handleKeyEvent(FocusNode _, KeyEvent event) {
if (!event.isKeyDownOrRepeat) return KeyEventResult.ignored;
final treeControllerLocal = treeController!;
if (event.logicalKey == LogicalKeyboardKey.arrowDown) {
treeControllerLocal.navigateDown();
return KeyEventResult.handled;
} else if (event.logicalKey == LogicalKeyboardKey.arrowUp) {
treeControllerLocal.navigateUp();
return KeyEventResult.handled;
} else if (event.logicalKey == LogicalKeyboardKey.arrowLeft) {
treeControllerLocal.navigateLeft();
return KeyEventResult.handled;
} else if (event.logicalKey == LogicalKeyboardKey.arrowRight) {
treeControllerLocal.navigateRight();
return KeyEventResult.handled;
}
return KeyEventResult.ignored;
}
void _bindToController() {
treeController?.addClient(this);
}
@override
void onChanged() {
setState(() {});
}
@override
Widget build(BuildContext context) {
super.build(context);
final treeControllerLocal = treeController;
if (treeControllerLocal == null) {
// Indicate the tree is loading.
return const CenteredCircularProgressIndicator();
}
if (treeControllerLocal.numRows == 0) {
// This works around a bug when Scrollbars are present on a short lived
// widget.
return const SizedBox();
}
if (!controller.firstInspectorTreeLoadCompleted && widget.isSummaryTree) {
final screenId = widget.screenId;
if (screenId != null) {
ga.timeEnd(screenId, gac.pageReady);
unawaited(
serviceConnection.sendDwdsEvent(
screen: screenId,
action: gac.pageReady,
),
);
}
controller.firstInspectorTreeLoadCompleted = true;
}
return LayoutBuilder(
builder: (context, constraints) {
final viewportWidth = constraints.maxWidth;
final Widget tree = Scrollbar(
thumbVisibility: true,
controller: _scrollControllerX,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
controller: _scrollControllerX,
child: ConstrainedBox(
constraints: BoxConstraints(
maxWidth: treeControllerLocal.rowWidth +
treeControllerLocal.maxRowIndent,
),
// TODO(kenz): this scrollbar needs to be sticky to the right side of
// the visible container - right now it is lined up to the right of
// the widest row (which is likely not visible). This may require some
// refactoring.
child: GestureDetector(
onTap: _focusNode.requestFocus,
child: Focus(
onKeyEvent: _handleKeyEvent,
autofocus: widget.isSummaryTree,
focusNode: _focusNode,
child: OffsetScrollbar(
isAlwaysShown: true,
axis: Axis.vertical,
controller: _scrollControllerY,
offsetController: _scrollControllerX,
offsetControllerViewportDimension: viewportWidth,
child: ListView.custom(
itemExtent: inspectorRowHeight,
childrenDelegate: SliverChildBuilderDelegate(
(context, index) {
if (index == treeControllerLocal.numRows) {
return SizedBox(height: inspectorRowHeight);
}
final InspectorTreeRow row =
treeControllerLocal.getCachedRow(index)!;
final inspectorRef = row.node.diagnostic?.valueRef.id;
return _InspectorTreeRowWidget(
key: PageStorageKey(row.node),
inspectorTreeState: this,
row: row,
scrollControllerX: _scrollControllerX,
viewportWidth: viewportWidth,
error: widget.widgetErrors != null &&
inspectorRef != null
? widget.widgetErrors![inspectorRef]
: null,
);
},
childCount: treeControllerLocal.numRows + 1,
),
controller: _scrollControllerY,
),
),
),
),
),
),
);
final bool shouldShowBreadcrumbs = !widget.isSummaryTree;
if (shouldShowBreadcrumbs) {
final inspectorTreeController = widget.summaryTreeController!;
final parents =
inspectorTreeController.getPathFromSelectedRowToRoot();
return Column(
children: [
InspectorBreadcrumbNavigator(
items: parents,
onTap: (node) => inspectorTreeController.onSelectNode(node),
),
Expanded(child: tree),
],
);
}
return tree;
},
);
}
@override
bool get wantKeepAlive => true;
}
Paint _defaultPaint(ColorScheme colorScheme) => Paint()
..color = colorScheme.treeGuidelineColor
..strokeWidth = chartLineStrokeWidth;
/// Custom painter that draws lines indicating how parent and child rows are
/// connected to each other.
///
/// Each rows object contains a list of ticks that indicate the x coordinates of
/// vertical lines connecting other rows need to be drawn within the vertical
/// area of the current row. This approach has the advantage that a row contains
/// all information required to render all content within it but has the
/// disadvantage that the x coordinates of each line connecting rows must be
/// computed in advance.
class _RowPainter extends CustomPainter {
_RowPainter(this.row, this._controller, this.colorScheme);
final InspectorTreeController _controller;
final InspectorTreeRow row;
final ColorScheme colorScheme;
@override
void paint(Canvas canvas, Size size) {
double currentX = 0;
final paint = _defaultPaint(colorScheme);
final InspectorTreeNode node = row.node;
final bool showExpandCollapse = node.showExpandCollapse;
for (int tick in row.ticks) {
currentX = _controller.getDepthIndent(tick) - inspectorColumnWidth * 0.5;
// Draw a vertical line for each tick identifying a connection between
// an ancestor of this node and some other node in the tree.
canvas.drawLine(
Offset(currentX, 0.0),
Offset(currentX, inspectorRowHeight),
paint,
);
}
// If this row is itself connected to a parent then draw the L shaped line
// to make that connection.
if (row.lineToParent) {
currentX = _controller.getDepthIndent(row.depth - 1) -
inspectorColumnWidth * 0.5;
final double width = showExpandCollapse
? inspectorColumnWidth * 0.5
: inspectorColumnWidth;
canvas.drawLine(
Offset(currentX, 0.0),
Offset(currentX, inspectorRowHeight * 0.5),
paint,
);
canvas.drawLine(
Offset(currentX, inspectorRowHeight * 0.5),
Offset(currentX + width, inspectorRowHeight * 0.5),
paint,
);
}
}
@override
bool shouldRepaint(CustomPainter oldDelegate) {
if (oldDelegate is _RowPainter) {
// TODO(jacobr): check whether the row has different ticks.
return oldDelegate.colorScheme.isLight != colorScheme.isLight;
}
return true;
}
}
/// Widget defining the contents of a single row in the InspectorTree.
///
/// This class defines the scaffolding around the rendering of the actual
/// content of a [RemoteDiagnosticsNode] provided by
/// [DiagnosticsNodeDescription] to provide a tree implementation with lines
/// drawn between parent and child nodes when nodes have multiple children.
///
/// Changes to how the actual content of the node within the row should
/// be implemented by changing [DiagnosticsNodeDescription] instead.
class InspectorRowContent extends StatelessWidget {
const InspectorRowContent({
super.key,
required this.row,
required this.controller,
required this.onToggle,
required this.expandArrowAnimation,
this.error,
required this.scrollControllerX,
required this.viewportWidth,
});
final InspectorTreeRow row;
final InspectorTreeController controller;
final VoidCallback onToggle;
final Animation<double> expandArrowAnimation;
final ScrollController scrollControllerX;
final double viewportWidth;
/// A [DevToolsError] that applies to the widget in this row.
///
/// This will be null if there is no error for this row.
final DevToolsError? error;
/// Whether this row has any error.
bool get hasError => error != null;
@override
Widget build(BuildContext context) {
final double currentX =
controller.getDepthIndent(row.depth) - inspectorColumnWidth;
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
Color? backgroundColor;
if (row.isSelected) {
backgroundColor = hasError
? colorScheme.errorContainer
: colorScheme.selectedRowBackgroundColor;
}
final node = row.node;
Widget rowWidget = Padding(
padding: EdgeInsets.only(left: currentX),
child: ValueListenableBuilder<String>(
valueListenable: controller.searchNotifier,
builder: (context, searchValue, _) {
return Opacity(
opacity: searchValue.isEmpty || row.isSearchMatch ? 1 : 0.2,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
node.showExpandCollapse
? InkWell(
onTap: onToggle,
child: RotationTransition(
turns: expandArrowAnimation,
child: Icon(
Icons.expand_more,
size: defaultIconSize,
),
),
)
: const SizedBox(
width: defaultSpacing,
height: defaultSpacing,
),
Expanded(
child: Container(
color: backgroundColor,
child: InkWell(
onTap: () {
controller.onSelectRow(row);
// TODO(gmoothart): It may be possible to capture the tap
// and request focus directly from the InspectorTree. Then
// we wouldn't need this.
controller.requestFocus();
},
child: SizedBox(
height: inspectorRowHeight,
child: DiagnosticsNodeDescription(
node.diagnostic,
isSelected: row.isSelected,
searchValue: searchValue,
errorText: error?.errorMessage,
nodeDescriptionHighlightStyle:
searchValue.isEmpty || !row.isSearchMatch
? DiagnosticsTextStyles.regular(
Theme.of(context).colorScheme,
)
: row.isSelected
? theme.searchMatchHighlightStyleFocused
: theme.searchMatchHighlightStyle,
),
),
),
),
),
],
),
);
},
),
);
// Wrap with tooltip if there is an error for this node's widget.
if (hasError) {
rowWidget =
DevToolsTooltip(message: error!.errorMessage, child: rowWidget);
}
return CustomPaint(
painter: _RowPainter(row, controller, colorScheme),
size: Size(currentX, inspectorRowHeight),
child: Align(
alignment: Alignment.topLeft,
child: AnimatedBuilder(
animation: scrollControllerX,
builder: (context, child) {
final rowWidth =
scrollControllerX.offset + viewportWidth - defaultSpacing;
return SizedBox(
width: max(rowWidth, currentX + 100),
child: rowWidth > currentX ? child : const SizedBox(),
);
},
child: rowWidget,
),
),
);
}
}
| devtools/packages/devtools_app/lib/src/screens/inspector/inspector_tree_controller.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/inspector/inspector_tree_controller.dart",
"repo_id": "devtools",
"token_count": 15891
} | 136 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../../shared/primitives/utils.dart';
import '../../shared/table/table.dart';
import '../../shared/table/table_data.dart';
import '_kind_column.dart';
import '_message_column.dart';
import '_when_column.dart';
import 'logging_controller.dart';
class LogsTable extends StatelessWidget {
const LogsTable({
Key? key,
required this.data,
required this.selectionNotifier,
required this.searchMatchesNotifier,
required this.activeSearchMatchNotifier,
}) : super(key: key);
final List<LogData> data;
final ValueNotifier<LogData?> selectionNotifier;
final ValueListenable<List<LogData>> searchMatchesNotifier;
final ValueListenable<LogData?> activeSearchMatchNotifier;
static final ColumnData<LogData> when = WhenColumn();
static final ColumnData<LogData> kind = KindColumn();
static final ColumnData<LogData> message = MessageColumn();
static final List<ColumnData<LogData>> columns = [when, kind, message];
@override
Widget build(BuildContext context) {
// TODO(kenz): use SearchableFlatTable instead.
return FlatTable<LogData>(
keyFactory: (LogData data) => ValueKey<LogData>(data),
data: data,
dataKey: 'logs',
autoScrollContent: true,
searchMatchesNotifier: searchMatchesNotifier,
activeSearchMatchNotifier: activeSearchMatchNotifier,
columns: columns,
selectionNotifier: selectionNotifier,
defaultSortColumn: when,
defaultSortDirection: SortDirection.ascending,
secondarySortColumn: message,
);
}
}
| devtools/packages/devtools_app/lib/src/screens/logging/_logs_table.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/logging/_logs_table.dart",
"repo_id": "devtools",
"token_count": 582
} | 137 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'memory_android_chart.dart';
import 'memory_events_pane.dart';
import 'memory_vm_chart.dart';
class MemoryChartPaneController {
MemoryChartPaneController({
required this.event,
required this.vm,
required this.android,
});
final EventChartController event;
final VMChartController vm;
final AndroidChartController android;
ValueListenable<bool> get legendVisibleNotifier => _legendVisibleNotifier;
final _legendVisibleNotifier = ValueNotifier<bool>(true);
bool toggleLegendVisibility() =>
_legendVisibleNotifier.value = !_legendVisibleNotifier.value;
void resetAll() {
event.reset();
vm.reset();
android.reset();
}
/// Recomputes (attaches data to the chart) for either live or offline data
/// source.
void recomputeChartData() {
resetAll();
event.setupData();
event.dirty = true;
vm.setupData();
vm.dirty = true;
android.setupData();
android.dirty = true;
}
}
| devtools/packages/devtools_app/lib/src/screens/memory/panes/chart/chart_pane_controller.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/memory/panes/chart/chart_pane_controller.dart",
"repo_id": "devtools",
"token_count": 379
} | 138 |
// Copyright 2024 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import '../../../../../shared/memory/classes.dart';
import '../../../../../shared/memory/retaining_path.dart';
import '../../../../../shared/memory/simple_items.dart';
import '../../../../../shared/primitives/utils.dart';
import '../../../shared/heap/heap.dart';
/// Comparison between two sets of objects.
class ObjectSetDiff {
ObjectSetDiff({ObjectSet? setBefore, ObjectSet? setAfter}) {
setBefore ??= ObjectSet.empty;
setAfter ??= ObjectSet.empty;
final allCodes = _unionCodes(setBefore, setAfter);
for (var code in allCodes) {
final before = setBefore.objectsByCodes[code];
final after = setAfter.objectsByCodes[code];
if (before != null && after != null) {
// When an object exists both before and after
// the state 'after' is more interesting for user
// about the retained size.
final excludeFromRetained =
setAfter.objectsExcludedFromRetainedSize.contains(after.code);
persisted.countInstance(
after,
excludeFromRetained: excludeFromRetained,
);
continue;
}
if (before != null) {
final excludeFromRetained =
setBefore.objectsExcludedFromRetainedSize.contains(before.code);
deleted.countInstance(before, excludeFromRetained: excludeFromRetained);
delta.uncountInstance(before, excludeFromRetained: excludeFromRetained);
continue;
}
if (after != null) {
final excludeFromRetained =
setAfter.objectsExcludedFromRetainedSize.contains(after.code);
created.countInstance(after, excludeFromRetained: excludeFromRetained);
delta.countInstance(after, excludeFromRetained: excludeFromRetained);
continue;
}
assert(false);
}
created.seal();
deleted.seal();
persisted.seal();
delta.seal();
assert(
delta.instanceCount == created.instanceCount - deleted.instanceCount,
);
}
static Set<IdentityHashCode> _unionCodes(ObjectSet set1, ObjectSet set2) {
final codesBefore = set1.objectsByCodes.keys.toSet();
final codesAfter = set2.objectsByCodes.keys.toSet();
return codesBefore.union(codesAfter);
}
final created = ObjectSet();
final deleted = ObjectSet();
final persisted = ObjectSet();
final delta = ObjectSetStats();
bool get isZero => delta.isZero;
}
/// Comparison between two heaps for a class.
class DiffClassData extends ClassData {
DiffClassData._({
required super.statsByPath,
required super.heapClass,
required this.total,
});
final ObjectSetDiff total;
static DiffClassData? diff({
required SingleClassStats? before,
required SingleClassStats? after,
}) {
if (before == null && after == null) return null;
final heapClass = (before?.heapClass ?? after?.heapClass)!;
final result = DiffClassData._(
heapClass: heapClass,
total: ObjectSetDiff(
setBefore: before?.objects,
setAfter: after?.objects,
),
statsByPath: subtractMaps<PathFromRoot, ObjectSetStats, ObjectSetStats,
ObjectSetStats>(
from: after?.statsByPath,
subtract: before?.statsByPath,
subtractor: ({subtract, from}) =>
ObjectSetStats.subtract(subtract: subtract, from: from),
),
);
if (result.isZero()) return null;
return result..seal();
}
bool isZero() => total.isZero;
}
| devtools/packages/devtools_app/lib/src/screens/memory/panes/diff/data/classes_diff.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/memory/panes/diff/data/classes_diff.dart",
"repo_id": "devtools",
"token_count": 1310
} | 139 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/material.dart';
import 'package:vm_service/vm_service.dart';
import '../../../../shared/analytics/analytics.dart' as ga;
import '../../../../shared/analytics/constants.dart' as gac;
import '../../../../shared/common_widgets.dart';
import '../../../../shared/globals.dart';
import '../../../../shared/primitives/byte_utils.dart';
import '../../../../shared/primitives/simple_items.dart';
import '../../../../shared/primitives/utils.dart';
import '../../../../shared/table/table.dart';
import '../../../../shared/table/table_controller.dart';
import '../../../../shared/table/table_data.dart';
import '../../../vm_developer/vm_service_private_extensions.dart';
import '../../shared/heap/class_filter.dart';
import '../../shared/primitives/simple_elements.dart';
import '../../shared/widgets/class_filter.dart';
import '../../shared/widgets/shared_memory_widgets.dart';
import 'instances.dart';
import 'model.dart';
import 'profile_pane_controller.dart';
// TODO(bkonyi): ensure data displayed in this view is included in the full
// memory page export and is serializable/deserializable.
/// The default width for columns containing *mostly* numeric data (e.g.,
/// instances, memory).
const _defaultNumberFieldWidth = 80.0;
class _FieldClassNameColumn extends ColumnData<ProfileRecord>
implements
ColumnRenderer<ProfileRecord>,
ColumnHeaderRenderer<ProfileRecord> {
_FieldClassNameColumn(this.classFilterData)
: super(
'Class',
fixedWidthPx: scaleByFontFactor(200),
);
@override
String? getValue(ProfileRecord dataObject) => dataObject.heapClass.className;
// We are removing the tooltip, because it is provided by [HeapClassView].
@override
String getTooltip(ProfileRecord dataObject) => '';
@override
bool get supportsSorting => true;
final ClassFilterData classFilterData;
@override
Widget? build(
BuildContext context,
ProfileRecord data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
if (data.isTotal) return null;
return HeapClassView(
theClass: data.heapClass,
showCopyButton: isRowSelected,
copyGaItem: gac.MemoryEvent.diffClassSingleCopy,
rootPackage: serviceConnection.serviceManager.rootInfoNow().package,
);
}
@override
Widget? buildHeader(
BuildContext context,
Widget Function() defaultHeaderRenderer,
) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: defaultHeaderRenderer()),
ClassFilterButton(classFilterData),
],
);
}
}
/// For more information on the Dart GC implementation, see:
/// https://medium.com/flutter/flutter-dont-fear-the-garbage-collector-d69b3ff1ca30
enum HeapGeneration {
newSpace,
oldSpace,
total;
@override
String toString() {
switch (this) {
case HeapGeneration.newSpace:
return 'New Space';
case HeapGeneration.oldSpace:
return 'Old Space';
case HeapGeneration.total:
return 'Total';
}
}
}
class _FieldInstanceCountColumn extends ColumnData<ProfileRecord>
implements ColumnRenderer<ProfileRecord> {
_FieldInstanceCountColumn({required this.heap})
: super(
'Instances',
titleTooltip: 'The number of instances of the class in the heap',
alignment: ColumnAlignment.right,
fixedWidthPx: scaleByFontFactor(_defaultNumberFieldWidth),
);
final HeapGeneration heap;
@override
int? getValue(ProfileRecord dataObject) {
switch (heap) {
case HeapGeneration.newSpace:
return dataObject.newSpaceInstances;
case HeapGeneration.oldSpace:
return dataObject.oldSpaceInstances;
case HeapGeneration.total:
return dataObject.totalInstances;
}
}
@override
bool get numeric => true;
@override
Widget? build(
BuildContext context,
ProfileRecord data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return ProfileInstanceTableCell(
data.heapClass,
gac.MemoryAreas.profile,
isSelected: isRowSelected,
count: data.totalInstances ?? 0,
);
}
}
class _FieldExternalSizeColumn extends _FieldSizeColumn {
_FieldExternalSizeColumn({required super.heap})
: super._(
title: 'External',
titleTooltip:
'Non-Dart heap allocated memory associated with a Dart object',
);
@override
int? getValue(ProfileRecord dataObject) {
switch (heap) {
case HeapGeneration.newSpace:
return dataObject.newSpaceExternalSize;
case HeapGeneration.oldSpace:
return dataObject.oldSpaceExternalSize;
case HeapGeneration.total:
return dataObject.totalExternalSize;
}
}
}
class _FieldDartHeapSizeColumn extends _FieldSizeColumn {
_FieldDartHeapSizeColumn({required super.heap})
: super._(
title: 'Dart Heap',
titleTooltip: SizeType.shallow.description,
);
@override
int? getValue(ProfileRecord dataObject) {
switch (heap) {
case HeapGeneration.newSpace:
return dataObject.newSpaceDartHeapSize;
case HeapGeneration.oldSpace:
return dataObject.oldSpaceDartHeapSize;
case HeapGeneration.total:
return dataObject.totalDartHeapSize;
}
}
}
class _FieldSizeColumn extends ColumnData<ProfileRecord> {
factory _FieldSizeColumn({required HeapGeneration heap}) =>
_FieldSizeColumn._(
title: 'Total Size',
titleTooltip: "The sum of the type's total shallow memory "
'consumption in the Dart heap and associated external (e.g., '
'non-Dart heap) allocations',
heap: heap,
);
_FieldSizeColumn._({
required String title,
required String titleTooltip,
required this.heap,
}) : super(
title,
titleTooltip: titleTooltip,
alignment: ColumnAlignment.right,
fixedWidthPx: scaleByFontFactor(_defaultNumberFieldWidth),
);
final HeapGeneration heap;
@override
int? getValue(ProfileRecord dataObject) {
switch (heap) {
case HeapGeneration.newSpace:
return dataObject.newSpaceSize;
case HeapGeneration.oldSpace:
return dataObject.oldSpaceSize;
case HeapGeneration.total:
return dataObject.totalSize;
}
}
@override
String getDisplayValue(ProfileRecord dataObject) =>
prettyPrintBytes(getValue(dataObject), includeUnit: true) ?? '';
@override
String getTooltip(ProfileRecord dataObject) => '${getValue(dataObject)} B';
@override
bool get numeric => true;
}
abstract class _GCHeapStatsColumn extends ColumnData<AdaptedProfile> {
_GCHeapStatsColumn(
super.title, {
required this.generation,
required super.fixedWidthPx,
super.titleTooltip,
super.alignment,
});
final HeapGeneration generation;
GCStats getGCStats(AdaptedProfile profile) {
switch (generation) {
case HeapGeneration.newSpace:
return profile.newSpaceGCStats;
case HeapGeneration.oldSpace:
return profile.oldSpaceGCStats;
case HeapGeneration.total:
return profile.totalGCStats;
}
}
}
class _GCHeapNameColumn extends ColumnData<AdaptedProfile> {
_GCHeapNameColumn()
: super(
'',
fixedWidthPx: scaleByFontFactor(200),
);
@override
String? getValue(AdaptedProfile dataObject) {
return 'GC Statistics';
}
}
class _GCHeapUsageColumn extends _GCHeapStatsColumn {
_GCHeapUsageColumn({required super.generation})
: super(
'Usage',
titleTooltip: 'The current amount of memory allocated from the heap',
alignment: ColumnAlignment.right,
fixedWidthPx: scaleByFontFactor(_defaultNumberFieldWidth),
);
@override
int? getValue(AdaptedProfile dataObject) {
return getGCStats(dataObject).usage;
}
@override
String getDisplayValue(AdaptedProfile dataObject) {
return prettyPrintBytes(getValue(dataObject), includeUnit: true)!;
}
@override
bool get numeric => true;
}
class _GCHeapCapacityColumn extends _GCHeapStatsColumn {
_GCHeapCapacityColumn({required super.generation})
: super(
'Capacity',
titleTooltip:
'The current size of the heap, including unallocated memory',
alignment: ColumnAlignment.right,
fixedWidthPx: scaleByFontFactor(_defaultNumberFieldWidth),
);
@override
int? getValue(AdaptedProfile dataObject) {
return getGCStats(dataObject).capacity;
}
@override
String getDisplayValue(AdaptedProfile dataObject) {
return prettyPrintBytes(getValue(dataObject), includeUnit: true)!;
}
@override
bool get numeric => true;
}
class _GCCountColumn extends _GCHeapStatsColumn {
_GCCountColumn({required super.generation})
: super(
'Collections',
titleTooltip: 'The number of garbage collections run on the heap',
alignment: ColumnAlignment.right,
fixedWidthPx: scaleByFontFactor(_defaultNumberFieldWidth),
);
@override
int? getValue(AdaptedProfile dataObject) {
return getGCStats(dataObject).collections;
}
@override
bool get numeric => true;
}
class _GCLatencyColumn extends _GCHeapStatsColumn {
_GCLatencyColumn({required super.generation})
: super(
'Latency',
titleTooltip:
'The average time taken to perform a garbage collection on the heap (ms)',
alignment: ColumnAlignment.right,
fixedWidthPx: scaleByFontFactor(_defaultNumberFieldWidth),
);
@override
double? getValue(AdaptedProfile dataObject) {
final stats = getGCStats(dataObject);
if (stats.averageCollectionTime.isNaN) {
return 0;
}
return getGCStats(dataObject).averageCollectionTime;
}
@override
String getDisplayValue(AdaptedProfile dataObject) {
return durationText(
Duration(
milliseconds: getValue(dataObject)!.toInt(),
),
fractionDigits: 2,
);
}
@override
bool get numeric => true;
}
class _GCStatsTable extends StatelessWidget {
const _GCStatsTable({
Key? key,
required this.controller,
}) : super(key: key);
static final _columnGroup = [
ColumnGroup.fromText(
title: '',
range: const Range(0, 1),
),
ColumnGroup.fromText(
title: HeapGeneration.total.toString(),
range: const Range(1, 5),
),
ColumnGroup.fromText(
title: HeapGeneration.newSpace.toString(),
range: const Range(5, 9),
),
ColumnGroup.fromText(
title: HeapGeneration.oldSpace.toString(),
range: const Range(9, 13),
),
];
static final _columns = [
_GCHeapNameColumn(),
for (final generation in [
HeapGeneration.total,
HeapGeneration.newSpace,
HeapGeneration.oldSpace,
]) ...[
_GCHeapUsageColumn(generation: generation),
_GCHeapCapacityColumn(generation: generation),
_GCCountColumn(
generation: generation,
),
_GCLatencyColumn(
generation: generation,
),
],
];
final ProfilePaneController controller;
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<AdaptedProfile?>(
valueListenable: controller.currentAllocationProfile,
builder: (context, profile, _) {
if (profile == null) {
return const CenteredCircularProgressIndicator();
}
return OutlineDecoration.onlyTop(
child: FlatTable<AdaptedProfile>(
keyFactory: (element) => Key(element.hashCode.toString()),
data: [profile],
dataKey: 'gc-stats',
columnGroups: _columnGroup,
columns: _columns,
defaultSortColumn: _columns.first,
defaultSortDirection: SortDirection.ascending,
),
);
},
);
}
}
/// Displays data from an [AllocationProfile] in a tabular format, with support
/// for refreshing the data on a garbage collection (GC) event and exporting
/// [AllocationProfile]'s to a CSV formatted file.
class AllocationProfileTableView extends StatefulWidget {
const AllocationProfileTableView({super.key, required this.controller});
@override
State<AllocationProfileTableView> createState() =>
AllocationProfileTableViewState();
final ProfilePaneController controller;
}
class AllocationProfileTableViewState
extends State<AllocationProfileTableView> {
@override
void didChangeDependencies() {
super.didChangeDependencies();
widget.controller.initialize();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Padding(
padding: const EdgeInsets.all(denseSpacing),
child: _AllocationProfileTableControls(
allocationProfileController: widget.controller,
),
),
ValueListenableBuilder<bool>(
valueListenable: preferences.vmDeveloperModeEnabled,
builder: (context, vmDeveloperModeEnabled, _) {
if (!vmDeveloperModeEnabled) return const SizedBox.shrink();
return Column(
children: [
SizedBox(
// _GCStatsTable is a table with two header rows (column groups
// and columns) and one data row. We add a slight padding to
// ensure the underlying scrollable area has enough space to not
// display a scroll bar.
height: defaultRowHeight + defaultHeaderHeight * 2 + 1,
child: _GCStatsTable(
controller: widget.controller,
),
),
const ThickDivider(),
],
);
},
),
Expanded(
child: _AllocationProfileTable(
controller: widget.controller,
),
),
],
);
}
}
class _AllocationProfileTable extends StatelessWidget {
_AllocationProfileTable({
Key? key,
required this.controller,
}) : super(key: key);
/// List of columns displayed in VM developer mode state.
static final _vmModeColumnGroups = [
ColumnGroup.fromText(
title: '',
range: const Range(0, 1),
),
ColumnGroup.fromText(
title: HeapGeneration.total.toString(),
range: const Range(1, 5),
),
ColumnGroup.fromText(
title: HeapGeneration.newSpace.toString(),
range: const Range(5, 9),
),
ColumnGroup.fromText(
title: HeapGeneration.oldSpace.toString(),
range: const Range(9, 13),
),
];
static final _fieldSizeColumn = _FieldSizeColumn(
heap: HeapGeneration.total,
);
late final List<ColumnData<ProfileRecord>> _columns = [
_FieldClassNameColumn(
ClassFilterData(
filter: controller.classFilter,
onChanged: controller.setFilter,
),
),
_FieldInstanceCountColumn(heap: HeapGeneration.total),
_fieldSizeColumn,
_FieldDartHeapSizeColumn(heap: HeapGeneration.total),
];
late final _vmDeveloperModeColumns = [
_FieldExternalSizeColumn(heap: HeapGeneration.total),
_FieldInstanceCountColumn(heap: HeapGeneration.newSpace),
_FieldSizeColumn(heap: HeapGeneration.newSpace),
_FieldDartHeapSizeColumn(heap: HeapGeneration.newSpace),
_FieldExternalSizeColumn(heap: HeapGeneration.newSpace),
_FieldInstanceCountColumn(heap: HeapGeneration.oldSpace),
_FieldSizeColumn(heap: HeapGeneration.oldSpace),
_FieldDartHeapSizeColumn(heap: HeapGeneration.oldSpace),
_FieldExternalSizeColumn(heap: HeapGeneration.oldSpace),
];
final ProfilePaneController controller;
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<AdaptedProfile?>(
valueListenable: controller.currentAllocationProfile,
builder: (context, profile, _) {
// TODO(bkonyi): make this an overlay so the table doesn't
// disappear when we're retrieving new data, especially since the
// spinner animation freezes when retrieving the profile.
if (profile == null) {
return const CenteredCircularProgressIndicator();
}
return ValueListenableBuilder<bool>(
valueListenable: preferences.vmDeveloperModeEnabled,
builder: (context, vmDeveloperModeEnabled, _) {
return FlatTable<ProfileRecord>(
keyFactory: (element) => Key(element.heapClass.fullName),
data: profile.records,
dataKey: 'allocation-profile',
columnGroups: vmDeveloperModeEnabled
? _AllocationProfileTable._vmModeColumnGroups
: null,
columns: [
..._columns,
if (vmDeveloperModeEnabled) ..._vmDeveloperModeColumns,
],
defaultSortColumn: _AllocationProfileTable._fieldSizeColumn,
defaultSortDirection: SortDirection.descending,
pinBehavior: FlatTablePinBehavior.pinOriginalToTop,
includeColumnGroupHeaders: false,
selectionNotifier: controller.selection,
);
},
);
},
);
}
}
class _AllocationProfileTableControls extends StatelessWidget {
const _AllocationProfileTableControls({
Key? key,
required this.allocationProfileController,
}) : super(key: key);
final ProfilePaneController allocationProfileController;
@override
Widget build(BuildContext context) {
return Row(
children: [
_ExportAllocationProfileButton(
allocationProfileController: allocationProfileController,
),
const SizedBox(width: denseSpacing),
RefreshButton(
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.profileRefreshManual,
onPressed: allocationProfileController.refresh,
),
const SizedBox(width: denseSpacing),
_RefreshOnGCToggleButton(
allocationProfileController: allocationProfileController,
),
const SizedBox(width: denseSpacing),
const _ProfileHelpLink(),
],
);
}
}
class _ExportAllocationProfileButton extends StatelessWidget {
const _ExportAllocationProfileButton({
Key? key,
required this.allocationProfileController,
}) : super(key: key);
final ProfilePaneController allocationProfileController;
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<AdaptedProfile?>(
valueListenable: allocationProfileController.currentAllocationProfile,
builder: (context, currentAllocationProfile, _) {
return DownloadButton(
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.profileDownloadCsv,
minScreenWidthForTextBeforeScaling: memoryControlsMinVerboseWidth,
tooltip: 'Download allocation profile data in CSV format',
label: 'CSV',
onPressed: currentAllocationProfile == null
? null
: () => allocationProfileController
.downloadMemoryTableCsv(currentAllocationProfile),
);
},
);
}
}
class _RefreshOnGCToggleButton extends StatelessWidget {
const _RefreshOnGCToggleButton({
Key? key,
required this.allocationProfileController,
}) : super(key: key);
final ProfilePaneController allocationProfileController;
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<bool>(
valueListenable: allocationProfileController.refreshOnGc,
builder: (context, refreshOnGc, _) {
return DevToolsToggleButton(
message: 'Auto-refresh on garbage collection',
label: 'Refresh on GC',
icon: Icons.autorenew_outlined,
isSelected: refreshOnGc,
onPressed: () {
allocationProfileController.toggleRefreshOnGc();
ga.select(
gac.memory,
'${gac.MemoryEvent.profileRefreshOnGc}-$refreshOnGc',
);
},
);
},
);
}
}
class _ProfileHelpLink extends StatelessWidget {
const _ProfileHelpLink({Key? key}) : super(key: key);
static const _documentationTopic = gac.MemoryEvent.profileHelp;
@override
Widget build(BuildContext context) {
return HelpButtonWithDialog(
gaScreen: gac.memory,
gaSelection: gac.topicDocumentationButton(_documentationTopic),
dialogTitle: 'Memory Allocation Profile Help',
actions: [
MoreInfoLink(
url: DocLinks.profile.value,
gaScreenName: '',
gaSelectedItemDescription:
gac.topicDocumentationLink(_documentationTopic),
),
],
child: const Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
'The allocation profile tab displays information about\n'
'allocated objects in the Dart heap of the selected\n'
'isolate.',
),
SizedBox(height: denseSpacing),
ClassTypeLegend(),
],
),
);
}
}
| devtools/packages/devtools_app/lib/src/screens/memory/panes/profile/profile_view.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/memory/panes/profile/profile_view.dart",
"repo_id": "devtools",
"token_count": 8349
} | 140 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const String nonGcableInstancesColumnTooltip =
'Number of instances of the class,\n'
'that are reachable, i.e. have a retaining path from the root\n'
"and therefore can't be garbage collected.";
/// When to have verbose Dropdown based on media width.
const memoryControlsMinVerboseWidth = 240.0;
enum SizeType {
shallow(
displayName: 'Shallow',
description: 'The total shallow size of all of the instances.\n'
'The shallow size of an object is the size of the object\n'
'plus the references it holds to other Dart objects\n'
"in its fields (this doesn't include the size of\n"
'the fields - just the size of the references).',
),
retained(
displayName: 'Retained',
description:
'Total shallow Dart size of objects plus shallow Dart size of objects they retain,\n'
'taking into account only the shortest retaining path for the referenced objects.',
),
;
const SizeType({required this.displayName, required this.description});
final String displayName;
final String description;
}
| devtools/packages/devtools_app/lib/src/screens/memory/shared/primitives/simple_elements.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/memory/shared/primitives/simple_elements.dart",
"repo_id": "devtools",
"token_count": 379
} | 141 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:math' as math;
import '../../../../shared/primitives/utils.dart';
import '../../performance_model.dart';
import '../controls/enhance_tracing/enhance_tracing_model.dart';
import '../frame_analysis/frame_analysis_model.dart';
/// Data describing a single Flutter frame.
///
/// Each [FlutterFrame] should have 2 distinct pieces of data:
/// * [uiEventFlow] : flow of events showing the UI work for the frame.
/// * [rasterEventFlow] : flow of events showing the Raster work for the frame.
class FlutterFrame {
FlutterFrame._({
required this.id,
required this.timeFromFrameTiming,
required this.buildTime,
required this.rasterTime,
required this.vsyncOverheadTime,
});
factory FlutterFrame.parse(Map<String, dynamic> json) {
final timeStart = Duration(microseconds: json[startTimeKey]!);
final timeEnd = timeStart + Duration(microseconds: json[elapsedKey]!);
final frameTime = TimeRange()
..start = timeStart
..end = timeEnd;
return FlutterFrame._(
id: json[numberKey]!,
timeFromFrameTiming: frameTime,
buildTime: Duration(microseconds: json[buildKey]!),
rasterTime: Duration(microseconds: json[rasterKey]!),
vsyncOverheadTime: Duration(microseconds: json[vsyncOverheadKey]!),
);
}
static const numberKey = 'number';
static const buildKey = 'build';
static const rasterKey = 'raster';
static const vsyncOverheadKey = 'vsyncOverhead';
static const startTimeKey = 'startTime';
static const elapsedKey = 'elapsed';
/// Id for this Flutter frame, originally created in the Flutter engine.
final int id;
/// The time range of the Flutter frame based on the FrameTiming API from
/// which the data was parsed.
final TimeRange timeFromFrameTiming;
/// The time range of the Flutter frame based on the frame's
/// [timelineEventData], which contains timing information from the VM's
/// timeline events.
///
/// This time range should be used for activities related to timeline events,
/// like scrolling a frame's timeline events into view, for example.
TimeRange get timeFromEventFlows => timelineEventData.time;
/// Build time for this Flutter frame based on data from the FrameTiming API
/// sent over the extension stream as 'Flutter.Frame' events.
final Duration buildTime;
/// Raster time for this Flutter frame based on data from the FrameTiming API
/// sent over the extension stream as 'Flutter.Frame' events.
final Duration rasterTime;
/// Vsync overhead time for this Flutter frame based on data from the
/// FrameTiming API sent over the extension stream as 'Flutter.Frame' events.
final Duration vsyncOverheadTime;
/// Timeline event data for this [FlutterFrame].
final FrameTimelineEventData timelineEventData = FrameTimelineEventData();
/// The [EnhanceTracingState] at the time that this frame object was created
/// (e.g. when the 'Flutter.Frame' event for this frame was received).
///
/// If we did not have [EnhanceTracingState] information at the time that this
/// frame was drawn (e.g. the DevTools performancd page was not opened and
/// listening for frames yet), this value will be null.
EnhanceTracingState? enhanceTracingState;
FrameAnalysis? get frameAnalysis {
final frameAnalysis_ = _frameAnalysis;
if (frameAnalysis_ != null) return frameAnalysis_;
if (timelineEventData.isNotEmpty) {
return _frameAnalysis = FrameAnalysis(this);
}
return null;
}
FrameAnalysis? _frameAnalysis;
bool get isWellFormed => timelineEventData.wellFormed;
Duration get shaderDuration {
if (_shaderTime != null) return _shaderTime!;
if (timelineEventData.rasterEvent == null) return Duration.zero;
final shaderEvents = timelineEventData.rasterEvent!
.shallowNodesWithCondition((event) => event.isShaderEvent);
final duration =
shaderEvents.fold<Duration>(Duration.zero, (previous, event) {
return previous + event.time.duration;
});
return _shaderTime = duration;
}
Duration? _shaderTime;
bool get hasShaderTime =>
timelineEventData.rasterEvent != null && shaderDuration != Duration.zero;
void setEventFlow(FlutterTimelineEvent event) {
timelineEventData.setEventFlow(event: event);
}
bool isJanky(double displayRefreshRate) {
return isUiJanky(displayRefreshRate) || isRasterJanky(displayRefreshRate);
}
bool isUiJanky(double displayRefreshRate) {
return buildTime.inMilliseconds > _targetMsPerFrame(displayRefreshRate);
}
bool isRasterJanky(double displayRefreshRate) {
return rasterTime.inMilliseconds > _targetMsPerFrame(displayRefreshRate);
}
bool hasShaderJank(double displayRefreshRate) {
final quarterFrame = (_targetMsPerFrame(displayRefreshRate) / 4).round();
return isRasterJanky(displayRefreshRate) &&
hasShaderTime &&
shaderDuration > Duration(milliseconds: quarterFrame);
}
double _targetMsPerFrame(double displayRefreshRate) {
return 1 / displayRefreshRate * 1000;
}
Map<String, dynamic> get json => {
numberKey: id,
startTimeKey: timeFromFrameTiming.start!.inMicroseconds,
elapsedKey: timeFromFrameTiming.duration.inMicroseconds,
buildKey: buildTime.inMicroseconds,
rasterKey: rasterTime.inMicroseconds,
vsyncOverheadKey: vsyncOverheadTime.inMicroseconds,
};
@override
String toString() {
return 'Frame $id - $timeFromFrameTiming, '
'ui: ${timelineEventData.uiEvent?.time}, '
'raster: ${timelineEventData.rasterEvent?.time}';
}
String toStringVerbose() {
final buf = StringBuffer();
buf.writeln('UI timeline event for frame $id:');
timelineEventData.uiEvent?.format(buf, ' ');
buf.writeln('\nUI trace for frame $id');
timelineEventData.uiEvent?.writeTrackEventsToBuffer(buf);
buf.writeln('\nRaster timeline event frame $id:');
timelineEventData.rasterEvent?.format(buf, ' ');
buf.writeln('\nRaster trace for frame $id');
timelineEventData.rasterEvent?.writeTrackEventsToBuffer(buf);
return buf.toString();
}
FlutterFrame shallowCopy() {
return FlutterFrame.parse(json);
}
}
class FrameTimelineEventData {
/// Events describing the UI work for a [FlutterFrame].
FlutterTimelineEvent? get uiEvent => _eventFlows[TimelineEventType.ui.index];
/// Events describing the Raster work for a [FlutterFrame].
FlutterTimelineEvent? get rasterEvent =>
_eventFlows[TimelineEventType.raster.index];
final List<FlutterTimelineEvent?> _eventFlows = List.generate(2, (_) => null);
bool get wellFormed => uiEvent != null && rasterEvent != null;
bool get isNotEmpty => uiEvent != null || rasterEvent != null;
final time = TimeRange();
void setEventFlow({
required FlutterTimelineEvent event,
bool setTimeData = true,
}) {
final type = event.type!;
_eventFlows[type.index] = event;
if (setTimeData) {
if (type == TimelineEventType.ui) {
time.start = event.time.start;
// If [rasterEventFlow] has already completed, set the end time for this
// frame to [event]'s end time.
if (rasterEvent != null) {
time.end = event.time.end;
}
} else if (type == TimelineEventType.raster) {
// If [uiEventFlow] is null, that means that this raster event flow
// completed before the ui event flow did for this frame. This means one
// of two things: 1) there will never be a [uiEventFlow] for this frame
// because the UI events are not present in the available timeline
// events, or 2) the [uiEventFlow] has started but not completed yet. In
// the event that 2) is true, do not set the frame end time here because
// the end time for this frame will be set to the end time for
// [uiEventFlow] once it finishes.
final theUiEvent = uiEvent;
if (theUiEvent != null) {
time.end = Duration(
microseconds: math.max(
theUiEvent.time.end!.inMicroseconds,
event.time.end?.inMicroseconds ?? 0,
),
);
}
}
}
}
FlutterTimelineEvent? eventByType(TimelineEventType type) {
if (type == TimelineEventType.ui) return uiEvent;
if (type == TimelineEventType.raster) return rasterEvent;
return null;
}
}
| devtools/packages/devtools_app/lib/src/screens/performance/panes/flutter_frames/flutter_frame_model.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/performance/panes/flutter_frames/flutter_frame_model.dart",
"repo_id": "devtools",
"token_count": 2862
} | 142 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import '../../../../../shared/analytics/constants.dart' as gac;
import '../../../../../shared/common_widgets.dart';
import '_perfetto_desktop.dart'
if (dart.library.js_interop) '_perfetto_web.dart';
import 'perfetto_controller.dart';
class EmbeddedPerfetto extends StatelessWidget {
const EmbeddedPerfetto({Key? key, required this.perfettoController})
: super(key: key);
final PerfettoController perfettoController;
@override
Widget build(BuildContext context) {
return Perfetto(
perfettoController: perfettoController,
);
}
}
class PerfettoHelpButton extends StatelessWidget {
const PerfettoHelpButton({super.key, required this.perfettoController});
final PerfettoController perfettoController;
@override
Widget build(BuildContext context) {
return HelpButton(
gaScreen: gac.performance,
gaSelection: gac.PerformanceEvents.perfettoShowHelp.name,
outlined: false,
onPressed: perfettoController.showHelpMenu,
);
}
}
| devtools/packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/perfetto.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/perfetto.dart",
"repo_id": "devtools",
"token_count": 406
} | 143 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:math' as math;
import '../../shared/primitives/utils.dart';
import 'cpu_profile_model.dart';
/// Process for composing [CpuProfileData] into a structured tree of
/// [CpuStackFrame]'s.
class CpuProfileTransformer {
/// Number of stack frames we will process in each batch.
static const _defaultBatchSize = 100;
late int _stackFramesCount;
List<String?>? _stackFrameKeys;
List<CpuStackFrame>? _stackFrameValues;
int _stackFramesProcessed = 0;
String? _activeProcessId;
Future<void> processData(
CpuProfileData cpuProfileData, {
required String processId,
}) async {
// Do not process this data if it has already been processed.
if (cpuProfileData.processed) return;
// Reset the transformer before processing.
reset();
_activeProcessId = processId;
_stackFramesCount = cpuProfileData.stackFrames.length;
_stackFrameKeys = cpuProfileData.stackFrames.keys.toList();
_stackFrameValues = cpuProfileData.stackFrames.values.toList();
// At minimum, process the data in 4 batches to smooth the appearance of
// the progress indicator.
final quarterBatchSize = (_stackFramesCount / 4).round();
final batchSize = math.min(
_defaultBatchSize,
quarterBatchSize == 0 ? 1 : quarterBatchSize,
);
// Use batch processing to maintain a responsive UI.
while (_stackFramesProcessed < _stackFramesCount) {
_processBatch(batchSize, cpuProfileData, processId: processId);
// Await a small delay to give the UI thread a chance to update the
// progress indicator. Use a longer delay than the default (0) so that the
// progress indicator will look smoother.
await delayToReleaseUiThread(micros: 5000);
if (processId != _activeProcessId) {
throw ProcessCancelledException();
}
}
if (cpuProfileData.rootedAtTags) {
// Check to see if there are any empty tag roots as a result of filtering
// and remove them.
final nodeIndicesToRemove = <int>[];
for (int i = cpuProfileData.cpuProfileRoot.children.length - 1;
i >= 0;
--i) {
final root = cpuProfileData.cpuProfileRoot.children[i];
if (root.isTag && root.children.isEmpty) {
nodeIndicesToRemove.add(i);
}
}
nodeIndicesToRemove.forEach(
cpuProfileData.cpuProfileRoot.removeChildAtIndex,
);
}
_setExclusiveSampleCountsAndTags(cpuProfileData);
cpuProfileData.processed = true;
// TODO(kenz): investigate why this assert is firing again.
// https://github.com/flutter/devtools/issues/1529.
// assert(
// cpuProfileData.profileMetaData.sampleCount ==
// cpuProfileData.cpuProfileRoot.inclusiveSampleCount,
// 'SampleCount from response (${cpuProfileData.profileMetaData.sampleCount})'
// ' != sample count from root '
// '(${cpuProfileData.cpuProfileRoot.inclusiveSampleCount})',
// );
// Reset the transformer after processing.
reset();
}
void _processBatch(
int batchSize,
CpuProfileData cpuProfileData, {
required String processId,
}) {
final batchEnd =
math.min(_stackFramesProcessed + batchSize, _stackFramesCount);
for (int i = _stackFramesProcessed; i < batchEnd; i++) {
if (processId != _activeProcessId) {
throw ProcessCancelledException();
}
final key = _stackFrameKeys![i];
final value = _stackFrameValues![i];
final stackFrame = cpuProfileData.stackFrames[key]!;
final parent = cpuProfileData.stackFrames[value.parentId];
_processStackFrame(stackFrame, parent, cpuProfileData);
_stackFramesProcessed++;
}
}
void _processStackFrame(
CpuStackFrame stackFrame,
CpuStackFrame? parent,
CpuProfileData cpuProfileData,
) {
// [stackFrame] is the root of a new cpu sample. Add it as a child of
// [cpuProfileRoot].
if (parent == null) {
cpuProfileData.cpuProfileRoot.addChild(stackFrame);
} else {
parent.addChild(stackFrame);
}
}
void _setExclusiveSampleCountsAndTags(CpuProfileData cpuProfileData) {
for (CpuSampleEvent sample in cpuProfileData.cpuSamples) {
final leafId = sample.leafId;
final stackFrame = cpuProfileData.stackFrames[leafId];
assert(
stackFrame != null,
'No StackFrame found for id $leafId. If you see this assertion, please '
'export the timeline trace and send to [email protected]. Note: '
'you must export the timeline immediately after the AssertionError is '
'thrown.',
);
if (stackFrame != null && !stackFrame.isTag) {
stackFrame.exclusiveSampleCount++;
}
}
}
void reset() {
_activeProcessId = null;
_stackFramesProcessed = 0;
_stackFrameKeys = null;
_stackFrameValues = null;
}
}
/// Merges CPU profile roots that share a common call stack (starting at the
/// root).
///
/// Ex. C C C
/// -> B -> B --> -> B
/// -> A -> D -> A
/// -> D
///
/// At the time this method is called, we assume we have a list of roots with
/// accurate inclusive/exclusive sample counts.
void mergeCpuProfileRoots(List<CpuStackFrame> roots) {
final mergedRoots = <CpuStackFrame>[];
final rootIndicesToRemove = <int>{};
// The index from which we will traverse to find root matches.
var traverseIndex = 0;
for (int i = 0; i < roots.length; i++) {
if (rootIndicesToRemove.contains(i)) {
// We have already merged [root]. Do not attempt to merge again.
continue;
}
final root = roots[i];
// Begin traversing from the index after [i] since we have already seen
// every node at index <= [i].
traverseIndex = i + 1;
for (int j = traverseIndex; j < roots.length; j++) {
final otherRoot = roots[j];
final isMatch =
!rootIndicesToRemove.contains(j) && otherRoot.matches(root);
if (isMatch) {
otherRoot.children.forEach(root.addChild);
root.exclusiveSampleCount += otherRoot.exclusiveSampleCount;
root.inclusiveSampleCount += otherRoot.inclusiveSampleCount;
rootIndicesToRemove.add(j);
mergeCpuProfileRoots(root.children);
}
}
mergedRoots.add(root);
}
// Clearing and adding all the elements in [mergedRoots] is more performant
// than removing each root that was merged individually.
roots
..clear()
..addAll(mergedRoots);
for (int i = 0; i < roots.length; i++) {
roots[i].index = i;
}
}
| devtools/packages/devtools_app/lib/src/screens/profiler/cpu_profile_transformer.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/profiler/cpu_profile_transformer.dart",
"repo_id": "devtools",
"token_count": 2519
} | 144 |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// A few utilities related to evaluating dart code
library;
import 'dart:async';
import 'package:devtools_app_shared/service.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:vm_service/vm_service.dart';
import '../../../service/vm_service_wrapper.dart';
import '../../../shared/globals.dart';
Stream<VmServiceWrapper> get _serviceConnectionStream =>
_serviceConnectionStreamController.stream;
final _serviceConnectionStreamController =
StreamController<VmServiceWrapper>.broadcast();
void setServiceConnectionForProviderScreen(VmServiceWrapper service) {
_serviceConnectionStreamController.add(service);
}
/// Exposes the current VmServiceWrapper.
/// By listening to this provider instead of directly accessing `serviceManager.manager.service`,
/// this ensures that providers reload properly when the devtool is connected
/// to a different application.
final serviceProvider = StreamProvider<VmServiceWrapper>((ref) async* {
yield serviceConnection.serviceManager.service!;
yield* _serviceConnectionStream;
});
/// An [EvalOnDartLibrary] that has access to no specific library in particular
///
/// Not suitable to be used when evaluating third-party objects, as it would
/// otherwise not be possible to read private properties.
final evalProvider = libraryEvalProvider('dart:io');
/// An [EvalOnDartLibrary] that has access to `provider`
final providerEvalProvider =
libraryEvalProvider('package:provider/src/provider.dart');
/// An [EvalOnDartLibrary] for custom objects.
final libraryEvalProvider =
FutureProviderFamily<EvalOnDartLibrary, String>((ref, libraryPath) async {
final service = await ref.watch(serviceProvider.future);
final eval = EvalOnDartLibrary(
libraryPath,
service,
serviceManager: serviceConnection.serviceManager,
);
ref.onDispose(eval.dispose);
return eval;
});
final hotRestartEventProvider =
ChangeNotifierProvider<ValueNotifier<void>>((ref) {
final selectedIsolateListenable =
serviceConnection.serviceManager.isolateManager.selectedIsolate;
// Since ChangeNotifierProvider calls `dispose` on the returned ChangeNotifier
// when the provider is destroyed, we can't simply return `selectedIsolateListenable`.
// So we're making a copy of it instead.
final notifier = ValueNotifier<IsolateRef?>(selectedIsolateListenable.value);
void listener() => notifier.value = selectedIsolateListenable.value;
selectedIsolateListenable.addListener(listener);
ref.onDispose(() => selectedIsolateListenable.removeListener(listener));
return notifier;
});
| devtools/packages/devtools_app/lib/src/screens/provider/instance_viewer/eval.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/provider/instance_viewer/eval.dart",
"repo_id": "devtools",
"token_count": 778
} | 145 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart';
import 'package:vm_service/vm_service.dart';
import '../../../shared/globals.dart';
import '../../../shared/primitives/trees.dart';
class ClassHierarchyExplorerController {
ValueListenable<List<ClassHierarchyNode>> get selectedIsolateClassHierarchy =>
_selectedIsolateClassHierarchy;
final _selectedIsolateClassHierarchy =
ValueNotifier<List<ClassHierarchyNode>>([]);
Future<void> refresh() async {
_selectedIsolateClassHierarchy.value = <ClassHierarchyNode>[];
final service = serviceConnection.serviceManager.service!;
final isolate =
serviceConnection.serviceManager.isolateManager.selectedIsolate.value;
if (isolate == null) {
return;
}
final isolateId = isolate.id!;
final classList = await service.getClassList(isolateId);
// TODO(bkonyi): we should cache the class list like we do the script list
final classes = (await Future.wait([
for (final cls in classList.classes!)
service.getObject(isolateId, cls.id!).then((e) => e as Class),
]))
.cast<Class>();
buildHierarchy(classes);
}
@visibleForTesting
void buildHierarchy(List<Class> classes) {
final nodes = <String?, ClassHierarchyNode>{
for (final cls in classes)
cls.id: ClassHierarchyNode(
cls: cls,
),
};
late final ClassHierarchyNode objectNode;
for (final cls in classes) {
if (cls.name == 'Object' && cls.library!.uri == 'dart:core') {
objectNode = nodes[cls.id]!;
}
if (cls.superClass != null) {
nodes[cls.superClass!.id]!.addChild(nodes[cls.id]!);
}
}
breadthFirstTraversal<ClassHierarchyNode>(
objectNode,
action: (node) {
node.children.sortBy<String>((element) => element.cls.name!);
},
);
_selectedIsolateClassHierarchy.value = [objectNode];
}
}
class ClassHierarchyNode extends TreeNode<ClassHierarchyNode> {
ClassHierarchyNode({required this.cls});
final Class cls;
@override
TreeNode<ClassHierarchyNode> shallowCopy() {
throw UnimplementedError(
'This method is not implemented. Implement if you '
'need to call `shallowCopy` on an instance of this class.',
);
}
}
| devtools/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/class_hierarchy_explorer_controller.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/class_hierarchy_explorer_controller.dart",
"repo_id": "devtools",
"token_count": 927
} | 146 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import '../vm_developer_common_widgets.dart';
import 'object_inspector_view_controller.dart';
import 'vm_object_model.dart';
/// A widget for the object inspector historyViewport displaying information
/// related to script objects in the Dart VM.
class VmScriptDisplay extends StatelessWidget {
const VmScriptDisplay({
super.key,
required this.controller,
required this.script,
});
final ObjectInspectorViewController controller;
final ScriptObject script;
@override
Widget build(BuildContext context) {
final scriptRef = script.scriptRef!;
return ObjectInspectorCodeView(
codeViewController: controller.codeViewController,
script: scriptRef,
object: scriptRef,
child: VmObjectDisplayBasicLayout(
controller: controller,
object: script,
generalDataRows: _scriptDataRows(script),
),
);
}
/// Generates a list of key-value pairs (map entries) containing the general
/// VM information of the Script object [widget.script].
List<MapEntry<String, WidgetBuilder>> _scriptDataRows(
ScriptObject field,
) {
return [
...vmObjectGeneralDataRows(
controller,
field,
),
serviceObjectLinkBuilderMapEntry(
controller: controller,
key: 'URI',
object: script.obj,
),
selectableTextBuilderMapEntry(
'Load time',
script.loadTime.toString(),
),
];
}
}
| devtools/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/vm_script_display.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/vm_script_display.dart",
"repo_id": "devtools",
"token_count": 575
} | 147 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/service_extensions.dart' as extensions;
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_shared/devtools_shared.dart';
import 'package:flutter/material.dart';
import '../shared/analytics/constants.dart' as gac;
import '../shared/constants.dart';
class RegisteredServiceDescription extends RegisteredService {
const RegisteredServiceDescription._({
required String service,
required String title,
this.icon,
this.gaScreenName,
this.gaItem,
}) : super(service: service, title: title);
final Widget? icon;
final String? gaScreenName;
final String? gaItem;
}
/// Hot reload service registered by Flutter Tools.
///
/// We call this service to perform hot reload.
final hotReload = RegisteredServiceDescription._(
service: extensions.hotReloadServiceName,
title: 'Hot Reload',
icon: Icon(hotReloadIcon, size: actionsIconSize),
gaScreenName: gac.devToolsMain,
gaItem: gac.hotReload,
);
/// Hot restart service registered by Flutter Tools.
///
/// We call this service to perform a hot restart.
final hotRestart = RegisteredServiceDescription._(
service: extensions.hotRestartServiceName,
title: 'Hot Restart',
icon: Icon(hotRestartIcon, size: actionsIconSize),
gaScreenName: gac.devToolsMain,
gaItem: gac.hotRestart,
);
RegisteredService get flutterMemoryInfo => flutterMemory;
const flutterListViews = '_flutter.listViews';
const displayRefreshRate = '_flutter.getDisplayRefreshRate';
String get flutterEngineEstimateRasterCache => flutterEngineRasterCache;
const renderFrameWithRasterStats = '_flutter.renderFrameWithRasterStats';
/// Dwds listens to events for recording end-to-end analytics.
const dwdsSendEvent = 'ext.dwds.sendEvent';
/// Service extension that returns whether or not the Impeller rendering engine
/// is being used (if false, the app is using SKIA).
const isImpellerEnabled = 'ext.ui.window.impellerEnabled';
| devtools/packages/devtools_app/lib/src/service/service_registrations.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/service/service_registrations.dart",
"repo_id": "devtools",
"token_count": 628
} | 148 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of '../constants.dart';
/// Extension screens UX actions.
enum DevToolsExtensionEvents {
/// Analytics id to track events that come from an extension screen.
extensionScreenId,
/// Analytics id to track events that come from the extension settings menu.
extensionSettingsId,
/// Analytics id for the setting to only show DevTools tabs for extensions
/// that have been manually opted into.
showOnlyEnabledExtensionsSetting,
/// Analytics id for the embedded extension view, which will only show once
/// an extension has been enabled.
embeddedExtension;
/// Event sent via [ga.screen] when an extension screen is opened.
static String extensionScreenName(DevToolsExtensionConfig ext) =>
'extension-${ext.analyticsSafeName}';
/// Event sent when a user clicks the "Report an issue" link on an extension
/// screen.
static String extensionFeedback(DevToolsExtensionConfig ext) =>
'extensionFeedback-${ext.analyticsSafeName}';
/// Event sent when an extension is enabled because a user manually enabled
/// it from the extensions settings menu.
static String extensionEnableManual(DevToolsExtensionConfig ext) =>
'extensionEnable-manual-${ext.analyticsSafeName}';
/// Event sent when an extension is enabled because a user answered the
/// enablement prompt with "Enable".
static String extensionEnablePrompt(DevToolsExtensionConfig ext) =>
'extensionEnable-prompt-${ext.analyticsSafeName}';
/// Event sent when an extension is disabled because a user manually disabled
/// it from the [DisableExtensionDialog] or the main extensions settings menu.
static String extensionDisableManual(DevToolsExtensionConfig ext) =>
'extensionDisable-manual-${ext.analyticsSafeName}';
/// Event sent when an extension is disabled because a user answered the
/// enablement prompt with "No, hide this sceen".
static String extensionDisablePrompt(DevToolsExtensionConfig ext) =>
'extensionDisable-prompt-${ext.analyticsSafeName}';
/// Event sent when an extension is force reloaded from the extension screen
/// context menu.
static String extensionForceReload(DevToolsExtensionConfig ext) =>
'extensionForceReload-${ext.analyticsSafeName}';
}
| devtools/packages/devtools_app/lib/src/shared/analytics/constants/_extension_constants.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/analytics/constants/_extension_constants.dart",
"repo_id": "devtools",
"token_count": 631
} | 149 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'dart:math';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:vm_service/vm_service.dart';
import '../screens/debugger/debugger_controller.dart';
import '../screens/inspector/layout_explorer/ui/theme.dart';
import 'analytics/analytics.dart' as ga;
import 'analytics/constants.dart' as gac;
import 'config_specific/copy_to_clipboard/copy_to_clipboard.dart';
import 'config_specific/launch_url/launch_url.dart';
import 'console/widgets/expandable_variable.dart';
import 'diagnostics/dart_object_node.dart';
import 'diagnostics/tree_builder.dart';
import 'globals.dart';
import 'primitives/flutter_widgets/linked_scroll_controller.dart';
import 'primitives/utils.dart';
import 'routing.dart';
import 'utils.dart';
/// The width of the package:flutter_test debugger device.
const debuggerDeviceWidth = 800.0;
const defaultDialogRadius = 20.0;
double get assumedMonospaceCharacterWidth =>
scaleByFontFactor(_assumedMonospaceCharacterWidth);
double _assumedMonospaceCharacterWidth = 9.0;
@visibleForTesting
void setAssumedMonospaceCharacterWidth(double width) {
_assumedMonospaceCharacterWidth = width;
}
/// Creates a semibold version of [style].
TextStyle semibold(TextStyle style) =>
style.copyWith(fontWeight: FontWeight.w600);
/// Creates a version of [style] that uses the primary color of [context].
///
/// When the app is in dark mode, it instead uses the accent color.
TextStyle primaryColor(TextStyle style, BuildContext context) {
final theme = Theme.of(context);
return style.copyWith(
color: (theme.brightness == Brightness.light)
? theme.primaryColor
: theme.colorScheme.secondary,
fontWeight: FontWeight.w400,
);
}
/// Creates a version of [style] that uses the lighter primary color of
/// [context].
///
/// In dark mode, the light primary color still has enough contrast to be
/// visible, so we continue to use it.
TextStyle primaryColorLight(TextStyle style, BuildContext context) {
final theme = Theme.of(context);
return style.copyWith(
color: theme.primaryColorLight,
fontWeight: FontWeight.w300,
);
}
class GaDevToolsButton extends DevToolsButton {
GaDevToolsButton({
super.key,
required VoidCallback? onPressed,
required String gaScreen,
required String gaSelection,
super.icon,
super.label,
super.tooltip,
super.color,
super.minScreenWidthForTextBeforeScaling,
super.elevated,
super.outlined,
super.tooltipPadding,
}) : super(
onPressed: onPressed != null
? () {
ga.select(gaScreen, gaSelection);
onPressed();
}
: null,
);
factory GaDevToolsButton.iconOnly({
required IconData icon,
required String gaScreen,
required String gaSelection,
String? tooltip,
VoidCallback? onPressed,
bool outlined = true,
}) {
return GaDevToolsButton(
icon: icon,
gaScreen: gaScreen,
gaSelection: gaSelection,
outlined: outlined,
tooltip: tooltip,
onPressed: onPressed,
);
}
}
class PauseButton extends GaDevToolsButton {
PauseButton({
super.key,
required super.tooltip,
required super.onPressed,
required super.gaScreen,
required super.gaSelection,
super.outlined = true,
super.minScreenWidthForTextBeforeScaling,
bool iconOnly = false,
}) : super(
label: iconOnly ? null : 'Pause',
icon: Icons.pause,
);
}
class ResumeButton extends GaDevToolsButton {
ResumeButton({
super.key,
required super.tooltip,
required super.onPressed,
required super.gaScreen,
required super.gaSelection,
super.outlined = true,
super.minScreenWidthForTextBeforeScaling,
bool iconOnly = false,
}) : super(
label: iconOnly ? null : 'Resume',
icon: Icons.play_arrow,
);
}
/// A button that groups pause and resume controls and automatically manages
/// the button enabled states depending on the value of [paused].
class PauseResumeButtonGroup extends StatelessWidget {
const PauseResumeButtonGroup({
super.key,
required this.paused,
required this.onPause,
required this.onResume,
this.pauseTooltip = 'Pause',
this.resumeTooltip = 'Resume',
required this.gaScreen,
required this.gaSelectionPause,
required this.gaSelectionResume,
});
final bool paused;
final VoidCallback onPause;
final VoidCallback onResume;
final String pauseTooltip;
final String resumeTooltip;
final String gaScreen;
final String gaSelectionPause;
final String gaSelectionResume;
@override
Widget build(BuildContext context) {
return Row(
children: [
PauseButton(
iconOnly: true,
onPressed: paused ? null : onPause,
tooltip: pauseTooltip,
gaScreen: gaScreen,
gaSelection: gaSelectionPause,
),
const SizedBox(width: denseSpacing),
ResumeButton(
iconOnly: true,
onPressed: paused ? onResume : null,
tooltip: resumeTooltip,
gaScreen: gaScreen,
gaSelection: gaSelectionResume,
),
],
);
}
}
class ClearButton extends GaDevToolsButton {
ClearButton({
super.key,
super.color,
super.tooltip = 'Clear',
super.outlined = true,
super.minScreenWidthForTextBeforeScaling,
required super.gaScreen,
required super.gaSelection,
required super.onPressed,
bool iconOnly = false,
String label = 'Clear',
}) : super(icon: Icons.block, label: iconOnly ? null : label);
}
class RefreshButton extends GaDevToolsButton {
RefreshButton({
super.key,
String label = 'Refresh',
super.tooltip,
super.minScreenWidthForTextBeforeScaling,
super.outlined,
required super.gaScreen,
required super.gaSelection,
required super.onPressed,
bool iconOnly = false,
}) : super(icon: Icons.refresh, label: iconOnly ? null : label);
}
/// A Refresh ToolbarAction button.
class ToolbarRefresh extends ToolbarAction {
const ToolbarRefresh({
super.key,
super.icon = Icons.refresh,
required super.onPressed,
super.tooltip = 'Refresh',
});
}
/// Button to start recording data.
///
/// * `recording`: Whether recording is in progress.
/// * `minScreenWidthForTextBeforeScaling`: The minimum width the button can be before the text is
/// omitted.
/// * `labelOverride`: Optional alternative text to use for the button.
/// * `onPressed`: The callback to be called upon pressing the button.
class RecordButton extends GaDevToolsButton {
RecordButton({
super.key,
required bool recording,
required VoidCallback onPressed,
required super.gaScreen,
required super.gaSelection,
super.minScreenWidthForTextBeforeScaling,
super.tooltip = 'Start recording',
String? labelOverride,
}) : super(
onPressed: recording ? null : onPressed,
icon: Icons.fiber_manual_record,
label: labelOverride ?? 'Record',
);
}
/// Button to stop recording data.
///
/// * `recording`: Whether recording is in progress.
/// * `minScreenWidthForTextBeforeScaling`: The minimum width the button can be before the text is
/// omitted.
/// * `onPressed`: The callback to be called upon pressing the button.
class StopRecordingButton extends GaDevToolsButton {
StopRecordingButton({
super.key,
required bool recording,
required VoidCallback? onPressed,
required super.gaScreen,
required super.gaSelection,
super.minScreenWidthForTextBeforeScaling,
super.tooltip = 'Stop recording',
}) : super(
onPressed: !recording ? null : onPressed,
icon: Icons.stop,
label: 'Stop',
);
}
class SettingsOutlinedButton extends GaDevToolsButton {
SettingsOutlinedButton({
super.key,
required super.onPressed,
required super.gaScreen,
required super.gaSelection,
super.tooltip,
}) : super(outlined: true, icon: Icons.settings_outlined);
}
class HelpButton extends GaDevToolsButton {
HelpButton({
super.key,
required super.gaScreen,
required super.gaSelection,
required super.onPressed,
super.outlined = true,
}) : super(
icon: Icons.help_outline,
tooltip: 'Help',
);
}
class ExpandAllButton extends StatelessWidget {
const ExpandAllButton({
super.key,
required this.gaScreen,
required this.gaSelection,
required this.onPressed,
this.minScreenWidthForTextBeforeScaling,
});
final VoidCallback onPressed;
final String gaScreen;
final String gaSelection;
final double? minScreenWidthForTextBeforeScaling;
@override
Widget build(BuildContext context) {
return GaDevToolsButton(
icon: Icons.unfold_more,
label: 'Expand All',
tooltip: 'Expand All',
onPressed: onPressed,
gaScreen: gaScreen,
gaSelection: gaSelection,
minScreenWidthForTextBeforeScaling: minScreenWidthForTextBeforeScaling,
);
}
}
class CollapseAllButton extends StatelessWidget {
const CollapseAllButton({
super.key,
required this.gaScreen,
required this.gaSelection,
required this.onPressed,
this.minScreenWidthForTextBeforeScaling,
});
final VoidCallback onPressed;
final String gaScreen;
final String gaSelection;
final double? minScreenWidthForTextBeforeScaling;
@override
Widget build(BuildContext context) {
return GaDevToolsButton(
icon: Icons.unfold_less,
label: 'Collapse All',
tooltip: 'Collapse All',
onPressed: onPressed,
gaScreen: gaScreen,
gaSelection: gaSelection,
minScreenWidthForTextBeforeScaling: minScreenWidthForTextBeforeScaling,
);
}
}
/// Button that should be used to control showing or hiding a chart.
///
/// The button automatically toggles the icon and the tooltip to indicate the
/// shown or hidden state.
class VisibilityButton extends StatelessWidget {
const VisibilityButton({
super.key,
required this.show,
required this.onPressed,
this.minScreenWidthForTextBeforeScaling,
required this.label,
required this.tooltip,
required this.gaScreen,
// We use a default value for visibility button because in some cases, the
// analytics for the visibility this button controls are tracked at the
// preferenes change.
this.gaSelection = gac.visibilityButton,
});
final ValueListenable<bool> show;
final void Function(bool) onPressed;
final double? minScreenWidthForTextBeforeScaling;
final String label;
final String tooltip;
final String gaScreen;
final String gaSelection;
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<bool>(
valueListenable: show,
builder: (_, show, __) {
return GaDevToolsButton(
key: key,
tooltip: tooltip,
icon: show ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
label: label,
minScreenWidthForTextBeforeScaling:
minScreenWidthForTextBeforeScaling,
gaScreen: gaScreen,
gaSelection: gaSelection,
onPressed: () => onPressed(!show),
);
},
);
}
}
/// Default switch for DevTools that enforces size restriction.
class DevToolsSwitch extends StatelessWidget {
const DevToolsSwitch({
super.key,
required this.value,
required this.onChanged,
this.padding,
});
final bool value;
final void Function(bool)? onChanged;
final EdgeInsets? padding;
@override
Widget build(BuildContext context) {
return Container(
height: defaultButtonHeight,
padding: padding,
child: FittedBox(
fit: BoxFit.fill,
child: Switch(
value: value,
onChanged: onChanged,
),
),
);
}
}
class ProcessingInfo extends StatelessWidget {
const ProcessingInfo({
Key? key,
required this.progressValue,
required this.processedObject,
}) : super(key: key);
final double? progressValue;
final String processedObject;
@override
Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Processing $processedObject',
style: Theme.of(context).regularTextStyle,
),
const SizedBox(height: defaultSpacing),
SizedBox(
width: 200.0,
child: LinearProgressIndicator(
value: progressValue,
),
),
],
),
);
}
}
/// Common button for exiting offline mode.
class ExitOfflineButton extends StatelessWidget {
const ExitOfflineButton({required this.gaScreen, super.key});
final String gaScreen;
@override
Widget build(BuildContext context) {
final routerDelegate = DevToolsRouterDelegate.of(context);
return GaDevToolsButton(
key: const Key('exit offline button'),
label: 'Exit offline mode',
icon: Icons.clear,
gaScreen: gaScreen,
gaSelection: gac.exitOfflineMode,
onPressed: () {
offlineController.exitOfflineMode();
// Use Router.neglect to replace the current history entry with
// the homepage so that clicking Back will not return here.
Router.neglect(
context,
() => routerDelegate.navigateHome(clearScreenParam: true),
);
},
);
}
}
class OfflineAwareControls extends StatelessWidget {
const OfflineAwareControls({
required this.controlsBuilder,
required this.gaScreen,
super.key,
});
final Widget Function(bool) controlsBuilder;
final String gaScreen;
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<bool>(
valueListenable: offlineController.offlineMode,
builder: (context, offline, _) {
return Row(
children: [
if (offlineController.offlineMode.value)
Padding(
padding: const EdgeInsets.only(right: defaultSpacing),
child: ExitOfflineButton(gaScreen: gaScreen),
),
Expanded(
child: controlsBuilder(offline),
),
],
);
},
);
}
}
/// A small element containing some accessory information, often a numeric
/// value.
class Badge extends StatelessWidget {
const Badge(this.text, {super.key});
final String text;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
// These constants are sized to give 1 digit badges a circular look.
const badgeCornerRadius = 12.0;
const verticalBadgePadding = 1.0;
const horizontalBadgePadding = 6.0;
return Container(
decoration: BoxDecoration(
color: theme.colorScheme.onSurface,
borderRadius: BorderRadius.circular(badgeCornerRadius),
),
padding: const EdgeInsets.symmetric(
vertical: verticalBadgePadding,
horizontal: horizontalBadgePadding,
),
child: Text(
text,
// Use a slightly smaller font for the badge.
style: theme.regularTextStyle
.copyWith(color: theme.colorScheme.surface)
.apply(fontSizeDelta: -1),
),
);
}
}
/// A wrapper around a TextButton, an Icon, and an optional Tooltip; used for
/// small toolbar actions.
class ToolbarAction extends StatelessWidget {
const ToolbarAction({
required this.icon,
required this.onPressed,
this.tooltip,
Key? key,
this.size,
this.style,
this.color,
this.gaScreen,
this.gaSelection,
}) : assert((gaScreen == null) == (gaSelection == null)),
super(key: key);
final TextStyle? style;
final IconData icon;
final Color? color;
final String? tooltip;
final VoidCallback? onPressed;
final double? size;
final String? gaScreen;
final String? gaSelection;
@override
Widget build(BuildContext context) {
final button = TextButton(
style: TextButton.styleFrom(
padding: EdgeInsets.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
textStyle: style,
),
onPressed: () {
if (gaScreen != null && gaSelection != null) {
ga.select(gaScreen!, gaSelection!);
}
onPressed?.call();
},
child: Icon(
icon,
size: size ?? actionsIconSize,
color: color ?? Theme.of(context).colorScheme.onSurface,
),
);
return tooltip == null
? button
: DevToolsTooltip(
message: tooltip,
child: button,
);
}
}
/// Icon action button used in the main DevTools toolbar or footer.
abstract class ScaffoldAction extends StatelessWidget {
const ScaffoldAction({
super.key,
required this.icon,
required this.tooltip,
required this.onPressed,
this.color,
});
final IconData icon;
final String tooltip;
final void Function(BuildContext) onPressed;
final Color? color;
@override
Widget build(BuildContext context) {
return DevToolsTooltip(
message: tooltip,
child: InkWell(
onTap: () => onPressed(context),
child: Container(
width: actionWidgetSize,
height: actionWidgetSize,
alignment: Alignment.center,
child: Icon(
icon,
size: actionsIconSize,
color: color,
),
),
),
);
}
}
/// Button to open related information / documentation.
///
/// [tooltip] specifies the hover text for the button.
/// [link] is the link that should be opened when the button is clicked.
class InformationButton extends StatelessWidget {
const InformationButton({
Key? key,
required this.tooltip,
required this.link,
}) : super(key: key);
final String tooltip;
final String link;
@override
Widget build(BuildContext context) {
return Tooltip(
message: tooltip,
child: IconButton(
icon: const Icon(Icons.help_outline),
onPressed: () async => await launchUrl(link),
),
);
}
}
class RoundedCornerOptions {
const RoundedCornerOptions({
this.showTopLeft = true,
this.showTopRight = true,
this.showBottomLeft = true,
this.showBottomRight = true,
});
final bool showTopLeft;
final bool showTopRight;
final bool showBottomLeft;
final bool showBottomRight;
}
class RoundedDropDownButton<T> extends StatelessWidget {
const RoundedDropDownButton({
Key? key,
this.value,
this.onChanged,
this.isDense = false,
this.isExpanded = false,
this.style,
this.selectedItemBuilder,
this.items,
this.roundedCornerOptions,
}) : super(key: key);
final T? value;
final ValueChanged<T?>? onChanged;
final bool isDense;
final bool isExpanded;
final TextStyle? style;
final DropdownButtonBuilder? selectedItemBuilder;
final List<DropdownMenuItem<T>>? items;
final RoundedCornerOptions? roundedCornerOptions;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final bgColor = theme.colorScheme.backgroundColorSelected;
Radius selectRadius(bool show) {
return show ? defaultRadius : Radius.zero;
}
final style = this.style ?? theme.regularTextStyle;
final showTopLeft = roundedCornerOptions?.showTopLeft ?? true;
final showTopRight = roundedCornerOptions?.showTopRight ?? true;
final showBottomLeft = roundedCornerOptions?.showBottomLeft ?? true;
final showBottomRight = roundedCornerOptions?.showBottomRight ?? true;
return RoundedOutlinedBorder(
showTopLeft: showTopLeft,
showTopRight: showTopRight,
showBottomLeft: showBottomLeft,
showBottomRight: showBottomRight,
child: Center(
child: SizedBox(
height: defaultButtonHeight - 2.0, // subtract 2.0 for width of border
child: DropdownButtonHideUnderline(
child: DropdownButton<T>(
padding: const EdgeInsets.only(
left: defaultSpacing,
right: borderPadding,
),
value: value,
onChanged: onChanged,
isDense: isDense,
isExpanded: isExpanded,
borderRadius: BorderRadius.only(
topLeft: selectRadius(showTopLeft),
topRight: selectRadius(showTopRight),
bottomLeft: selectRadius(showBottomLeft),
bottomRight: selectRadius(showBottomRight),
),
style: style,
selectedItemBuilder: selectedItemBuilder,
items: items,
focusColor: bgColor,
),
),
),
),
);
}
}
class DevToolsClearableTextField extends StatelessWidget {
DevToolsClearableTextField({
Key? key,
required this.labelText,
TextEditingController? controller,
this.hintText,
this.prefixIcon,
this.additionalSuffixActions = const <Widget>[],
this.onChanged,
this.onSubmitted,
this.autofocus = false,
}) : controller = controller ?? TextEditingController(),
super(key: key);
final TextEditingController controller;
final String? hintText;
final Widget? prefixIcon;
final List<Widget> additionalSuffixActions;
final String labelText;
final void Function(String)? onChanged;
final void Function(String)? onSubmitted;
final bool autofocus;
static const _contentVerticalPadding = 6.0;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return SizedBox(
height: defaultTextFieldHeight,
child: TextField(
autofocus: autofocus,
controller: controller,
onChanged: onChanged,
onSubmitted: onSubmitted,
style: theme.regularTextStyle,
decoration: InputDecoration(
isDense: true,
contentPadding: const EdgeInsets.only(
top: _contentVerticalPadding,
bottom: _contentVerticalPadding,
left: denseSpacing,
right: densePadding,
),
constraints: BoxConstraints(
minHeight: defaultTextFieldHeight,
maxHeight: defaultTextFieldHeight,
),
border: const OutlineInputBorder(),
labelText: labelText,
labelStyle: theme.subtleTextStyle,
hintText: hintText,
hintStyle: theme.subtleTextStyle,
prefixIcon: prefixIcon,
suffix: SizedBox(
height: inputDecorationElementHeight,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
clearInputButton(
() {
controller.clear();
onChanged?.call('');
},
),
...additionalSuffixActions,
],
),
),
),
),
);
}
}
Widget clearInputButton(VoidCallback onPressed) {
return inputDecorationSuffixButton(
icon: Icons.clear,
onPressed: onPressed,
tooltip: 'Clear',
);
}
Widget closeSearchDropdownButton(VoidCallback? onPressed) {
return inputDecorationSuffixButton(icon: Icons.close, onPressed: onPressed);
}
Widget inputDecorationSuffixButton({
required IconData icon,
required VoidCallback? onPressed,
String? tooltip,
}) {
return maybeWrapWithTooltip(
tooltip: tooltip,
child: SizedBox(
height: inputDecorationElementHeight,
width: inputDecorationElementHeight + denseSpacing,
child: IconButton(
padding: EdgeInsets.zero,
onPressed: onPressed,
iconSize: defaultIconSize,
splashRadius: defaultIconSize,
icon: Icon(icon),
),
),
);
}
class OutlinedRowGroup extends StatelessWidget {
const OutlinedRowGroup({super.key, required this.children, this.borderColor});
final List<Widget> children;
final Color? borderColor;
@override
Widget build(BuildContext context) {
final color = borderColor ?? Theme.of(context).focusColor;
final childrenWithOutlines = <Widget>[];
for (int i = 0; i < children.length; i++) {
childrenWithOutlines.addAll([
Container(
decoration: BoxDecoration(
border: Border(
left: i == 0 ? BorderSide(color: color) : BorderSide.none,
right: BorderSide(color: color),
top: BorderSide(color: color),
bottom: BorderSide(color: color),
),
),
child: children[i],
),
]);
}
return Row(
mainAxisSize: MainAxisSize.min,
children: childrenWithOutlines,
);
}
}
class ThickDivider extends StatelessWidget {
const ThickDivider({super.key});
static const double thickDividerHeight = 5;
@override
Widget build(BuildContext context) {
return const Divider(
thickness: thickDividerHeight,
height: thickDividerHeight,
);
}
}
BoxDecoration roundedBorderDecoration(BuildContext context) => BoxDecoration(
border: Border.all(color: Theme.of(context).focusColor),
borderRadius: defaultBorderRadius,
);
class LeftBorder extends StatelessWidget {
const LeftBorder({super.key, this.child});
final Widget? child;
@override
Widget build(BuildContext context) {
final leftBorder =
Border(left: BorderSide(color: Theme.of(context).focusColor));
return Container(
decoration: BoxDecoration(border: leftBorder),
child: child,
);
}
}
/// The golden ratio.
///
/// Makes for nice-looking rectangles.
final goldenRatio = 1 + sqrt(5) / 2;
/// A centered text widget with the default DevTools text style applied.
class CenteredMessage extends StatelessWidget {
const CenteredMessage(this.message, {super.key});
final String message;
@override
Widget build(BuildContext context) {
return Center(
child: Text(
message,
textAlign: TextAlign.center,
style: Theme.of(context).regularTextStyle,
),
);
}
}
class CenteredCircularProgressIndicator extends StatelessWidget {
const CenteredCircularProgressIndicator({super.key, this.size});
final double? size;
@override
Widget build(BuildContext context) {
const indicator = Center(
child: CircularProgressIndicator(),
);
if (size == null) return indicator;
return SizedBox(
width: size,
height: size,
child: indicator,
);
}
}
/// An extension on [LinkedScrollControllerGroup] to facilitate having the
/// scrolling widgets auto scroll to the bottom on new content.
///
/// This extension serves the same function as the [ScrollControllerAutoScroll]
/// extension above, but we need to implement these methods again as an
/// extension on [LinkedScrollControllerGroup] because individual
/// [ScrollController]s are intentionally inaccessible from
/// [LinkedScrollControllerGroup].
extension LinkedScrollControllerGroupExtension on LinkedScrollControllerGroup {
bool get atScrollBottom {
final pos = position;
return pos.pixels == pos.maxScrollExtent;
}
/// Scroll the content to the bottom using the app's default animation
/// duration and curve..
void autoScrollToBottom() async {
await animateTo(
position.maxScrollExtent,
duration: rapidDuration,
curve: defaultCurve,
);
// Scroll again if we've received new content in the interim.
if (hasAttachedControllers) {
final pos = position;
if (pos.pixels != pos.maxScrollExtent) {
jumpTo(pos.maxScrollExtent);
}
}
}
}
/// Utility extension methods to the [Color] class.
extension ColorExtension on Color {
/// Return a slightly darker color than the current color.
Color darken([double percent = 0.05]) {
assert(0.0 <= percent && percent <= 1.0);
percent = 1.0 - percent;
final c = this;
return Color.fromARGB(
c.alpha,
(c.red * percent).round(),
(c.green * percent).round(),
(c.blue * percent).round(),
);
}
/// Return a slightly brighter color than the current color.
Color brighten([double percent = 0.05]) {
assert(0.0 <= percent && percent <= 1.0);
final c = this;
return Color.fromARGB(
c.alpha,
c.red + ((255 - c.red) * percent).round(),
c.green + ((255 - c.green) * percent).round(),
c.blue + ((255 - c.blue) * percent).round(),
);
}
}
class BreadcrumbNavigator extends StatelessWidget {
const BreadcrumbNavigator.builder({
super.key,
required this.itemCount,
required this.builder,
});
final int itemCount;
final IndexedWidgetBuilder builder;
@override
Widget build(BuildContext context) {
return Container(
height: Breadcrumb.height + 2 * borderPadding,
alignment: Alignment.centerLeft,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: itemCount,
itemBuilder: builder,
),
);
}
}
class Breadcrumb extends StatelessWidget {
const Breadcrumb({
super.key,
required this.text,
required this.isRoot,
required this.onPressed,
});
static const height = 24.0;
static const caretWidth = 4.0;
final String text;
final bool isRoot;
final VoidCallback onPressed;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
// Create the text painter here so that we can calculate `breadcrumbWidth`.
// We need the width for the wrapping Container that gives the CustomPaint
// a bounded width.
final textPainter = TextPainter(
text: TextSpan(
text: text,
style: theme.regularTextStyle.copyWith(
color: theme.colorScheme.contrastTextColor,
decoration: TextDecoration.underline,
),
),
textAlign: TextAlign.right,
textDirection: TextDirection.ltr,
)..layout();
final caretWidth =
isRoot ? Breadcrumb.caretWidth : Breadcrumb.caretWidth * 2;
final breadcrumbWidth = textPainter.width + caretWidth + densePadding * 2;
return InkWell(
onTap: onPressed,
child: Container(
width: breadcrumbWidth,
padding: const EdgeInsets.all(borderPadding),
child: CustomPaint(
painter: _BreadcrumbPainter(
textPainter: textPainter,
isRoot: isRoot,
breadcrumbWidth: breadcrumbWidth,
colorScheme: theme.colorScheme,
),
),
),
);
}
}
class _BreadcrumbPainter extends CustomPainter {
_BreadcrumbPainter({
required this.textPainter,
required this.isRoot,
required this.breadcrumbWidth,
required this.colorScheme,
});
final TextPainter textPainter;
final bool isRoot;
final double breadcrumbWidth;
final ColorScheme colorScheme;
@override
void paint(Canvas canvas, Size size) {
final paint = Paint()..color = colorScheme.chartAccentColor;
final path = Path()..moveTo(0, 0);
if (isRoot) {
path.lineTo(0, Breadcrumb.height);
} else {
path
..lineTo(Breadcrumb.caretWidth, Breadcrumb.height / 2)
..lineTo(0, Breadcrumb.height);
}
path
..lineTo(breadcrumbWidth - Breadcrumb.caretWidth, Breadcrumb.height)
..lineTo(breadcrumbWidth, Breadcrumb.height / 2)
..lineTo(breadcrumbWidth - Breadcrumb.caretWidth, 0);
canvas.drawPath(path, paint);
final textXOffset =
isRoot ? densePadding : Breadcrumb.caretWidth + densePadding;
textPainter.paint(
canvas,
Offset(textXOffset, (Breadcrumb.height - textPainter.height) / 2),
);
}
@override
bool shouldRepaint(covariant _BreadcrumbPainter oldDelegate) {
return textPainter != oldDelegate.textPainter ||
isRoot != oldDelegate.isRoot ||
breadcrumbWidth != oldDelegate.breadcrumbWidth ||
colorScheme != oldDelegate.colorScheme;
}
}
/// A wrapper for a Text widget, which allows for concatenating text if it
/// becomes too long.
class TextViewer extends StatelessWidget {
const TextViewer({
super.key,
required this.text,
this.maxLength = 65536, //2^16
this.style,
});
final String text;
// TODO: change the maxLength if we determine a more appropriate limit
// in https://github.com/flutter/devtools/issues/6263.
final int maxLength;
final TextStyle? style;
@override
Widget build(BuildContext context) {
final String displayText;
// Limit the length of the displayed text to maxLength
if (text.length > maxLength) {
displayText = '${text.substring(0, min(maxLength, text.length))}...';
} else {
displayText = text;
}
return Text(
displayText,
style: style,
);
}
}
class JsonViewer extends StatefulWidget {
const JsonViewer({
super.key,
required this.encodedJson,
});
final String encodedJson;
@override
State<JsonViewer> createState() => _JsonViewerState();
}
class _JsonViewerState extends State<JsonViewer>
with ProvidedControllerMixin<DebuggerController, JsonViewer> {
late Future<void> _initializeTree;
late DartObjectNode variable;
Future<void> _buildAndExpand(
DartObjectNode variable,
) async {
// Build the root node
await buildVariablesTree(variable);
// Build the contents of all children
await Future.wait(variable.children.map(buildVariablesTree));
// Expand the root node to show the first level of contents
variable.expand();
}
void _updateVariablesTree() {
assert(widget.encodedJson.isNotEmpty);
final responseJson = json.decode(widget.encodedJson);
// Insert the JSON data into the fake service cache so we can use it with
// the `ExpandableVariable` widget.
final root = serviceConnection.serviceManager.service!.fakeServiceCache
.insertJsonObject(responseJson);
variable = DartObjectNode.fromValue(
name: '[root]',
value: root,
artificialName: true,
isolateRef: IsolateRef(
id: 'fake-isolate',
number: 'fake-isolate',
name: 'local-cache',
isSystemIsolate: true,
),
);
// Intended to be unawaited.
// ignore: discarded_futures
_initializeTree = _buildAndExpand(variable);
}
@override
void initState() {
super.initState();
_updateVariablesTree();
}
@override
void didUpdateWidget(JsonViewer oldWidget) {
super.didUpdateWidget(oldWidget);
_updateVariablesTree();
}
@override
void dispose() {
super.dispose();
// Remove the JSON object from the fake service cache to avoid holding on
// to large objects indefinitely.
serviceConnection.serviceManager.service!.fakeServiceCache
.removeJsonObject(variable.value as Instance);
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
// Currently a redundant check, but adding it anyway to prevent future
// bugs being introduced.
if (!initController()) {
return;
}
// Any additional initialization code should be added after this line.
}
@override
Widget build(BuildContext context) {
return SelectionArea(
child: Padding(
padding: const EdgeInsets.all(denseSpacing),
child: SingleChildScrollView(
child: FutureBuilder(
future: _initializeTree,
builder: (context, snapshot) {
if (snapshot.connectionState != ConnectionState.done) {
return Container();
}
return ExpandableVariable(
variable: variable,
);
},
),
),
),
);
}
}
class MoreInfoLink extends StatelessWidget {
const MoreInfoLink({
Key? key,
required this.url,
required this.gaScreenName,
required this.gaSelectedItemDescription,
this.padding,
}) : super(key: key);
final String url;
final String gaScreenName;
final String gaSelectedItemDescription;
final EdgeInsets? padding;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return InkWell(
onTap: _onLinkTap,
borderRadius: defaultBorderRadius,
child: Padding(
padding: padding ?? const EdgeInsets.all(denseSpacing),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
'More info',
style: theme.linkTextStyle,
),
const SizedBox(width: densePadding),
Icon(
Icons.launch,
size: tooltipIconSize,
color: theme.colorScheme.onSurface,
),
],
),
),
);
}
void _onLinkTap() {
unawaited(launchUrl(url));
ga.select(gaScreenName, gaSelectedItemDescription);
}
}
class LinkIconLabel extends StatelessWidget {
const LinkIconLabel({
super.key,
required this.icon,
required this.link,
required this.color,
});
final IconData icon;
final Link link;
final Color? color;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: _onLinkTap,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
icon,
size: defaultIconSize,
color: color,
),
const SizedBox(width: densePadding),
Padding(
padding: const EdgeInsets.only(bottom: densePadding),
child: RichText(
text: TextSpan(
text: link.display,
style: Theme.of(context).linkTextStyle.copyWith(color: color),
),
),
),
],
),
);
}
void _onLinkTap() {
unawaited(launchUrl(link.url));
if (link.gaScreenName != null && link.gaSelectedItemDescription != null) {
ga.select(link.gaScreenName!, link.gaSelectedItemDescription!);
}
}
}
class LinkTextSpan extends TextSpan {
LinkTextSpan({
required Link link,
required BuildContext context,
TextStyle? style,
}) : super(
text: link.display,
style: style ?? Theme.of(context).linkTextStyle,
recognizer: TapGestureRecognizer()
..onTap = () async {
if (link.gaScreenName != null &&
link.gaSelectedItemDescription != null) {
ga.select(
link.gaScreenName!,
link.gaSelectedItemDescription!,
);
}
await launchUrl(link.url);
},
);
}
class Link {
const Link({
required this.display,
required this.url,
this.gaScreenName,
this.gaSelectedItemDescription,
});
final String display;
final String url;
final String? gaScreenName;
final String? gaSelectedItemDescription;
}
class Legend extends StatelessWidget {
const Legend({
Key? key,
required this.entries,
this.dense = false,
}) : super(key: key);
double get legendSquareSize =>
dense ? scaleByFontFactor(12.0) : scaleByFontFactor(16.0);
final List<LegendEntry> entries;
final bool dense;
@override
Widget build(BuildContext context) {
final textStyle = dense ? Theme.of(context).legendTextStyle : null;
final List<Widget> legendItems = entries
.map(
(entry) => _legendItem(
entry.description,
entry.color,
textStyle,
),
)
.toList()
.joinWith(const SizedBox(height: denseRowSpacing));
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: legendItems,
);
}
Widget _legendItem(String description, Color? color, TextStyle? style) {
return Row(
children: [
Container(
height: legendSquareSize,
width: legendSquareSize,
color: color,
),
const SizedBox(width: denseSpacing),
Text(
description,
style: style,
),
],
);
}
}
class LegendEntry {
const LegendEntry(this.description, this.color);
final String description;
final Color? color;
}
/// The type of data provider function used by the CopyToClipboard Control.
typedef ClipboardDataProvider = String? Function();
/// Control that copies `data` to the clipboard.
///
/// If it succeeds, it displays a notification with `successMessage`.
class CopyToClipboardControl extends StatelessWidget {
const CopyToClipboardControl({
super.key,
this.dataProvider,
this.successMessage = 'Copied to clipboard.',
this.tooltip = 'Copy to clipboard',
this.buttonKey,
this.size,
this.gaScreen,
this.gaItem,
});
final ClipboardDataProvider? dataProvider;
final String? successMessage;
final String tooltip;
final Key? buttonKey;
final double? size;
final String? gaScreen;
final String? gaItem;
@override
Widget build(BuildContext context) {
final onPressed = dataProvider == null
? null
: () {
if (gaScreen != null && gaItem != null) {
ga.select(gaScreen!, gaItem!);
}
unawaited(
copyToClipboard(dataProvider!() ?? '', successMessage),
);
};
final size = this.size ?? defaultIconSize;
return SizedBox(
height: size,
child: ToolbarAction(
icon: Icons.content_copy,
tooltip: tooltip,
onPressed: onPressed,
key: buttonKey,
size: size,
),
);
}
}
/// Checkbox Widget class that listens to and manages a [ValueNotifier].
///
/// Used to create a Checkbox widget who's boolean value is attached
/// to a [ValueNotifier<bool>]. This allows for the pattern:
///
/// Create the [NotifierCheckbox] widget in build e.g.,
///
/// myCheckboxWidget = NotifierCheckbox(notifier: controller.myCheckbox);
///
/// The checkbox and the value notifier are now linked with clicks updating the
/// [ValueNotifier] and changes to the [ValueNotifier] updating the checkbox.
class NotifierCheckbox extends StatelessWidget {
const NotifierCheckbox({
Key? key,
required this.notifier,
this.onChanged,
this.enabled = true,
this.checkboxKey,
}) : super(key: key);
/// The notifier this [NotifierCheckbox] is responsible for listening to and
/// updating.
final ValueNotifier<bool?> notifier;
/// The callback to be called on change in addition to the notifier changes
/// handled by this class.
final void Function(bool? newValue)? onChanged;
/// Whether this checkbox should be enabled for interaction.
final bool enabled;
/// Key to assign to the checkbox, for testing purposes.
final Key? checkboxKey;
void _updateValue(bool? value) {
if (notifier.value != value) {
notifier.value = value;
if (onChanged != null) {
onChanged!(value);
}
}
}
@override
Widget build(BuildContext context) {
return ValueListenableBuilder(
valueListenable: notifier,
builder: (context, bool? value, _) {
return SizedBox(
height: defaultButtonHeight,
child: Checkbox(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
value: value,
onChanged: enabled ? _updateValue : null,
key: checkboxKey,
),
);
},
);
}
}
/// A widget that represents a check box setting and automatically updates for
/// value changes to [notifier].
class CheckboxSetting extends StatelessWidget {
const CheckboxSetting({
Key? key,
required this.notifier,
required this.title,
this.description,
this.tooltip,
this.onChanged,
this.enabled = true,
this.gaScreenName,
this.gaItem,
this.checkboxKey,
}) : super(key: key);
final ValueNotifier<bool?> notifier;
final String title;
final String? description;
final String? tooltip;
final void Function(bool? newValue)? onChanged;
/// Whether this checkbox setting should be enabled for interaction.
final bool enabled;
final String? gaScreenName;
final String? gaItem;
final Key? checkboxKey;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
Widget checkboxAndTitle = Row(
mainAxisSize: MainAxisSize.min,
children: [
NotifierCheckbox(
notifier: notifier,
onChanged: (bool? value) {
final gaScreenName = this.gaScreenName;
final gaItem = this.gaItem;
if (gaScreenName != null && gaItem != null) {
ga.select(gaScreenName, gaItem);
}
final onChanged = this.onChanged;
if (onChanged != null) {
onChanged(value);
}
},
enabled: enabled,
checkboxKey: checkboxKey,
),
Flexible(
child: RichText(
overflow: TextOverflow.visible,
maxLines: 3,
text: TextSpan(
text: title,
style: enabled ? theme.regularTextStyle : theme.subtleTextStyle,
),
),
),
],
);
if (description == null) {
checkboxAndTitle = Expanded(child: checkboxAndTitle);
}
return maybeWrapWithTooltip(
tooltip: tooltip,
child: Row(
children: [
checkboxAndTitle,
if (description != null) ...[
Expanded(
child: Row(
children: [
RichText(
text: TextSpan(
text: ' • ',
style: theme.subtleTextStyle,
),
),
Flexible(
child: RichText(
maxLines: 4,
overflow: TextOverflow.ellipsis,
text: TextSpan(
text: description,
style: theme.subtleTextStyle,
),
),
),
],
),
),
],
],
),
);
}
}
class PubWarningText extends StatelessWidget {
const PubWarningText({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final isFlutterApp =
serviceConnection.serviceManager.connectedApp!.isFlutterAppNow == true;
final sdkName = isFlutterApp ? 'Flutter' : 'Dart';
final minSdkVersion = isFlutterApp ? '2.8.0' : '2.15.0';
return SelectableText.rich(
TextSpan(
text: 'Warning: you should no longer be launching DevTools from'
' pub.\n\n',
style: theme.subtleTextStyle.copyWith(color: theme.colorScheme.error),
children: [
TextSpan(
text: 'DevTools version 2.8.0 will be the last version to '
'be shipped on pub. As of $sdkName\nversion >= '
'$minSdkVersion, DevTools should be launched by running '
'the ',
style: theme.subtleTextStyle,
),
TextSpan(
text: '`dart devtools`',
style: theme.subtleFixedFontStyle,
),
TextSpan(
text: '\ncommand.',
style: theme.subtleTextStyle,
),
],
),
);
}
}
class BlinkingIcon extends StatefulWidget {
const BlinkingIcon({
Key? key,
required this.icon,
required this.color,
required this.size,
}) : super(key: key);
final IconData icon;
final Color color;
final double size;
@override
State<BlinkingIcon> createState() => _BlinkingIconState();
}
class _BlinkingIconState extends State<BlinkingIcon> {
late Timer timer;
late bool showFirst;
@override
void initState() {
super.initState();
showFirst = true;
timer = Timer.periodic(const Duration(seconds: 1), (timer) {
setState(() {
showFirst = !showFirst;
});
});
}
@override
void dispose() {
timer.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AnimatedCrossFade(
duration: const Duration(seconds: 1),
firstChild: _icon(),
secondChild: _icon(color: widget.color),
crossFadeState:
showFirst ? CrossFadeState.showFirst : CrossFadeState.showSecond,
);
}
Widget _icon({Color? color}) {
return Icon(
widget.icon,
size: widget.size,
color: color,
);
}
}
/// A widget that listens for changes to multiple different [ValueListenable]s
/// and rebuilds for change notifications from any of them.
///
/// The current value of each [ValueListenable] is provided by the `values`
/// parameter in [builder], where the index of each value in the list is equal
/// to the index of its parent [ValueListenable] in [listenables].
///
/// This widget is preferred over nesting many [ValueListenableBuilder]s in a
/// single build method.
class MultiValueListenableBuilder extends StatefulWidget {
const MultiValueListenableBuilder({
super.key,
required this.listenables,
required this.builder,
this.child,
});
final List<ValueListenable> listenables;
final Widget Function(
BuildContext context,
List<Object?> values,
Widget? child,
) builder;
final Widget? child;
@override
State<MultiValueListenableBuilder> createState() =>
_MultiValueListenableBuilderState();
}
class _MultiValueListenableBuilderState
extends State<MultiValueListenableBuilder> with AutoDisposeMixin {
@override
void initState() {
super.initState();
widget.listenables.forEach(addAutoDisposeListener);
}
@override
Widget build(BuildContext context) {
return widget.builder(
context,
[for (final listenable in widget.listenables) listenable.value],
widget.child,
);
}
}
class SmallCircularProgressIndicator extends StatelessWidget {
const SmallCircularProgressIndicator({
Key? key,
required this.valueColor,
}) : super(key: key);
final Animation<Color?> valueColor;
@override
Widget build(BuildContext context) {
return CircularProgressIndicator(
strokeWidth: 2,
valueColor: valueColor,
);
}
}
class ElevatedCard extends StatelessWidget {
const ElevatedCard({
Key? key,
required this.child,
this.width,
this.height,
this.padding,
}) : super(key: key);
final Widget child;
final double? width;
final double? height;
final EdgeInsetsGeometry? padding;
@override
Widget build(BuildContext context) {
return Card(
elevation: defaultElevation,
color: Theme.of(context).scaffoldBackgroundColor,
shape: RoundedRectangleBorder(
borderRadius: defaultBorderRadius,
),
child: Container(
width: width,
height: height,
padding: padding ?? const EdgeInsets.all(denseSpacing),
child: child,
),
);
}
}
/// A convenience wrapper for a [StatefulWidget] that uses the
/// [AutomaticKeepAliveClientMixin] on its [State].
///
/// Wrap a widget in this class if you want [child] to stay alive, and avoid
/// rebuilding. This is useful for children of [TabView]s. When wrapped in this
/// wrapper, [child] will not be destroyed and rebuilt when switching tabs.
///
/// See [AutomaticKeepAliveClientMixin] for more information.
class KeepAliveWrapper extends StatefulWidget {
const KeepAliveWrapper({Key? key, required this.child}) : super(key: key);
final Widget child;
@override
State<KeepAliveWrapper> createState() => _KeepAliveWrapperState();
}
class _KeepAliveWrapperState extends State<KeepAliveWrapper>
with AutomaticKeepAliveClientMixin {
@override
bool wantKeepAlive = true;
@override
Widget build(BuildContext context) {
super.build(context);
return widget.child;
}
}
/// Help button, that opens a dialog on click.
class HelpButtonWithDialog extends StatelessWidget {
const HelpButtonWithDialog({
super.key,
required this.gaScreen,
required this.gaSelection,
required this.dialogTitle,
required this.child,
this.actions = const <Widget>[],
this.outlined = true,
});
final String gaScreen;
final String gaSelection;
final String dialogTitle;
final Widget child;
final List<Widget> actions;
final bool outlined;
@override
Widget build(BuildContext context) {
return HelpButton(
onPressed: () {
showDevToolsDialog(
context: context,
title: dialogTitle,
content: child,
actions: actions,
);
},
gaScreen: gaScreen,
gaSelection: gaSelection,
outlined: outlined,
);
}
}
/// Display a single bullet character in order to act as a stylized spacer
/// component.
class BulletSpacer extends StatelessWidget {
const BulletSpacer({super.key, this.color});
final Color? color;
static double get width => actionWidgetSize / 2;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final mutedColor = theme.colorScheme.onSurface.withAlpha(0x90);
return Container(
width: width,
height: actionWidgetSize,
alignment: Alignment.center,
child: Text(
'•',
style: theme.regularTextStyle.copyWith(color: color ?? mutedColor),
),
);
}
}
class VerticalLineSpacer extends StatelessWidget {
const VerticalLineSpacer({required this.height, super.key});
// The total width of this spacer should be 8.0.
static double get totalWidth => _lineWidth + _paddingWidth * 2;
static const _lineWidth = 1.0;
static const _paddingWidth = 3.5;
final double height;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: _paddingWidth),
child: OutlineDecoration.onlyLeft(
child: SizedBox(
width: _lineWidth,
height: height,
),
),
);
}
}
class DownloadButton extends StatelessWidget {
const DownloadButton({
Key? key,
this.onPressed,
this.tooltip = 'Download data',
this.label = 'Download',
required this.minScreenWidthForTextBeforeScaling,
required this.gaScreen,
required this.gaSelection,
}) : super(key: key);
final VoidCallback? onPressed;
final String? tooltip;
final String label;
final double minScreenWidthForTextBeforeScaling;
final String gaScreen;
final String gaSelection;
@override
Widget build(BuildContext context) {
return GaDevToolsButton(
label: label,
icon: Icons.file_download,
tooltip: tooltip,
gaScreen: gaScreen,
gaSelection: gaSelection,
onPressed: onPressed,
minScreenWidthForTextBeforeScaling: minScreenWidthForTextBeforeScaling,
);
}
}
class RadioButton<T> extends StatelessWidget {
const RadioButton({
super.key,
required this.label,
required this.itemValue,
required this.groupValue,
this.onChanged,
this.radioKey,
});
final String label;
final T itemValue;
final T groupValue;
final void Function(T?)? onChanged;
final Key? radioKey;
@override
Widget build(BuildContext context) {
return Row(
children: [
Radio<T>(
value: itemValue,
groupValue: groupValue,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onChanged: onChanged,
key: radioKey,
),
Expanded(child: Text(label, overflow: TextOverflow.ellipsis)),
],
);
}
}
class ContextMenuButton extends StatelessWidget {
ContextMenuButton({
super.key,
required this.menuChildren,
this.color,
this.gaScreen,
this.gaItem,
this.buttonWidth = defaultWidth,
this.icon = Icons.more_vert,
double? iconSize,
}) : iconSize = iconSize ?? tableIconSize;
static const double defaultWidth = 14.0;
static const double densePadding = 2.0;
final Color? color;
final String? gaScreen;
final String? gaItem;
final List<Widget> menuChildren;
final IconData icon;
final double iconSize;
final double buttonWidth;
@override
Widget build(BuildContext context) {
return MenuAnchor(
menuChildren: menuChildren,
builder:
(BuildContext context, MenuController controller, Widget? child) {
return SizedBox(
width: buttonWidth,
child: ToolbarAction(
icon: icon,
size: iconSize,
color: color,
onPressed: () {
if (gaScreen != null && gaItem != null) {
ga.select(gaScreen!, gaItem!);
}
if (controller.isOpen) {
controller.close();
} else {
controller.open();
}
},
),
);
},
);
}
}
| devtools/packages/devtools_app/lib/src/shared/common_widgets.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/common_widgets.dart",
"repo_id": "devtools",
"token_count": 22428
} | 150 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import '../file/file.dart';
import 'import_export.dart';
ExportControllerDesktop createExportController() {
return ExportControllerDesktop();
}
class ExportControllerDesktop extends ExportController {
ExportControllerDesktop() : super.impl();
static final _fs = FileIO();
@override
void saveFile({
required String content,
required String fileName,
}) {
_fs.writeStringToFile(fileName, content);
}
}
| devtools/packages/devtools_app/lib/src/shared/config_specific/import_export/_export_desktop.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/config_specific/import_export/_export_desktop.dart",
"repo_id": "devtools",
"token_count": 167
} | 151 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/material.dart';
import '../../diagnostics/dart_object_node.dart';
import '../../diagnostics/diagnostics_node.dart';
import '../../diagnostics/tree_builder.dart';
import '../../diagnostics_text_styles.dart';
import '../../globals.dart';
import '../../primitives/utils.dart';
import '../../ui/hover.dart';
import '../../ui/icons.dart';
import '../../ui/utils.dart';
import '../eval/inspector_tree.dart';
import 'expandable_variable.dart';
final _colorIconMaker = ColorIconMaker();
final _customIconMaker = CustomIconMaker();
final defaultIcon = _customIconMaker.fromInfo('Default');
const _showRenderObjectPropertiesAsLinks = false;
/// Presents the content of a single [RemoteDiagnosticsNode].
///
/// Use this class any time you want to display a single [RemoteDiagnosticsNode]
/// in debugging UI whether you are displaying the node in the [InspectorTree]
/// in console output, or a debugger.
/// See also:
/// * [InspectorTree], which uses this class to display each node in the in
/// inspector tree.
class DiagnosticsNodeDescription extends StatelessWidget {
const DiagnosticsNodeDescription(
this.diagnostic, {
super.key,
this.isSelected = false,
this.searchValue,
this.errorText,
this.multiline = false,
this.style,
this.nodeDescriptionHighlightStyle,
});
final RemoteDiagnosticsNode? diagnostic;
final bool isSelected;
final String? errorText;
final String? searchValue;
final bool multiline;
final TextStyle? style;
final TextStyle? nodeDescriptionHighlightStyle;
static Widget _paddedIcon(Widget icon) {
return Padding(
padding: const EdgeInsets.only(right: iconPadding),
child: icon,
);
}
/// Approximates the width of the elements inside a [RemoteDiagnosticsNode]
/// widget.
static double approximateNodeWidth(
RemoteDiagnosticsNode? diagnostic,
) {
// If we have rendered this node, then we know it's text style,
// otherwise assume defaultFontSize for the TextStyle.
final textStyle = diagnostic?.descriptionTextStyleFromBuild ??
TextStyle(fontSize: defaultFontSize);
final spans = DiagnosticsNodeDescription.buildDescriptionTextSpans(
description: diagnostic?.description ?? '',
textStyle: textStyle,
colorScheme: const ColorScheme.dark(),
diagnostic: diagnostic,
);
var spanWidth = spans.fold<double>(
0,
(sum, span) => sum + calculateTextSpanWidth(span),
);
String? name = diagnostic?.name;
// An Icon is approximately the width of 1 character
if (diagnostic?.showName == true && name != null) {
// The diagnostic will show its name instead of an icon so add an
// approximate name width.
if (diagnostic?.description != null) {
// If there is a description then a separator will show with the name.
name += ': ';
}
spanWidth +=
calculateTextSpanWidth(TextSpan(text: name, style: textStyle));
} else {
final approximateIconWidth = IconKind.info.icon.width + iconPadding;
// When there is no name, an icon will be shown with the text spans.
spanWidth += approximateIconWidth;
}
return spanWidth;
}
static Iterable<TextSpan> buildDescriptionTextSpans({
required String description,
required TextStyle textStyle,
required ColorScheme colorScheme,
RemoteDiagnosticsNode? diagnostic,
String? searchValue,
TextStyle? nodeDescriptionHighlightStyle,
}) sync* {
final diagnosticLocal = diagnostic!;
if (diagnosticLocal.isDiagnosticableValue) {
final match = treeNodePrimaryDescriptionPattern.firstMatch(description);
if (match != null) {
yield TextSpan(text: match.group(1), style: textStyle);
if (match.group(2)?.isNotEmpty == true) {
yield TextSpan(
text: match.group(2),
style:
textStyle.merge(DiagnosticsTextStyles.unimportant(colorScheme)),
);
}
return;
}
} else if (diagnosticLocal.type == 'ErrorDescription') {
final match = assertionThrownBuildingError.firstMatch(description);
if (match != null) {
yield TextSpan(text: match.group(1), style: textStyle);
yield TextSpan(text: match.group(3), style: textStyle);
return;
}
}
if (description.isNotEmpty) {
yield TextSpan(text: description, style: textStyle);
}
final textPreview = diagnosticLocal.json['textPreview'];
if (textPreview is String) {
final preview = textPreview.replaceAll('\n', ' ');
yield TextSpan(
children: [
TextSpan(
text: ': ',
style: textStyle,
),
_buildHighlightedSearchPreview(
preview,
searchValue,
textStyle,
textStyle.merge(nodeDescriptionHighlightStyle),
),
],
);
}
}
Widget buildDescription({
required String description,
required TextStyle textStyle,
required ColorScheme colorScheme,
RemoteDiagnosticsNode? diagnostic,
String? searchValue,
TextStyle? nodeDescriptionHighlightStyle,
}) {
// Store the textStyle of the built widget so that it can be used in
// [approximateNodeWidth] later.
diagnostic?.descriptionTextStyleFromBuild = textStyle;
final textSpan = TextSpan(
children: buildDescriptionTextSpans(
description: description,
textStyle: textStyle,
colorScheme: colorScheme,
diagnostic: diagnostic,
searchValue: searchValue,
nodeDescriptionHighlightStyle: nodeDescriptionHighlightStyle,
).toList(),
);
final diagnosticLocal = diagnostic!;
final inspectorService = serviceConnection.inspectorService!;
return HoverCardTooltip.async(
enabled: () =>
preferences.inspector.hoverEvalModeEnabled.value &&
diagnosticLocal.objectGroupApi != null,
asyncGenerateHoverCardData: ({
required event,
required isHoverStale,
}) async {
final group = inspectorService.createObjectGroup('hover');
if (isHoverStale()) return Future.value();
final value =
await group.toObservatoryInstanceRef(diagnosticLocal.valueRef);
final variable = DartObjectNode.fromValue(
value: value,
isolateRef: inspectorService.isolateRef,
diagnostic: diagnosticLocal,
);
if (isHoverStale()) return Future.value();
await buildVariablesTree(variable);
final tasks = <Future<void>>[];
for (var child in variable.children) {
tasks.add(() async {
if (!isHoverStale()) await buildVariablesTree(child);
}());
}
await Future.wait(tasks);
variable.expand();
return HoverCardData(
title: diagnosticLocal.toStringShort(),
contents: Material(
child: ExpandableVariable(
variable: variable,
),
),
);
},
child: multiline
? SelectableText.rich(textSpan)
: RichText(
overflow: TextOverflow.ellipsis,
text: textSpan,
),
);
}
@override
Widget build(BuildContext context) {
final diagnosticLocal = diagnostic;
if (diagnosticLocal == null) {
return const SizedBox();
}
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
final icon = diagnosticLocal.icon;
final children = <Widget>[];
if (icon != null) {
children.add(_paddedIcon(icon));
}
final name = diagnosticLocal.name;
final defaultStyle = DefaultTextStyle.of(context).style;
final baseStyle = style ?? defaultStyle;
TextStyle textStyle = baseStyle.merge(
DiagnosticsTextStyles.textStyleForLevel(
diagnosticLocal.level,
colorScheme,
),
);
var descriptionTextStyle = textStyle;
// TODO(jacobr): use TextSpans and SelectableText instead of Text.
if (diagnosticLocal.isProperty) {
// Display of inline properties.
final propertyType = diagnosticLocal.propertyType;
final properties = diagnosticLocal.valuePropertiesJson;
if (name?.isNotEmpty == true && diagnosticLocal.showName) {
children.add(
Text(
'$name${diagnosticLocal.separator} ',
style: textStyle,
),
);
// provide some contrast between the name and description if both are
// present.
descriptionTextStyle =
descriptionTextStyle.merge(theme.subtleTextStyle);
}
if (diagnosticLocal.isCreatedByLocalProject) {
textStyle = textStyle.merge(DiagnosticsTextStyles.regularBold);
}
String description = diagnosticLocal.description ?? '';
if (propertyType != null && properties != null) {
switch (propertyType) {
case 'Color':
{
final int alpha = JsonUtils.getIntMember(properties, 'alpha');
final int red = JsonUtils.getIntMember(properties, 'red');
final int green = JsonUtils.getIntMember(properties, 'green');
final int blue = JsonUtils.getIntMember(properties, 'blue');
String radix(int chan) => chan.toRadixString(16).padLeft(2, '0');
description = alpha == 255
? '#${radix(red)}${radix(green)}${radix(blue)}'
: '#${radix(alpha)}${radix(red)}${radix(green)}${radix(blue)}';
final Color color = Color.fromARGB(alpha, red, green, blue);
children.add(_paddedIcon(_colorIconMaker.getCustomIcon(color)));
break;
}
case 'IconData':
{
final int codePoint =
JsonUtils.getIntMember(properties, 'codePoint');
if (codePoint > 0) {
final icon = FlutterMaterialIcons.getIconForCodePoint(
codePoint,
colorScheme,
);
children.add(_paddedIcon(icon));
}
break;
}
}
}
if (_showRenderObjectPropertiesAsLinks &&
propertyType == 'RenderObject') {
textStyle = textStyle..merge(DiagnosticsTextStyles.link(colorScheme));
}
// TODO(jacobr): custom display for units, iterables, and padding.
children.add(
Flexible(
child: buildDescription(
description: description,
textStyle: descriptionTextStyle,
colorScheme: colorScheme,
diagnostic: diagnostic,
searchValue: searchValue,
nodeDescriptionHighlightStyle: nodeDescriptionHighlightStyle,
),
),
);
if (diagnosticLocal.level == DiagnosticLevel.fine &&
diagnosticLocal.hasDefaultValue) {
children.add(const Text(' '));
children.add(_paddedIcon(defaultIcon));
}
} else {
// Non property, regular node case.
if (name != null &&
name.isNotEmpty &&
diagnosticLocal.showName &&
name != 'child') {
if (name.startsWith('child ')) {
children.add(
Text(
name,
style: DiagnosticsTextStyles.unimportant(colorScheme),
),
);
} else {
children.add(Text(name, style: textStyle));
}
if (diagnosticLocal.showSeparator) {
children.add(
Text(
diagnosticLocal.separator,
style: textStyle,
),
);
if (diagnosticLocal.separator != ' ' &&
(diagnosticLocal.description?.isNotEmpty ?? false)) {
children.add(
Text(
' ',
style: textStyle,
),
);
}
}
}
if (!diagnosticLocal.isSummaryTree &&
diagnosticLocal.isCreatedByLocalProject) {
textStyle = textStyle.merge(DiagnosticsTextStyles.regularBold);
}
var diagnosticDescription = buildDescription(
description: diagnosticLocal.description ?? '',
textStyle: descriptionTextStyle,
colorScheme: colorScheme,
diagnostic: diagnostic,
searchValue: searchValue,
nodeDescriptionHighlightStyle: nodeDescriptionHighlightStyle,
);
if (errorText != null) {
// TODO(dantup): Find if there's a way to achieve this without
// the nested row.
diagnosticDescription = Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
diagnosticDescription,
_buildErrorText(colorScheme),
],
);
} else if (multiline &&
diagnosticLocal.hasCreationLocation &&
!diagnosticLocal.isProperty) {
diagnosticDescription = Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
diagnosticDescription,
_buildLocation(context),
],
);
}
children.add(Expanded(child: diagnosticDescription));
}
return Row(mainAxisSize: MainAxisSize.min, children: children);
}
Widget _buildLocation(BuildContext context) {
final location = diagnostic!.creationLocation!;
return Flexible(
child: RichText(
textAlign: TextAlign.right,
overflow: TextOverflow.ellipsis,
text: TextSpan(
text:
'${location.getFile()!.split('/').last}:${location.getLine()}:${location.getColumn()} ',
style: DiagnosticsTextStyles.regular(Theme.of(context).colorScheme),
),
),
);
}
Flexible _buildErrorText(ColorScheme colorScheme) {
return Flexible(
child: RichText(
textAlign: TextAlign.right,
overflow: TextOverflow.ellipsis,
text: TextSpan(
text: errorText,
// When the node is selected, the background will be an error
// color so don't render the text the same color.
style: isSelected
? DiagnosticsTextStyles.regular(colorScheme)
: DiagnosticsTextStyles.error(colorScheme),
),
),
);
}
static TextSpan _buildHighlightedSearchPreview(
String textPreview,
String? searchValue,
TextStyle textStyle,
TextStyle highlightTextStyle,
) {
if (searchValue == null || searchValue.isEmpty) {
return TextSpan(
text: '"$textPreview"',
style: textStyle,
);
}
if (textPreview.caseInsensitiveEquals(searchValue)) {
return TextSpan(
text: '"$textPreview"',
style: highlightTextStyle,
);
}
final matches = searchValue.caseInsensitiveAllMatches(textPreview);
if (matches.isEmpty) {
return TextSpan(
text: '"$textPreview"',
style: textStyle,
);
}
final quoteSpan = TextSpan(text: '"', style: textStyle);
final spans = <TextSpan>[quoteSpan];
var previousItemEnd = 0;
for (final match in matches) {
if (match.start > previousItemEnd) {
spans.add(
TextSpan(
text: textPreview.substring(previousItemEnd, match.start),
style: textStyle,
),
);
}
spans.add(
TextSpan(
text: textPreview.substring(match.start, match.end),
style: highlightTextStyle,
),
);
previousItemEnd = match.end;
}
spans.add(
TextSpan(
text: textPreview.substring(previousItemEnd, textPreview.length),
style: textStyle,
),
);
spans.add(quoteSpan);
return TextSpan(children: spans);
}
}
| devtools/packages/devtools_app/lib/src/shared/console/widgets/description.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/console/widgets/description.dart",
"repo_id": "devtools",
"token_count": 6661
} | 152 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:vm_service/vm_service.dart';
class RecordFields {
RecordFields(List<BoundField>? fields) {
positional = <BoundField>[];
named = <BoundField>[];
for (final field in fields ?? []) {
if (_isPositionalField(field)) {
positional.add(field);
} else {
named.add(field);
}
}
_sortPositionalFields(positional);
}
late final List<BoundField> positional;
late final List<BoundField> named;
static bool _isPositionalField(BoundField field) => field.name is int;
// Sorts positional fields in ascending order:
static void _sortPositionalFields(List<BoundField> fields) {
fields.sort((field1, field2) {
assert(field1.name is int && field2.name is int);
final name1 = field1.name as int;
final name2 = field2.name as int;
return name1.compareTo(name2);
});
}
}
| devtools/packages/devtools_app/lib/src/shared/diagnostics/primitives/record_fields.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/diagnostics/primitives/record_fields.dart",
"repo_id": "devtools",
"token_count": 370
} | 153 |
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/service.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:flutter/foundation.dart';
import '../extensions/extension_service.dart';
import '../screens/debugger/breakpoint_manager.dart';
import '../service/service_manager.dart';
import '../shared/banner_messages.dart';
import '../shared/notifications.dart';
import 'console/eval/eval_service.dart';
import 'environment_parameters/environment_parameters_base.dart';
import 'framework_controller.dart';
import 'offline_mode.dart';
import 'preferences/preferences.dart';
import 'primitives/message_bus.dart';
import 'primitives/storage.dart';
import 'scripts/script_manager.dart';
import 'survey.dart';
/// Whether this DevTools build is external.
bool get isExternalBuild => _isExternalBuild;
bool _isExternalBuild = true;
void setInternalBuild() => _isExternalBuild = false;
ServiceConnectionManager get serviceConnection =>
globals[ServiceConnectionManager] as ServiceConnectionManager;
ScriptManager get scriptManager => globals[ScriptManager] as ScriptManager;
MessageBus get messageBus => globals[MessageBus] as MessageBus;
FrameworkController get frameworkController =>
globals[FrameworkController] as FrameworkController;
Storage get storage => globals[Storage] as Storage;
SurveyService get surveyService => globals[SurveyService] as SurveyService;
DTDManager get dtdManager => globals[DTDManager] as DTDManager;
PreferencesController get preferences =>
globals[PreferencesController] as PreferencesController;
DevToolsEnvironmentParameters get devToolsExtensionPoints =>
globals[DevToolsEnvironmentParameters] as DevToolsEnvironmentParameters;
OfflineModeController get offlineController =>
globals[OfflineModeController] as OfflineModeController;
NotificationService get notificationService =>
globals[NotificationService] as NotificationService;
BannerMessagesController get bannerMessages =>
globals[BannerMessagesController] as BannerMessagesController;
BreakpointManager get breakpointManager =>
globals[BreakpointManager] as BreakpointManager;
EvalService get evalService => globals[EvalService] as EvalService;
ExtensionService get extensionService =>
globals[ExtensionService] as ExtensionService;
/// Whether DevTools is being run in integration test mode.
bool get integrationTestMode => _integrationTestMode;
bool _integrationTestMode = false;
void setIntegrationTestMode() {
_integrationTestMode = true;
}
/// Whether DevTools is being run in a test environment.
bool get testMode => _testMode;
bool _testMode = false;
void setTestMode() {
_testMode = true;
}
/// Whether DevTools is being run as a stager app.
bool get stagerMode => _stagerMode;
bool _stagerMode = false;
void setStagerMode() {
if (!kReleaseMode) {
_stagerMode = true;
}
}
| devtools/packages/devtools_app/lib/src/shared/globals.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/globals.dart",
"repo_id": "devtools",
"token_count": 842
} | 154 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Direction of reference between objects in memory.
enum RefDirection {
inbound,
outbound,
}
/// Result of invocation of [identityHashCode].
typedef IdentityHashCode = int;
class MemoryFootprint {
MemoryFootprint({
required this.dart,
required this.reachable,
});
/// Reachable and unreachable total dart heap size.
final int dart;
/// Subset of [dart].
final int reachable;
}
| devtools/packages/devtools_app/lib/src/shared/memory/simple_items.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/memory/simple_items.dart",
"repo_id": "devtools",
"token_count": 168
} | 155 |
This folder contains code forked from https://github.com/google/flutter.widgets. | devtools/packages/devtools_app/lib/src/shared/primitives/flutter_widgets/README.md/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/primitives/flutter_widgets/README.md",
"repo_id": "devtools",
"token_count": 21
} | 156 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:collection';
import 'package:devtools_app_shared/utils.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../framework/framework_core.dart';
import 'globals.dart';
import 'primitives/utils.dart';
const memoryAnalysisScreenId = 'memoryanalysis';
const homeScreenId = '';
const snapshotScreenId = 'snapshot';
/// Represents a Page/route for a DevTools screen.
class DevToolsRouteConfiguration {
DevToolsRouteConfiguration(this.page, this.args, this.state);
final String page;
final Map<String, String?> args;
final DevToolsNavigationState? state;
}
/// Converts between structured [DevToolsRouteConfiguration] (our internal data
/// for pages/routing) and [RouteInformation] (generic data that can be persisted
/// in the address bar/state objects).
class DevToolsRouteInformationParser
extends RouteInformationParser<DevToolsRouteConfiguration> {
DevToolsRouteInformationParser();
@visibleForTesting
DevToolsRouteInformationParser.test(this._forceVmServiceUri);
/// The value for the 'uri' query parameter in a DevTools uri.
///
/// This is to be used in a testing environment only and can be set via the
/// [DevToolsRouteInformationParser.test] constructor.
String? _forceVmServiceUri;
@override
Future<DevToolsRouteConfiguration> parseRouteInformation(
RouteInformation routeInformation,
) async {
var uri = routeInformation.uri;
if (_forceVmServiceUri != null) {
final newQueryParams = Map<String, dynamic>.from(uri.queryParameters);
newQueryParams['uri'] = _forceVmServiceUri;
uri = uri.copyWith(queryParameters: newQueryParams);
}
final uriFromParams = uri.queryParameters['uri'];
if (uriFromParams == null) {
// If the uri has been modified and we do not have a vm service uri as a
// query parameter, ensure we manually disconnect from any previously
// connected applications.
await serviceConnection.serviceManager.manuallyDisconnect();
} else if (_forceVmServiceUri == null) {
// Otherwise, connect to the vm service from the query parameter before
// loading the route (but do not do this in a testing environment).
await FrameworkCore.initVmService(serviceUriAsString: uriFromParams);
}
// routeInformation.path comes from the address bar and (when not empty) is
// prefixed with a leading slash. Internally we use "page IDs" that do not
// start with slashes but match the screenId for each screen.
final path = uri.path.isNotEmpty ? uri.path.substring(1) : '';
final configuration = DevToolsRouteConfiguration(
path,
uri.queryParameters,
_navigationStateFromRouteInformation(routeInformation),
);
return SynchronousFuture<DevToolsRouteConfiguration>(configuration);
}
@override
RouteInformation restoreRouteInformation(
DevToolsRouteConfiguration configuration,
) {
// Add a leading slash to convert the page ID to a URL path (this is
// the opposite of what's done in [parseRouteInformation]).
final path = '/${configuration.page}';
// Create a new map in case the one we were given was unmodifiable.
final params = {...configuration.args};
params.removeWhere((key, value) => value == null);
return RouteInformation(
uri: Uri(path: path, queryParameters: params),
state: configuration.state,
);
}
DevToolsNavigationState? _navigationStateFromRouteInformation(
RouteInformation routeInformation,
) {
final routeState = routeInformation.state;
if (routeState == null) return null;
try {
return DevToolsNavigationState._(
(routeState as Map).cast<String, String?>(),
);
} catch (_) {
return null;
}
}
}
class DevToolsRouterDelegate extends RouterDelegate<DevToolsRouteConfiguration>
with
ChangeNotifier,
PopNavigatorRouterDelegateMixin<DevToolsRouteConfiguration> {
DevToolsRouterDelegate(this._getPage, [GlobalKey<NavigatorState>? key])
: navigatorKey = key ?? GlobalKey<NavigatorState>();
static DevToolsRouterDelegate of(BuildContext context) =>
Router.of(context).routerDelegate as DevToolsRouterDelegate;
@override
final GlobalKey<NavigatorState> navigatorKey;
static String get currentPage => _currentPage;
static late String _currentPage;
final Page Function(
BuildContext,
String?,
Map<String, String?>,
DevToolsNavigationState?,
) _getPage;
/// A list of any routes/pages on the stack.
///
/// This will usually only contain a single item (it's the visible stack,
/// not the history).
final _routes = ListQueue<DevToolsRouteConfiguration>();
@override
DevToolsRouteConfiguration? get currentConfiguration =>
_routes.isEmpty ? null : _routes.last;
@override
Widget build(BuildContext context) {
final routeConfig = currentConfiguration;
final page = routeConfig?.page;
final args = routeConfig?.args ?? {};
final state = routeConfig?.state;
return Navigator(
key: navigatorKey,
pages: [_getPage(context, page, args, state)],
onPopPage: (_, __) {
if (_routes.length <= 1) {
return false;
}
_routes.removeLast();
notifyListeners();
return true;
},
);
}
/// Navigates to a new page, optionally updating arguments and state.
///
/// If page, args, and state would be the same, does nothing.
/// Existing arguments (for example &uri=) will be preserved unless
/// overwritten by [argUpdates].
void navigateIfNotCurrent(
String page, [
Map<String, String?>? argUpdates,
DevToolsNavigationState? stateUpdates,
]) {
final pageChanged = page != currentConfiguration!.page;
final argsChanged = _changesArgs(argUpdates);
final stateChanged = _changesState(stateUpdates);
if (!pageChanged && !argsChanged && !stateChanged) {
return;
}
navigate(page, argUpdates, stateUpdates);
}
/// Navigates to a new page, optionally updating arguments and state.
///
/// Existing arguments (for example &uri=) will be preserved unless
/// overwritten by [argUpdates].
void navigate(
String page, [
Map<String, String?>? argUpdates,
DevToolsNavigationState? state,
]) {
final newArgs = {...currentConfiguration?.args ?? {}, ...?argUpdates};
// Ensure we disconnect from any previously connected applications if we do
// not have a vm service uri as a query parameter, unless we are loading an
// offline file.
if (page != snapshotScreenId && newArgs['uri'] == null) {
unawaited(serviceConnection.serviceManager.manuallyDisconnect());
}
_replaceStack(
DevToolsRouteConfiguration(page, newArgs, state),
);
notifyListeners();
}
void navigateHome({
bool clearUriParam = false,
required bool clearScreenParam,
}) {
navigate(
homeScreenId,
{
if (clearUriParam) 'uri': null,
if (clearScreenParam) 'screen': null,
},
);
}
/// Replaces the navigation stack with a new route.
void _replaceStack(DevToolsRouteConfiguration configuration) {
_currentPage = configuration.page;
_routes
..clear()
..add(configuration);
}
@override
Future<void> setNewRoutePath(DevToolsRouteConfiguration configuration) {
_replaceStack(configuration);
notifyListeners();
return SynchronousFuture<void>(null);
}
/// Updates arguments for the current page.
///
/// Existing arguments (for example &uri=) will be preserved unless
/// overwritten by [argUpdates].
void updateArgsIfChanged(Map<String, String> argUpdates) {
final argsChanged = _changesArgs(argUpdates);
if (!argsChanged) {
return;
}
final currentConfig = currentConfiguration!;
final currentPage = currentConfig.page;
final newArgs = {...currentConfig.args, ...argUpdates};
_replaceStack(
DevToolsRouteConfiguration(
currentPage,
newArgs,
currentConfig.state,
),
);
notifyListeners();
}
Future<void> replaceState(DevToolsNavigationState state) async {
final currentConfig = currentConfiguration!;
_replaceStack(
DevToolsRouteConfiguration(
currentConfig.page,
currentConfig.args,
state,
),
);
final path = '/${currentConfig.page}';
// Create a new map in case the one we were given was unmodifiable.
final params = Map.of(currentConfig.args);
params.removeWhere((key, value) => value == null);
await SystemNavigator.routeInformationUpdated(
uri: Uri(path: path, queryParameters: params),
state: state,
replace: true,
);
}
/// Updates state for the current page.
///
/// Existing state will be preserved unless overwritten by [stateUpdate].
void updateStateIfChanged(DevToolsNavigationState stateUpdate) {
final stateChanged = _changesState(stateUpdate);
if (!stateChanged) {
return;
}
final currentConfig = currentConfiguration!;
_replaceStack(
DevToolsRouteConfiguration(
currentConfig.page,
currentConfig.args,
currentConfig.state?.merge(stateUpdate) ?? stateUpdate,
),
);
// Add the new state to the browser history.
notifyListeners();
}
/// Checks whether applying [changes] over the current route's args will result
/// in any changes.
bool _changesArgs(Map<String, String?>? changes) {
final currentConfig = currentConfiguration!;
return !mapEquals(
{...currentConfig.args, ...?changes},
{...currentConfig.args},
);
}
/// Checks whether applying [changes] over the current route's state will result
/// in any changes.
bool _changesState(DevToolsNavigationState? changes) {
final currentState = currentConfiguration!.state;
if (currentState == null) {
return changes != null;
}
return currentState.hasChanges(changes);
}
}
/// Encapsulates state associated with a [Router] navigation event.
class DevToolsNavigationState {
DevToolsNavigationState({
required this.kind,
required Map<String, String?> state,
}) : _state = {
_kKind: kind,
...state,
};
DevToolsNavigationState._(this._state) : kind = _state[_kKind]!;
static const _kKind = '_kind';
final String kind;
UnmodifiableMapView<String, String?> get state => UnmodifiableMapView(_state);
final Map<String, String?> _state;
bool hasChanges(DevToolsNavigationState? other) {
return !mapEquals(
{...state, ...?other?.state},
state,
);
}
/// Creates a new [DevToolsNavigationState] by merging this instance with
/// [other].
///
/// State contained in [other] will take precedence over state contained in
/// this instance (e.g., if both instances have state with the same key, the
/// state in [other] will be used).
DevToolsNavigationState merge(DevToolsNavigationState other) {
final newState = <String, String?>{
..._state,
...other._state,
};
return DevToolsNavigationState(kind: kind, state: newState);
}
@override
String toString() => _state.toString();
Map<String, dynamic> toJson() => _state;
}
/// Mixin that gives controllers the ability to respond to changes in router
/// navigation state.
mixin RouteStateHandlerMixin on DisposableController {
DevToolsRouterDelegate? _delegate;
@override
void dispose() {
super.dispose();
_delegate?.removeListener(_onRouteStateUpdate);
}
void subscribeToRouterEvents(DevToolsRouterDelegate delegate) {
final oldDelegate = _delegate;
if (oldDelegate != null) {
oldDelegate.removeListener(_onRouteStateUpdate);
}
delegate.addListener(_onRouteStateUpdate);
_delegate = delegate;
}
void _onRouteStateUpdate() {
final state = _delegate?.currentConfiguration?.state;
if (state == null) return;
onRouteStateUpdate(state);
}
/// Perform operations based on changes in navigation state.
///
/// This method is only invoked if [subscribeToRouterEvents] has been called on
/// this instance with a valid [DevToolsRouterDelegate].
void onRouteStateUpdate(DevToolsNavigationState state);
}
| devtools/packages/devtools_app/lib/src/shared/routing.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/routing.dart",
"repo_id": "devtools",
"token_count": 4079
} | 157 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of 'table.dart';
enum _TableRowType {
data,
columnHeader,
columnGroupHeader,
filler,
}
enum _TableRowPartDisplayType {
column,
columnSpacer,
columnGroupSpacer,
}
/// Presents a [node] as a row in a table.
///
/// When the given [node] is null, this widget will instead present
/// column headings.
@visibleForTesting
class TableRow<T> extends StatefulWidget {
/// Constructs a [TableRow] that presents the column values for
/// [node].
const TableRow({
Key? key,
required this.linkedScrollControllerGroup,
required this.node,
required this.columns,
required this.columnWidths,
required this.onPressed,
this.columnGroups,
this.backgroundColor,
this.expandableColumn,
this.isExpanded = false,
this.isExpandable = false,
this.isSelected = false,
this.isShown = true,
this.enableHoverHandling = false,
this.displayTreeGuidelines = false,
this.searchMatchesNotifier,
this.activeSearchMatchNotifier,
}) : sortColumn = null,
sortDirection = null,
secondarySortColumn = null,
onSortChanged = null,
_rowType = _TableRowType.data,
tall = false,
super(key: key);
/// Constructs a [TableRow] that is empty.
const TableRow.filler({
Key? key,
required this.linkedScrollControllerGroup,
required this.columns,
required this.columnWidths,
this.columnGroups,
this.backgroundColor,
}) : node = null,
isExpanded = false,
isExpandable = false,
isSelected = false,
onPressed = null,
expandableColumn = null,
isShown = true,
sortColumn = null,
sortDirection = null,
secondarySortColumn = null,
onSortChanged = null,
searchMatchesNotifier = null,
activeSearchMatchNotifier = null,
tall = false,
enableHoverHandling = false,
displayTreeGuidelines = false,
_rowType = _TableRowType.filler,
super(key: key);
/// Constructs a [TableRow] that presents the column titles instead
/// of any [node].
const TableRow.tableColumnHeader({
Key? key,
required this.linkedScrollControllerGroup,
required this.columns,
required this.columnWidths,
required this.columnGroups,
required this.sortColumn,
required this.sortDirection,
required this.onSortChanged,
this.secondarySortColumn,
this.onPressed,
this.tall = false,
this.backgroundColor,
}) : node = null,
isExpanded = false,
isExpandable = false,
isSelected = false,
expandableColumn = null,
isShown = true,
searchMatchesNotifier = null,
activeSearchMatchNotifier = null,
displayTreeGuidelines = false,
enableHoverHandling = false,
_rowType = _TableRowType.columnHeader,
super(key: key);
/// Constructs a [TableRow] that presents column group titles instead of any
/// [node].
const TableRow.tableColumnGroupHeader({
Key? key,
required this.linkedScrollControllerGroup,
required this.columnGroups,
required this.columnWidths,
required this.sortColumn,
required this.sortDirection,
required this.onSortChanged,
this.secondarySortColumn,
this.onPressed,
this.tall = false,
this.backgroundColor,
}) : node = null,
isExpanded = false,
isExpandable = false,
isSelected = false,
expandableColumn = null,
columns = const [],
isShown = true,
searchMatchesNotifier = null,
activeSearchMatchNotifier = null,
displayTreeGuidelines = false,
enableHoverHandling = false,
_rowType = _TableRowType.columnGroupHeader,
super(key: key);
final LinkedScrollControllerGroup linkedScrollControllerGroup;
final T? node;
final List<ColumnData<T>> columns;
final List<ColumnGroup>? columnGroups;
final ItemSelectedCallback<T>? onPressed;
final List<double> columnWidths;
final bool isSelected;
final _TableRowType _rowType;
final bool tall;
final bool enableHoverHandling;
/// Which column, if any, should show expansion affordances
/// and nested rows.
final ColumnData<T>? expandableColumn;
/// Whether or not this row is expanded.
///
/// This dictates the orientation of the expansion arrow
/// that is drawn in the [expandableColumn].
///
/// Only meaningful if [isExpanded] is true.
final bool isExpanded;
/// Whether or not this row can be expanded.
///
/// This dictates whether an expansion arrow is
/// drawn in the [expandableColumn].
final bool isExpandable;
/// Whether or not this row is shown.
///
/// When the value is toggled, this row will appear or disappear.
final bool isShown;
/// The background color of the row.
///
/// If null, defaults to `Theme.of(context).canvasColor`.
final Color? backgroundColor;
final ColumnData<T>? sortColumn;
final SortDirection? sortDirection;
final ColumnData<T>? secondarySortColumn;
final Function(
ColumnData<T> column,
SortDirection direction, {
ColumnData<T>? secondarySortColumn,
})? onSortChanged;
final ValueListenable<List<T>>? searchMatchesNotifier;
final ValueListenable<T?>? activeSearchMatchNotifier;
final bool displayTreeGuidelines;
@override
State<TableRow<T>> createState() => _TableRowState<T>();
}
class _TableRowState<T> extends State<TableRow<T>>
with
TickerProviderStateMixin,
CollapsibleAnimationMixin,
AutoDisposeMixin,
SearchableMixin {
Key? contentKey;
late ScrollController scrollController;
bool isSearchMatch = false;
bool isActiveSearchMatch = false;
bool isHovering = false;
@override
void initState() {
super.initState();
contentKey = ValueKey(this);
scrollController = widget.linkedScrollControllerGroup.addAndGet();
_initSearchListeners();
}
@override
void didUpdateWidget(TableRow<T> oldWidget) {
super.didUpdateWidget(oldWidget);
setExpanded(widget.isExpanded);
if (oldWidget.linkedScrollControllerGroup !=
widget.linkedScrollControllerGroup) {
scrollController.dispose();
scrollController = widget.linkedScrollControllerGroup.addAndGet();
}
cancelListeners();
_initSearchListeners();
}
@override
void dispose() {
super.dispose();
scrollController.dispose();
}
@override
Widget build(BuildContext context) {
final node = widget.node;
final widgetOnPressed = widget.onPressed;
void Function()? onPressed;
if (node != null && widgetOnPressed != null) {
onPressed = () => widgetOnPressed(node);
}
final row = tableRowFor(
context,
onPressed: onPressed,
);
final box = SizedBox(
height: widget._rowType == _TableRowType.data
? defaultRowHeight
: defaultHeaderHeight +
(widget.tall ? scaleByFontFactor(densePadding) : 0.0),
child: Material(
color: _searchAwareBackgroundColor(),
child: onPressed != null
? InkWell(
canRequestFocus: false,
key: contentKey,
onTap: onPressed,
child: row,
)
: row,
),
);
return box;
}
void _initSearchListeners() {
if (widget.searchMatchesNotifier != null) {
searchMatches = widget.searchMatchesNotifier!.value;
isSearchMatch = searchMatches.contains(widget.node);
addAutoDisposeListener(widget.searchMatchesNotifier, () {
final isPreviousMatch = searchMatches.contains(widget.node);
searchMatches = widget.searchMatchesNotifier!.value;
final isNewMatch = searchMatches.contains(widget.node);
// We only want to rebuild the row if it the match status has changed.
if (isPreviousMatch != isNewMatch) {
setState(() {
isSearchMatch = isNewMatch;
});
}
});
}
if (widget.activeSearchMatchNotifier != null) {
activeSearchMatch = widget.activeSearchMatchNotifier!.value;
isActiveSearchMatch = activeSearchMatch == widget.node;
addAutoDisposeListener(widget.activeSearchMatchNotifier, () {
final isPreviousActiveSearchMatch = activeSearchMatch == widget.node;
activeSearchMatch = widget.activeSearchMatchNotifier!.value;
final isNewActiveSearchMatch = activeSearchMatch == widget.node;
// We only want to rebuild the row if it the match status has changed.
if (isPreviousActiveSearchMatch != isNewActiveSearchMatch) {
setState(() {
isActiveSearchMatch = isNewActiveSearchMatch;
});
}
});
}
}
Color _searchAwareBackgroundColor() {
final colorScheme = Theme.of(context).colorScheme;
final backgroundColor = widget.backgroundColor ?? colorScheme.surface;
if (widget.isSelected) {
return colorScheme.selectedRowBackgroundColor;
}
final searchAwareBackgroundColor = isSearchMatch
? Color.alphaBlend(
isActiveSearchMatch
? activeSearchMatchColorOpaque
: searchMatchColorOpaque,
backgroundColor,
)
: backgroundColor;
return searchAwareBackgroundColor;
}
Alignment _alignmentFor(ColumnData<T> column) {
switch (column.alignment) {
case ColumnAlignment.center:
return Alignment.center;
case ColumnAlignment.right:
return Alignment.centerRight;
case ColumnAlignment.left:
default:
return Alignment.centerLeft;
}
}
/// Presents the content of this row.
Widget tableRowFor(BuildContext context, {VoidCallback? onPressed}) {
Widget columnFor(ColumnData<T> column, double columnWidth) {
Widget? content;
final theme = Theme.of(context);
final node = widget.node;
if (widget._rowType == _TableRowType.filler) {
content = const SizedBox.shrink();
} else if (widget._rowType == _TableRowType.columnHeader) {
Widget defaultHeaderRenderer() => _ColumnHeader(
column: column,
isSortColumn: column == widget.sortColumn,
secondarySortColumn: widget.secondarySortColumn,
sortDirection: widget.sortDirection!,
onSortChanged: widget.onSortChanged,
);
// ignore: avoid-unrelated-type-assertions, false positive.
if (column is ColumnHeaderRenderer) {
content = (column as ColumnHeaderRenderer)
.buildHeader(context, defaultHeaderRenderer);
}
// If ColumnHeaderRenderer.build returns null, fall back to the default
// rendering.
content ??= defaultHeaderRenderer();
} else if (node != null) {
// TODO(kenz): clean up and pull all this code into _ColumnDataRow
// widget class.
final padding = column.getNodeIndentPx(node);
assert(padding >= 0);
// ignore: avoid-unrelated-type-assertions, false positive.
if (column is ColumnRenderer) {
content = (column as ColumnRenderer).build(
context,
node,
isRowSelected: widget.isSelected,
isRowHovered: isHovering,
onPressed: onPressed,
);
}
// If ColumnRenderer.build returns null, fall back to the default
// rendering.
content ??= Text.rich(
TextSpan(
text: column.getDisplayValue(node),
children: [
if (column.getCaption(node) != null)
TextSpan(
text: ' ${column.getCaption(node)}',
style: const TextStyle(
fontStyle: FontStyle.italic,
),
),
],
style: column.contentTextStyle(
context,
node,
isSelected: widget.isSelected,
),
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: column.contentTextAlignment,
);
final tooltip = column.getTooltip(node);
final richTooltip = column.getRichTooltip(node, context);
if (tooltip.isNotEmpty || richTooltip != null) {
content = DevToolsTooltip(
message: richTooltip == null ? tooltip : null,
richMessage: richTooltip,
waitDuration: tooltipWaitLong,
child: content,
);
}
if (column == widget.expandableColumn) {
final expandIndicator = widget.isExpandable
? ValueListenableBuilder(
valueListenable: expandController,
builder: (context, _, __) {
return RotationTransition(
turns: expandArrowAnimation,
child: Icon(
Icons.expand_more,
color: theme.colorScheme.onSurface,
size: defaultIconSize,
),
);
},
)
: SizedBox(width: defaultIconSize, height: defaultIconSize);
content = Row(
mainAxisSize: MainAxisSize.min,
children: [
expandIndicator,
Expanded(child: content),
],
);
}
content = Padding(
padding: EdgeInsets.only(left: padding),
child: ClipRect(
child: content,
),
);
} else {
throw Exception(
'Expected a non-null node for this table column, but node == null.',
);
}
content = SizedBox(
width: columnWidth,
child: Align(
alignment: _alignmentFor(column),
child: content,
),
);
if (widget.displayTreeGuidelines &&
node != null &&
node is TreeNode &&
column is TreeColumnData) {
content = CustomPaint(
painter: _RowGuidelinePainter(
node.level,
theme.colorScheme,
),
child: content,
);
}
return DefaultTextStyle(
style: theme.regularTextStyle,
child: content,
);
}
if (widget._rowType == _TableRowType.columnGroupHeader) {
final groups = widget.columnGroups!;
return _ColumnGroupHeaderRow(
groups: groups,
columnWidths: widget.columnWidths,
scrollController: scrollController,
);
}
final rowDisplayParts = <_TableRowPartDisplayType>[];
final groups = widget.columnGroups;
if (groups != null && groups.isNotEmpty) {
for (int i = 0; i < groups.length; i++) {
final groupParts = List.generate(
groups[i].range.size as int,
(index) => _TableRowPartDisplayType.column,
).joinWith(_TableRowPartDisplayType.columnSpacer);
rowDisplayParts.addAll(groupParts);
if (i < groups.length - 1) {
rowDisplayParts.add(_TableRowPartDisplayType.columnGroupSpacer);
}
}
} else {
final parts = List.generate(
widget.columns.length,
(_) => _TableRowPartDisplayType.column,
).joinWith(_TableRowPartDisplayType.columnSpacer);
rowDisplayParts.addAll(parts);
}
// Maps the indices from [rowDisplayParts] to the corresponding index of
// each column in [widget.columns].
final columnIndexMap = <int, int>{};
// Add scope to guarantee [columnIndexTracker] is not used outside of this
// block.
{
var columnIndexTracker = 0;
for (int i = 0; i < rowDisplayParts.length; i++) {
final type = rowDisplayParts[i];
if (type == _TableRowPartDisplayType.column) {
columnIndexMap[i] = columnIndexTracker;
columnIndexTracker++;
}
}
}
Widget rowContent = Padding(
padding: const EdgeInsets.symmetric(horizontal: defaultSpacing),
child: ListView.builder(
scrollDirection: Axis.horizontal,
controller: scrollController,
itemCount: widget.columns.length + widget.columns.numSpacers,
itemBuilder: (context, int i) {
final displayTypeForIndex = rowDisplayParts[i];
switch (displayTypeForIndex) {
case _TableRowPartDisplayType.column:
final index = columnIndexMap[i]!;
return columnFor(
widget.columns[index],
widget.columnWidths[index],
);
case _TableRowPartDisplayType.columnSpacer:
return const SizedBox(
width: columnSpacing,
child: VerticalDivider(width: columnSpacing),
);
case _TableRowPartDisplayType.columnGroupSpacer:
return const _ColumnGroupSpacer();
}
},
),
);
if (widget.enableHoverHandling) {
rowContent = MouseRegion(
onEnter: (_) => setState(() => isHovering = true),
onExit: (_) => setState(() => isHovering = false),
child: rowContent,
);
}
if (widget._rowType == _TableRowType.columnHeader) {
return OutlineDecoration.onlyBottom(child: rowContent);
}
return rowContent;
}
@override
bool get isExpanded => widget.isExpanded;
@override
void onExpandChanged(bool expanded) {}
@override
bool shouldShow() => widget.isShown;
}
| devtools/packages/devtools_app/lib/src/shared/table/_table_row.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/table/_table_row.dart",
"repo_id": "devtools",
"token_count": 7337
} | 158 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
import 'dart:async';
import 'dart:math';
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import '../primitives/enum_utils.dart';
import '../primitives/utils.dart';
/// Returns a [TextSpan] that only includes the first [length] characters of
/// [span].
TextSpan truncateTextSpan(TextSpan span, int length) {
int available = length;
TextSpan truncateHelper(TextSpan span) {
var text = span.text;
List<TextSpan>? children;
if (text != null) {
if (text.length > available) {
text = text.substring(0, available);
}
available -= text.length;
}
if (span.children != null) {
children = <TextSpan>[];
for (var child in span.children!) {
if (available <= 0) break;
children.add(truncateHelper(child as TextSpan));
}
if (children.isEmpty) {
children = null;
}
}
return TextSpan(
text: text,
children: children,
style: span.style,
recognizer: span.recognizer,
semanticsLabel: span.semanticsLabel,
);
}
return truncateHelper(span);
}
/// Returns the width in pixels of the [span].
double calculateTextSpanWidth(TextSpan? span) {
final textPainter = TextPainter(
text: span,
textAlign: TextAlign.left,
textDirection: TextDirection.ltr,
)..layout();
return textPainter.width;
}
/// Returns the height in pixels of the [span].
double calculateTextSpanHeight(TextSpan span) {
final textPainter = TextPainter(
text: span,
textAlign: TextAlign.left,
textDirection: TextDirection.ltr,
)..layout();
return textPainter.height;
}
TextSpan? findLongestTextSpan(List<TextSpan> spans) {
int longestLength = 0;
TextSpan? longestSpan;
for (final span in spans) {
final int currentLength = span.toPlainText().length;
if (currentLength > longestLength) {
longestLength = currentLength;
longestSpan = span;
}
}
return longestSpan;
}
/// Scrollbar that is offset by the amount specified by an [offsetController].
///
/// This makes it possible to create a [ListView] with both vertical and
/// horizontal scrollbars by wrapping the [ListView] in a
/// [SingleChildScrollView] that handles horizontal scrolling. The
/// [offsetController] is the offset of the parent [SingleChildScrollView] in
/// this example.
///
/// This class could be optimized if performance was a concern using a
/// [CustomPainter] instead of an [AnimatedBuilder] so that the
/// [OffsetScrollbar] widget does not need to build on each change to the
/// [offsetController].
class OffsetScrollbar extends StatefulWidget {
const OffsetScrollbar({
Key? key,
this.isAlwaysShown = false,
required this.axis,
required this.controller,
required this.offsetController,
required this.child,
required this.offsetControllerViewportDimension,
}) : super(key: key);
final bool isAlwaysShown;
final Axis axis;
final ScrollController controller;
final ScrollController offsetController;
final Widget child;
/// The current viewport dimension of the offsetController may not be
/// available at build time as it is not updated until later so we require
/// that the known correct viewport dimension is passed into this class.
///
/// This is a workaround because we use an AnimatedBuilder to listen for
/// changes to the offsetController rather than displaying the scrollbar at
/// paint time which would be more difficult.
final double offsetControllerViewportDimension;
@override
State<OffsetScrollbar> createState() => _OffsetScrollbarState();
}
class _OffsetScrollbarState extends State<OffsetScrollbar> {
@override
Widget build(BuildContext context) {
if (!widget.offsetController.position.hasContentDimensions) {
SchedulerBinding.instance.addPostFrameCallback((timeStamp) {
if (widget.offsetController.position.hasViewportDimension && mounted) {
// TODO(jacobr): find a cleaner way to be notified that the
// offsetController now has a valid dimension. We would probably
// have to implement our own ScrollbarPainter instead of being able
// to use the existing Scrollbar widget.
setState(() {});
}
});
}
return AnimatedBuilder(
animation: widget.offsetController,
builder: (context, child) {
// Compute a delta to move the scrollbar from where it is by default to
// where it should be given the viewport dimension of the
// offsetController not the viewport that is the entire scroll extent
// of the offsetController because this controller is nested within the
// offset controller.
double delta = 0.0;
if (widget.offsetController.position.hasContentDimensions) {
delta = widget.offsetController.offset -
widget.offsetController.position.maxScrollExtent +
widget.offsetController.position.minScrollExtent;
if (widget.offsetController.position.hasViewportDimension) {
// TODO(jacobr): this is a bit of a hack.
// The viewport dimension from the offsetController may be one frame
// behind the true viewport dimension. We add this delta so the
// scrollbar always appears stuck to the side of the viewport.
delta += widget.offsetControllerViewportDimension -
widget.offsetController.position.viewportDimension;
}
}
final offset = widget.axis == Axis.vertical
? Offset(delta, 0.0)
: Offset(0.0, delta);
return Transform.translate(
offset: offset,
child: Scrollbar(
thumbVisibility: widget.isAlwaysShown,
controller: widget.controller,
child: Transform.translate(
offset: -offset,
child: child,
),
),
);
},
child: widget.child,
);
}
}
/// Scrolls to [position] if [position] is not already visible in the scroll view.
void maybeScrollToPosition(
ScrollController scrollController,
double position,
) {
final extentVisible = Range(
scrollController.offset,
scrollController.offset + scrollController.position.extentInside,
);
if (!extentVisible.contains(position)) {
final positionToScrollTo = max(0.0, position - defaultRowHeight);
unawaited(
scrollController.animateTo(
//TODO (carolynqu): should be positionToScrollTo.clamp(0.0, scrollController.position.maxScrollExtent) but maxScrollExtent is not being updated, https://github.com/flutter/devtools/issues/4264
positionToScrollTo,
duration: defaultDuration,
curve: defaultCurve,
),
);
}
}
class ColorPair {
const ColorPair({required this.background, required this.foreground});
final Color foreground;
final Color background;
}
class ThemedColorPair {
const ThemedColorPair({required this.background, required this.foreground});
factory ThemedColorPair.from(ColorPair colorPair) {
return ThemedColorPair(
foreground: ThemedColor.fromSingle(colorPair.foreground),
background: ThemedColor.fromSingle(colorPair.background),
);
}
final ThemedColor foreground;
final ThemedColor background;
}
/// A theme-dependent color.
///
/// When possible, themed colors should be specified in an extension on
/// [ColorScheme] using the [ColorScheme.isLight] getter. However, this class
/// may be used when access to the [BuildContext] is not available at the time
/// the color needs to be specified.
class ThemedColor {
const ThemedColor({required this.light, required this.dark});
const ThemedColor.fromSingle(Color color)
: light = color,
dark = color;
final Color light;
final Color dark;
Color colorFor(ColorScheme colorScheme) {
return colorScheme.isLight ? light : dark;
}
}
enum MediaSize with EnumIndexOrdering {
xxs,
xs,
s,
m,
l,
xl,
}
class ScreenSize {
ScreenSize(BuildContext context) {
_height = _calculateHeight(context);
_width = _calculateWidth(context);
}
MediaSize get height => _height;
MediaSize get width => _width;
late MediaSize _height;
late MediaSize _width;
MediaSize _calculateWidth(BuildContext context) {
final width = MediaQuery.of(context).size.width;
if (width < 300) return MediaSize.xxs;
if (width < 600) return MediaSize.xs;
if (width < 900) return MediaSize.s;
if (width < 1200) return MediaSize.m;
if (width < 1500) return MediaSize.l;
return MediaSize.xl;
}
MediaSize _calculateHeight(BuildContext context) {
final height = MediaQuery.of(context).size.height;
if (height < 300) return MediaSize.xxs;
if (height < 450) return MediaSize.xs;
if (height < 600) return MediaSize.s;
if (height < 750) return MediaSize.m;
if (height < 900) return MediaSize.l;
return MediaSize.xl;
}
}
| devtools/packages/devtools_app/lib/src/shared/ui/utils.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/ui/utils.dart",
"repo_id": "devtools",
"token_count": 3163
} | 159 |
If macos configuration needs to be regenerated, after regeneration
apply updates to avoide bug like
https://github.com/flutter/devtools/issues/5189
1. Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
set `buildConfiguration` to `Release`
2. Runner/DebugProfile.entitlements,
Runner/Release.entitlements:
set `com.apple.security.app-sandbox` to false.
| devtools/packages/devtools_app/macos/README.md/0 | {
"file_path": "devtools/packages/devtools_app/macos/README.md",
"repo_id": "devtools",
"token_count": 117
} | 160 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/screens/app_size/code_size_attribution.dart';
import 'package:devtools_app/src/shared/table/table.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:vm_snapshot_analysis/precompiler_trace.dart';
import 'package:vm_snapshot_analysis/program_info.dart';
import '../test_infra/test_data/app_size/precompiler_trace.dart';
void main() {
late CallGraph callGraph;
setUp(() {
setGlobal(ServiceConnectionManager, FakeServiceConnectionManager());
setGlobal(
DevToolsEnvironmentParameters,
ExternalDevToolsEnvironmentParameters(),
);
setGlobal(PreferencesController, PreferencesController());
setGlobal(IdeTheme, IdeTheme());
callGraph = generateCallGraphWithDominators(
precompilerTrace,
NodeType.packageNode,
);
});
group('CallGraphWithDominators', () {
late CallGraphWithDominators callGraphWithDominators;
setUp(() {
callGraphWithDominators = CallGraphWithDominators(
callGraphRoot: callGraph.root,
);
});
testWidgets(
'builds dominator tree by default',
(WidgetTester tester) async {
await tester.pumpWidget(wrap(callGraphWithDominators));
expect(find.text('Dominator Tree'), findsOneWidget);
expect(find.text('Call Graph'), findsNothing);
expect(find.byType(DominatorTree), findsOneWidget);
expect(find.byType(CallGraphView), findsNothing);
},
);
testWidgets('builds call graph', (WidgetTester tester) async {
await tester.pumpWidget(wrap(callGraphWithDominators));
await tester.tap(find.byType(Switch));
await tester.pumpAndSettle();
expect(find.text('Dominator Tree'), findsNothing);
expect(find.text('Call Graph'), findsOneWidget);
expect(find.byType(DominatorTree), findsNothing);
expect(find.byType(CallGraphView), findsOneWidget);
});
testWidgets('can switch views', (WidgetTester tester) async {
await tester.pumpWidget(wrap(callGraphWithDominators));
expect(find.text('Dominator Tree'), findsOneWidget);
expect(find.text('Call Graph'), findsNothing);
expect(find.byType(DominatorTree), findsOneWidget);
expect(find.byType(CallGraphView), findsNothing);
await tester.tap(find.byType(Switch));
await tester.pumpAndSettle();
expect(find.text('Dominator Tree'), findsNothing);
expect(find.text('Call Graph'), findsOneWidget);
expect(find.byType(DominatorTree), findsNothing);
expect(find.byType(CallGraphView), findsOneWidget);
});
});
group('CallGraphView', () {
late CallGraphView callGraphView;
setUp(() {
callGraphView = CallGraphView(node: callGraph.root);
});
testWidgets('builds content for root', (WidgetTester tester) async {
await tester.pumpWidget(wrap(callGraphView));
expect(find.byType(FlatTable<CallGraphNode>), findsNWidgets(2));
expect(find.text('From'), findsOneWidget);
expect(find.text('To'), findsOneWidget);
final fromTable = find
.byType(FlatTable<CallGraphNode>)
.evaluate()
.first
.widget as FlatTable;
expect(fromTable.data, isEmpty);
final toTable = find
.byType(FlatTable<CallGraphNode>)
.evaluate()
.last
.widget as FlatTable;
expect(toTable.data.length, equals(17));
});
testWidgets('re-roots on selection', (WidgetTester tester) async {
await tester.pumpWidget(wrap(callGraphView));
expect(find.byType(FlatTable<CallGraphNode>), findsNWidgets(2));
expect(find.text('From'), findsOneWidget);
expect(find.text('To'), findsOneWidget);
var fromTable = find
.byType(FlatTable<CallGraphNode>)
.evaluate()
.first
.widget as FlatTable;
expect(fromTable.data, isEmpty);
var toTable = find.byType(FlatTable<CallGraphNode>).evaluate().last.widget
as FlatTable;
expect(toTable.data.length, equals(17));
// Tap to re-root call graph.
await tester.tap(find.richText('dart:math'));
await tester.pumpAndSettle();
fromTable = find.byType(FlatTable<CallGraphNode>).evaluate().first.widget
as FlatTable;
expect(fromTable.data.length, equals(3));
toTable = find.byType(FlatTable<CallGraphNode>).evaluate().last.widget
as FlatTable;
expect(toTable.data.length, equals(1));
});
});
group('DominatorTree', () {
late DominatorTree dominatorTree;
setUp(() {
dominatorTree = DominatorTree(
dominatorTreeRoot: DominatorTreeNode.from(callGraph.root.dominatorRoot),
selectedNode: callGraph.root,
);
});
testWidgets('builds content for root', (WidgetTester tester) async {
await tester.pumpWidget(wrap(dominatorTree));
expect(find.byKey(DominatorTree.dominatorTreeTableKey), findsOneWidget);
expect(find.text('Package'), findsOneWidget);
final treeTable = find
.byKey(DominatorTree.dominatorTreeTableKey)
.evaluate()
.first
.widget as TreeTable;
expect(treeTable.dataRoots.length, equals(1));
final root = treeTable.dataRoots.first;
expect(root.isExpanded, isTrue);
expect(root.children.length, equals(18));
for (DominatorTreeNode child in root.children.cast<DominatorTreeNode>()) {
expect(child.isExpanded, isFalse);
}
});
testWidgets('expands tree to selected node', (WidgetTester tester) async {
dominatorTree = DominatorTree(
dominatorTreeRoot: DominatorTreeNode.from(callGraph.root.dominatorRoot),
selectedNode: callGraph.root.dominated
.firstWhere((node) => node.display == 'package:code_size_package'),
);
await tester.pumpWidget(wrap(dominatorTree));
final treeTable = find
.byKey(DominatorTree.dominatorTreeTableKey)
.evaluate()
.first
.widget as TreeTable;
final root = treeTable.dataRoots.first;
expect(root.isExpanded, isTrue);
expect(root.children.length, equals(18));
// Only the selected node should be expanded.
for (DominatorTreeNode child in root.children.cast<DominatorTreeNode>()) {
expect(
child.isExpanded,
child.callGraphNode.display == 'package:code_size_package',
);
}
// The selected node's children should not be expanded.
final selectedNode = root.children.first as DominatorTreeNode;
expect(
selectedNode.callGraphNode.display,
equals('package:code_size_package'),
);
expect(selectedNode.children.length, equals(3));
for (DominatorTreeNode child in selectedNode.children) {
expect(child.isExpanded, isFalse);
}
});
});
}
| devtools/packages/devtools_app/test/app_size/code_size_attribution_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/app_size/code_size_attribution_test.dart",
"repo_id": "devtools",
"token_count": 2821
} | 161 |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/shared/console/eval/auto_complete.dart';
import 'package:devtools_app_shared/service.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter_test/flutter_test.dart';
import '../test_infra/flutter_test_driver.dart';
import '../test_infra/flutter_test_environment.dart';
import '../test_infra/flutter_test_storage.dart';
void main() {
setGlobal(Storage, FlutterTestStorage());
final FlutterTestEnvironment env = FlutterTestEnvironment(
const FlutterRunConfiguration(withDebugger: true),
);
late Disposable isAlive;
late DebuggerController debuggerController;
late EvalOnDartLibrary eval;
setUp(() async {
setGlobal(
DevToolsEnvironmentParameters,
ExternalDevToolsEnvironmentParameters(),
);
setGlobal(BreakpointManager, BreakpointManager());
setGlobal(EvalService, EvalService());
setGlobal(NotificationService, NotificationService());
isAlive = Disposable();
await env.setupEnvironment();
debuggerController = DebuggerController();
eval = EvalOnDartLibrary(
'package:flutter_app/src/autocomplete.dart',
serviceConnection.serviceManager.service!,
serviceManager: serviceConnection.serviceManager,
disableBreakpoints: false,
);
});
tearDown(() async {
await debuggerController.resume();
isAlive.dispose();
debuggerController.dispose();
await env.tearDownEnvironment();
});
tearDownAll(() async {
await env.tearDownEnvironment(force: true);
});
Future<void> runMethodAndWaitForPause(String method) async {
unawaited(eval.eval(method, isAlive: isAlive));
await whenMatches(debuggerController.selectedStackFrame, (f) => f != null);
}
group(
'EvalOnDartLibrary',
() {
test(
'returns scoped variables when EditingParts is not a field',
() async {
await runMethodAndWaitForPause(
'AnotherClass().pauseWithScopedVariablesMethod()',
);
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: 'foo',
leftSide: '',
rightSide: '',
),
evalService,
),
equals(['foo', 'foobar']),
);
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: 'b',
leftSide: '',
rightSide: '',
),
evalService,
),
equals(['bar', 'baz']),
);
},
timeout: const Timeout.factor(8),
);
test(
'returns filtered members when EditingParts is a field ',
() async {
await runMethodAndWaitForPause(
'AnotherClass().pauseWithScopedVariablesMethod()',
);
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: 'f',
leftSide: 'foo.',
rightSide: '',
),
evalService,
),
equals(['field1', 'field2', 'func1', 'func2']),
);
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: 'fu',
leftSide: 'foo.',
rightSide: '',
),
evalService,
),
equals(['func1', 'func2']),
);
},
timeout: const Timeout.factor(8),
);
test(
'returns filtered members when EditingParts is a class name ',
() async {
await runMethodAndWaitForPause(
'AnotherClass().pauseWithScopedVariablesMethod()',
);
expect(
await autoCompleteResultsFor(
EditingParts(
leftSide: 'FooClass.',
activeWord: '',
rightSide: '',
),
evalService,
),
equals([
'staticField1',
'staticField2',
'namedConstructor',
'factory1',
'staticMethod',
]),
);
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: 'fa',
leftSide: 'FooClass.',
rightSide: '',
),
evalService,
),
equals(['factory1']),
);
},
timeout: const Timeout.factor(8),
);
test(
'returns privates only from library',
// TODO(https://github.com/flutter/devtools/issues/7099): unskip once
// this test flake is fixed.
skip: true,
() async {
await runMethodAndWaitForPause(
'AnotherClass().pauseWithScopedVariablesMethod()',
);
await expectLater(
autoCompleteResultsFor(
EditingParts(
activeWord: '_',
leftSide: '',
rightSide: '',
),
evalService,
),
completion(
unorderedEquals(
[
'_privateField2',
'_privateField1',
'_PrivateClass',
],
),
),
);
},
timeout: const Timeout.factor(8),
);
test(
'returns exported members from import',
() async {
await runMethodAndWaitForPause(
'AnotherClass().pauseWithScopedVariablesMethod()',
);
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: 'exportedField',
leftSide: '',
rightSide: '',
),
evalService,
),
equals([
'exportedField',
]),
);
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: 'ExportedClass',
leftSide: '',
rightSide: '',
),
evalService,
),
equals([
'ExportedClass',
]),
);
// Privates are not exported
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: '_privateExportedField',
leftSide: '',
rightSide: '',
),
evalService,
),
equals([]),
);
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: '_PrivateExportedClass',
leftSide: '',
rightSide: '',
),
evalService,
),
equals([]),
);
},
timeout: const Timeout.factor(8),
);
test(
'returns prefixes of libraries imported',
() async {
await runMethodAndWaitForPause(
'AnotherClass().pauseWithScopedVariablesMethod()',
);
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: 'developer',
leftSide: '',
rightSide: '',
),
evalService,
),
equals([
'developer',
]),
);
expect(
await autoCompleteResultsFor(
EditingParts(
activeWord: 'math',
leftSide: '',
rightSide: '',
),
evalService,
),
equals([
'math',
]),
);
},
timeout: const Timeout.factor(8),
);
test(
'returns no operators for int',
() async {
await runMethodAndWaitForPause(
'AnotherClass().pauseWithScopedVariablesMethod()',
);
expect(
await autoCompleteResultsFor(
EditingParts(
leftSide: '7.',
activeWord: '',
rightSide: '',
),
evalService,
),
equals(
[
'hashCode',
'bitLength',
'toString',
'remainder',
'abs',
'sign',
'isEven',
'isOdd',
'isNaN',
'isNegative',
'isInfinite',
'isFinite',
'toUnsigned',
'toSigned',
'compareTo',
'round',
'floor',
'ceil',
'truncate',
'roundToDouble',
'floorToDouble',
'ceilToDouble',
'truncateToDouble',
'clamp',
'toInt',
'toDouble',
'toStringAsFixed',
'toStringAsExponential',
'toStringAsPrecision',
'toRadixString',
'modPow',
'modInverse',
'gcd',
'noSuchMethod',
'runtimeType',
],
),
);
},
timeout: const Timeout.factor(8),
);
},
);
}
| devtools/packages/devtools_app/test/debugger/debugger_evaluation_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/debugger/debugger_evaluation_test.dart",
"repo_id": "devtools",
"token_count": 5411
} | 162 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/shared/console/widgets/expandable_variable.dart';
import 'package:devtools_app/src/shared/diagnostics/dart_object_node.dart';
import 'package:devtools_app/src/shared/tree.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
setUp(() {
final service = createMockVmServiceWrapperWithDefaults();
final manager = FakeServiceConnectionManager(service: service);
setGlobal(ServiceConnectionManager, manager);
});
group('debugger variables', () {
late DartObjectNode objectNode;
setUp(() {
setGlobal(IdeTheme, IdeTheme());
objectNode = DartObjectNode.text('test node');
});
Future<void> pumpExpandableVariable(
WidgetTester tester,
DartObjectNode? variable,
) async {
await tester.pumpWidget(
wrap(
ExpandableVariable(
variable: variable,
),
),
);
await tester.pumpAndSettle();
expect(find.byType(ExpandableVariable), findsOneWidget);
}
testWidgets(
'ExpandableVariable builds without error',
(WidgetTester tester) async {
await pumpExpandableVariable(tester, objectNode);
expect(find.byType(TreeView<DartObjectNode>), findsOneWidget);
expect(
find.byKey(ExpandableVariable.emptyExpandableVariableKey),
findsNothing,
);
},
);
testWidgets(
'ExpandableVariable builds for null variable',
(WidgetTester tester) async {
await pumpExpandableVariable(tester, null);
expect(find.byType(TreeView<DartObjectNode>), findsNothing);
expect(
find.byKey(ExpandableVariable.emptyExpandableVariableKey),
findsOneWidget,
);
},
);
});
}
| devtools/packages/devtools_app/test/debugger/variables_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/debugger/variables_test.dart",
"repo_id": "devtools",
"token_count": 845
} | 163 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_shared/devtools_test_utils.dart';
import 'package:flutter_test/flutter_test.dart';
import 'integration.dart';
void loggingTests() {
late CliAppFixture appFixture;
late BrowserTabInstance tabInstance;
setUp(() async {
appFixture =
await CliAppFixture.create('test/test_infra/fixtures/logging_app.dart');
tabInstance = await browserManager.createNewTab();
});
tearDown(() async {
await tabInstance.close();
await appFixture.teardown();
});
test('displays log data', () async {
final DevtoolsManager tools =
DevtoolsManager(tabInstance, webBuildFixture.baseUri);
await tools.start(appFixture);
await tools.switchPage('logging');
final String? currentPageId = await tools.currentPageId();
expect(currentPageId, 'logging');
// Cause app to log.
final LoggingManager logs = LoggingManager(tools);
await logs.clearLogs();
expect(await logs.logCount(), 0);
await appFixture.invoke('controller.emitLog()');
// Verify the log data shows up in the UI.
await waitFor(() async => (await logs.logCount()) > 0);
expect(await logs.logCount(), greaterThan(0));
});
test('log screen postpones write when offscreen', () async {
final DevtoolsManager tools =
DevtoolsManager(tabInstance, webBuildFixture.baseUri);
await tools.start(appFixture);
await tools.switchPage('logging');
final String? currentPageId = await tools.currentPageId();
expect(currentPageId, 'logging');
final LoggingManager logs = LoggingManager(tools);
// Verify that the log is empty.
expect(await logs.logCount(), 0);
// Switch to a different page.
await tools.switchPage('performance');
// Cause app to log.
await appFixture.invoke('controller.emitLog()');
// Verify that the log is empty.
expect(await logs.logCount(), 0);
// Switch to the logs page.
await tools.switchPage('logging');
// Verify the log data shows up in the UI.
await waitFor(() async => (await logs.logCount()) > 0);
expect(await logs.logCount(), greaterThan(0));
});
}
class LoggingManager {
LoggingManager(this.tools);
final DevtoolsManager tools;
Future<void> clearLogs() async {
await tools.tabInstance.send('logging.clearLogs');
}
Future<int> logCount() async {
final AppResponse response =
await tools.tabInstance.send('logging.logCount');
return response.result as int;
}
}
| devtools/packages/devtools_app/test/legacy_integration_tests/logging.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/legacy_integration_tests/logging.dart",
"repo_id": "devtools",
"token_count": 886
} | 164 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/src/screens/memory/shared/heap/class_filter.dart';
import 'package:devtools_app/src/shared/memory/class_name.dart';
import 'package:flutter_test/flutter_test.dart';
final _class1 =
HeapClassName.fromPath(className: 'class1', library: 'library1');
final _class2 =
HeapClassName.fromPath(className: 'class2', library: 'library2');
final _class3 =
HeapClassName.fromPath(className: 'class3', library: 'library3');
final _class4 =
HeapClassName.fromPath(className: 'class4', library: 'library4');
final _data = <HeapClassName>[_class1, _class2, _class3, _class4];
void main() {
test('$ClassFilter parses filters.', () {
final filter = ClassFilter(
filterType: ClassFilterType.except,
except: 'f1, f2 \n f3 ',
only: '',
);
expect(filter.filters, {'f1', 'f2', 'f3'});
});
test('$ClassFilter.filter filters.', () {
final filter = ClassFilter(
filterType: ClassFilterType.except,
except: 'class1, library2, library3/class3',
only: '',
);
final result = ClassFilter.filter(
oldFilter: null,
newFilter: filter,
oldFiltered: null,
original: _data,
extractClass: (c) => c,
rootPackage: null,
);
expect(result, [_class4]);
});
}
| devtools/packages/devtools_app/test/memory/shared/heap/class_filter_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/memory/shared/heap/class_filter_test.dart",
"repo_id": "devtools",
"token_count": 553
} | 165 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn('vm')
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/shared/ui/colors.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../test_infra/test_data/performance/sample_performance_data.dart';
void main() {
late FlutterFramesController framesController;
Future<void> pumpChart(
WidgetTester tester, {
bool offlineMode = false,
bool impellerEnabled = false,
}) async {
await tester.pumpWidget(
wrap(
FlutterFramesChart(
framesController,
offlineMode: offlineMode,
impellerEnabled: impellerEnabled,
),
),
);
await tester.pumpAndSettle();
expect(find.byType(FlutterFramesChart), findsOneWidget);
}
group('FlutterFramesChart', () {
setUp(() {
final fakeServiceConnection = FakeServiceConnectionManager();
mockConnectedApp(
fakeServiceConnection.serviceManager.connectedApp!,
isFlutterApp: true,
isProfileBuild: true,
isWebApp: false,
);
setGlobal(ServiceConnectionManager, fakeServiceConnection);
setGlobal(OfflineModeController, OfflineModeController());
setGlobal(IdeTheme, IdeTheme());
setGlobal(NotificationService, NotificationService());
setGlobal(BannerMessagesController, BannerMessagesController());
setGlobal(
DevToolsEnvironmentParameters,
ExternalDevToolsEnvironmentParameters(),
);
setGlobal(PreferencesController, PreferencesController());
framesController = FlutterFramesController(
createMockPerformanceControllerWithDefaults(),
);
// This flag should never be turned on in production.
expect(debugFrames, isFalse);
});
testWidgets('builds with no frames', (WidgetTester tester) async {
framesController.clearData();
await pumpChart(tester);
expect(find.byType(FramesChart), findsOneWidget);
expect(find.byType(FramesChartControls), findsOneWidget);
expect(find.byType(PauseResumeButtonGroup), findsOneWidget);
expect(find.byType(Legend), findsOneWidget);
expect(find.byType(AverageFPS), findsOneWidget);
expect(find.byType(FlutterFramesChartItem), findsNothing);
expect(find.textContaining('Engine: Skia'), findsOneWidget);
});
testWidgets(
'builds nothing when visibility is false',
(WidgetTester tester) async {
framesController
..addFrame(testFrame0)
..addFrame(testFrame1)
..toggleShowFlutterFrames(false);
await pumpChart(tester);
expect(find.byType(FramesChart), findsNothing);
expect(find.byType(FramesChartControls), findsNothing);
expect(find.byType(Legend), findsNothing);
expect(find.byType(AverageFPS), findsNothing);
expect(find.byType(FlutterFramesChartItem), findsNothing);
expect(find.textContaining('Engine:'), findsNothing);
},
);
testWidgets('builds with frames', (WidgetTester tester) async {
framesController
..addFrame(testFrame0)
..addFrame(testFrame1);
await pumpChart(tester);
expect(find.byType(FramesChart), findsOneWidget);
expect(find.byType(FramesChartControls), findsOneWidget);
expect(find.byType(Legend), findsOneWidget);
expect(find.byType(AverageFPS), findsOneWidget);
expect(find.byType(FlutterFramesChartItem), findsNWidgets(2));
expect(find.textContaining('Engine: Skia'), findsOneWidget);
});
testWidgets('builds in offline mode', (WidgetTester tester) async {
framesController.clearData();
await pumpChart(tester, offlineMode: true);
expect(find.byType(FramesChart), findsOneWidget);
expect(find.byType(FramesChartControls), findsOneWidget);
expect(find.byType(PauseResumeButtonGroup), findsNothing);
expect(find.byType(Legend), findsOneWidget);
expect(find.byType(AverageFPS), findsOneWidget);
expect(find.textContaining('Engine: Skia'), findsOneWidget);
});
testWidgets('builds with impeller enabled', (WidgetTester tester) async {
framesController.clearData();
await pumpChart(tester, impellerEnabled: true);
expect(find.byType(FramesChart), findsOneWidget);
expect(find.byType(FramesChartControls), findsOneWidget);
expect(find.byType(PauseResumeButtonGroup), findsOneWidget);
expect(find.byType(Legend), findsOneWidget);
expect(find.byType(AverageFPS), findsOneWidget);
expect(find.textContaining('Engine: Impeller'), findsOneWidget);
});
group('starting scroll position', () {
const totalNumFrames = 50;
const totalFramesInView = 15;
setUp(() {
var number = 0;
var startTime = 10000;
var elapsedTime = 20000;
var buildTime = 10000;
var rasterTime = 12000;
for (var i = 0; i < totalNumFrames; i++) {
framesController.addFrame(
FlutterFrame.parse({
'number': number++,
'startTime': startTime += 50000,
'elapsed': elapsedTime += 50000,
'build': buildTime += 50000,
'raster': rasterTime += 50000,
'vsyncOverhead': 10,
}),
);
}
});
void verifyScrollOffset(WidgetTester tester, double expectedOffset) {
final Scrollbar scrollbar =
tester.widget<Scrollbar>(find.byType(Scrollbar));
final scrollController = scrollbar.controller!;
expect(scrollController.offset, equals(expectedOffset));
}
testWidgets('is zero for no selected frame', (WidgetTester tester) async {
expect(framesController.selectedFrame.value, isNull);
await pumpChart(tester);
expect(find.byType(FramesChart), findsOneWidget);
expect(
find.byType(FlutterFramesChartItem),
findsNWidgets(totalFramesInView),
);
verifyScrollOffset(tester, 0.0);
});
testWidgets('is offset for selected frame', (WidgetTester tester) async {
const indexOutOfView = totalNumFrames ~/ 2;
expect(
const Range(0, totalFramesInView).contains(indexOutOfView),
isFalse,
);
framesController.handleSelectedFrame(
// Select a frame that is out of view (we know from the previous )
framesController.flutterFrames.value[indexOutOfView],
);
expect(framesController.selectedFrame.value, isNotNull);
await pumpChart(tester);
expect(find.byType(FramesChart), findsOneWidget);
expect(
find.byType(FlutterFramesChartItem),
findsNWidgets(totalFramesInView),
);
verifyScrollOffset(tester, 648.0);
});
});
testWidgets('builds with janky frame', (WidgetTester tester) async {
framesController.addFrame(jankyFrame);
await pumpChart(tester);
expect(find.byType(FlutterFramesChartItem), findsOneWidget);
final ui =
tester.widget(find.byKey(const Key('frame 2 - ui'))) as Container;
expect(ui.color, equals(uiJankColor));
final raster =
tester.widget(find.byKey(const Key('frame 2 - raster'))) as Container;
expect(raster.color, equals(rasterJankColor));
});
testWidgets('builds with janky frame ui only', (WidgetTester tester) async {
framesController.addFrame(jankyFrameUiOnly);
await pumpChart(tester);
expect(find.byType(FlutterFramesChartItem), findsOneWidget);
final ui =
tester.widget(find.byKey(const Key('frame 3 - ui'))) as Container;
expect(ui.color, equals(uiJankColor));
final raster =
tester.widget(find.byKey(const Key('frame 3 - raster'))) as Container;
expect(raster.color, equals(mainRasterColor));
});
testWidgets(
'builds with janky frame raster only',
(WidgetTester tester) async {
framesController.addFrame(jankyFrameRasterOnly);
await pumpChart(tester);
expect(find.byType(FlutterFramesChartItem), findsOneWidget);
final ui =
tester.widget(find.byKey(const Key('frame 4 - ui'))) as Container;
expect(ui.color, equals(mainUiColor));
final raster = tester.widget(find.byKey(const Key('frame 4 - raster')))
as Container;
expect(raster.color, equals(rasterJankColor));
},
);
testWidgets(
'builds with janky frame with shader jank',
(WidgetTester tester) async {
framesController.addFrame(testFrameWithShaderJank);
await pumpChart(tester);
expect(find.byType(FlutterFramesChartItem), findsOneWidget);
final ui =
tester.widget(find.byKey(const Key('frame 5 - ui'))) as Container;
expect(ui.color, equals(uiJankColor));
final raster = tester.widget(find.byKey(const Key('frame 5 - raster')))
as Container;
expect(raster.color, equals(rasterJankColor));
final shaders = tester
.widget(find.byKey(const Key('frame 5 - shaders'))) as Container;
expect(shaders.color, equals(shaderCompilationColor.background));
expect(find.byType(ShaderJankWarningIcon), findsOneWidget);
},
);
testWidgets(
'builds with janky frame with subtle shader jank',
(WidgetTester tester) async {
framesController.addFrame(testFrameWithSubtleShaderJank);
await pumpChart(tester);
expect(find.byType(FlutterFramesChartItem), findsOneWidget);
final ui =
tester.widget(find.byKey(const Key('frame 6 - ui'))) as Container;
expect(ui.color, equals(uiJankColor));
final raster = tester.widget(find.byKey(const Key('frame 6 - raster')))
as Container;
expect(raster.color, equals(rasterJankColor));
final shaders = tester
.widget(find.byKey(const Key('frame 6 - shaders'))) as Container;
expect(shaders.color, equals(shaderCompilationColor.background));
expect(find.byType(ShaderJankWarningIcon), findsNothing);
},
);
testWidgets(
'can pause and resume frame recording from controls',
(WidgetTester tester) async {
await pumpChart(tester);
expect(find.byIcon(Icons.pause), findsOneWidget);
expect(find.byIcon(Icons.play_arrow), findsOneWidget);
expect(framesController.recordingFrames.value, isTrue);
await tester.tap(find.byIcon(Icons.pause));
await tester.pumpAndSettle();
expect(framesController.recordingFrames.value, isFalse);
await tester.tap(find.byIcon(Icons.play_arrow));
await tester.pumpAndSettle();
expect(framesController.recordingFrames.value, isTrue);
},
);
});
group('FlutterFramesChartItem', () {
testWidgets('builds for selected frame', (WidgetTester tester) async {
setGlobal(IdeTheme, IdeTheme());
await tester.pumpWidget(
// FlutterFramesChartItem needs to be wrapped in Material,
// Directionality, and Overlay in order to pump the widget and test.
wrap(
Overlay(
initialEntries: [
OverlayEntry(
builder: (context) {
return FlutterFramesChartItem(
index: 0,
framesController:
createMockPerformanceControllerWithDefaults()
.flutterFramesController,
frame: testFrame0,
selected: true,
msPerPx: 1,
availableChartHeight: 100.0,
displayRefreshRate: defaultRefreshRate,
);
},
),
],
),
),
);
expect(
find.byKey(FlutterFramesChartItem.selectedFrameIndicatorKey),
findsOneWidget,
);
});
});
}
| devtools/packages/devtools_app/test/performance/flutter_frames/flutter_frames_chart_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/performance/flutter_frames/flutter_frames_chart_test.dart",
"repo_id": "devtools",
"token_count": 5042
} | 166 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import '../../test_infra/test_data/performance/sample_performance_data.dart';
// TODO(kenz): add better test coverage for [TimelineEventsController].
void main() {
late MockPerformanceController performanceController;
final ServiceConnectionManager fakeServiceManager =
FakeServiceConnectionManager(
service: FakeServiceManager.createFakeService(
timelineData: perfettoVmTimeline,
),
);
group('$TimelineEventsController', () {
late TimelineEventsController eventsController;
setUp(() {
when(fakeServiceManager.serviceManager.connectedApp!.isProfileBuild)
.thenAnswer((realInvocation) => Future.value(false));
final initializedCompleter = Completer<bool>();
initializedCompleter.complete(true);
when(fakeServiceManager.serviceManager.connectedApp!.initialized)
.thenReturn(initializedCompleter);
setGlobal(ServiceConnectionManager, fakeServiceManager);
setGlobal(IdeTheme, IdeTheme());
setGlobal(OfflineModeController, OfflineModeController());
performanceController = createMockPerformanceControllerWithDefaults();
eventsController = TimelineEventsController(performanceController);
final flutterFramesController = MockFlutterFramesController();
when(performanceController.timelineEventsController)
.thenReturn(eventsController);
when(performanceController.flutterFramesController)
.thenReturn(flutterFramesController);
when(flutterFramesController.hasUnassignedFlutterFrame(any))
.thenReturn(false);
});
test('can setOfflineData', () async {
// Ensure we are starting in an empty state.
expect(eventsController.fullPerfettoTrace, isNull);
expect(eventsController.perfettoController.processor.uiTrackId, isNull);
expect(
eventsController.perfettoController.processor.rasterTrackId,
isNull,
);
offlineController.enterOfflineMode(
offlineApp: serviceConnection.serviceManager.connectedApp!,
);
final offlineData = OfflinePerformanceData.parse(rawPerformanceData);
when(performanceController.offlinePerformanceData)
.thenReturn(offlineData);
await eventsController.setOfflineData(offlineData);
expect(eventsController.fullPerfettoTrace, isNotNull);
expect(
eventsController.perfettoController.processor.uiTrackId,
equals(testUiTrackId),
);
expect(
eventsController.perfettoController.processor.rasterTrackId,
equals(testRasterTrackId),
);
});
});
}
| devtools/packages/devtools_app/test/performance/timeline_events/timeline_events_controller_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/performance/timeline_events/timeline_events_controller_test.dart",
"repo_id": "devtools",
"token_count": 1018
} | 167 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/shared/editable_list.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import '../test_infra/utils/test_utils.dart';
void main() {
const windowSize = Size(1000.0, 1000.0);
const label = 'This is the EditableList label';
ListValueNotifier<String> entries([
List<String> values = const <String>[],
]) {
return ListValueNotifier<String>(values);
}
setGlobal(IdeTheme, getIdeTheme());
setGlobal(NotificationService, NotificationService());
group('EditableList', () {
testWidgetsWithWindowSize(
'shows the label',
windowSize,
(WidgetTester tester) async {
await tester.pumpWidget(
wrapSimple(
EditableList(
entries: entries([]),
textFieldLabel: label,
gaRefreshSelection: '',
gaScreen: '',
),
),
);
expect(find.text(label), findsOneWidget);
},
);
testWidgetsWithWindowSize(
'triggers add',
windowSize,
(WidgetTester tester) async {
const valueToAdd = 'this is the value that will be added';
String? entryThatWasRequestedForAdd;
final widget = EditableList(
entries: entries(),
textFieldLabel: label,
onEntryAdded: (e) {
entryThatWasRequestedForAdd = e;
},
gaRefreshSelection: '',
gaScreen: '',
);
await tester.pumpWidget(
wrapSimple(widget),
);
final actionBar = find.byType(EditableListActionBar);
final textField = find.descendant(
of: actionBar,
matching: find.byType(TextField),
);
final addEntryButton = find.descendant(
of: actionBar,
matching: find.text('Add'),
);
await tester.enterText(textField, valueToAdd);
await tester.tap(addEntryButton);
await tester.pump();
expect(entryThatWasRequestedForAdd, equals(valueToAdd));
},
);
testWidgetsWithWindowSize(
'triggers refresh',
windowSize,
(WidgetTester tester) async {
var refreshWasCalled = false;
final widget = EditableList(
entries: entries(),
textFieldLabel: label,
onRefreshTriggered: () {
refreshWasCalled = true;
},
gaRefreshSelection: '',
gaScreen: '',
);
await tester.pumpWidget(
wrapSimple(widget),
);
final refreshButton = find.byType(RefreshButton);
await tester.tap(refreshButton);
await tester.pump();
expect(refreshWasCalled, isTrue);
},
);
testWidgetsWithWindowSize(
'triggers remove',
windowSize,
(WidgetTester tester) async {
const valueToRemove = 'this is the value that will be removed';
String? entryThatWasRemoved;
final widget = EditableList(
entries: entries([valueToRemove]),
textFieldLabel: label,
onEntryRemoved: (e) {
entryThatWasRemoved = e;
},
gaRefreshSelection: '',
gaScreen: '',
);
await tester.pumpWidget(
wrapSimple(widget),
);
final removeButton = find.byType(EditableListRemoveDirectoryButton);
await tester.tap(removeButton);
await tester.pump();
expect(entryThatWasRemoved, equals(valueToRemove));
},
);
testWidgetsWithWindowSize(
'copies an entry',
windowSize,
(WidgetTester tester) async {
String? clipboardContents;
setupClipboardCopyListener(
clipboardContentsCallback: (contents) {
clipboardContents = contents ?? '';
},
);
const valueToCopy = 'this is the value that will be copied';
final widget = EditableList(
entries: entries([valueToCopy]),
textFieldLabel: label,
gaRefreshSelection: '',
gaScreen: '',
);
await tester.pumpWidget(
wrapSimple(widget),
);
final copyButton = find.byType(EditableListCopyDirectoryButton);
await tester.tap(copyButton);
await tester.pump();
expect(clipboardContents, equals(valueToCopy));
},
);
group('defaults', () {
testWidgetsWithWindowSize(
'performs the default add when none provided',
windowSize,
(WidgetTester tester) async {
const valueToAdd = 'this is the value that will be added';
final entryList = entries();
final widget = EditableList(
entries: entryList,
textFieldLabel: label,
gaRefreshSelection: '',
gaScreen: '',
);
await tester.pumpWidget(
wrapSimple(widget),
);
final actionBar = find.byType(EditableListActionBar);
final textField = find.descendant(
of: actionBar,
matching: find.byType(TextField),
);
final addEntryButton = find.descendant(
of: actionBar,
matching: find.text('Add'),
);
await tester.enterText(textField, valueToAdd);
await tester.tap(addEntryButton);
await tester.pump();
expect(entryList.value, contains(valueToAdd));
},
);
testWidgetsWithWindowSize(
'performs the default remove when no remove callback provided',
windowSize,
(WidgetTester tester) async {
const valueToRemove = 'this is the value that will be removed';
final entryList = entries([valueToRemove]);
final widget = EditableList(
entries: entryList,
textFieldLabel: label,
gaRefreshSelection: '',
gaScreen: '',
);
await tester.pumpWidget(
wrapSimple(widget),
);
final removeButton = find.byType(EditableListRemoveDirectoryButton);
await tester.tap(removeButton);
await tester.pump();
expect(entryList.value, isNot(contains(valueToRemove)));
},
);
});
});
}
| devtools/packages/devtools_app/test/shared/editable_list_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/shared/editable_list_test.dart",
"repo_id": "devtools",
"token_count": 2983
} | 168 |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/screens/provider/instance_viewer/instance_details.dart';
import 'package:devtools_app/src/screens/provider/instance_viewer/instance_providers.dart';
import 'package:devtools_app/src/screens/provider/instance_viewer/instance_viewer.dart';
import 'package:devtools_app/src/screens/provider/instance_viewer/result.dart';
import 'package:devtools_app_shared/service.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import '../test_infra/matchers/matchers.dart';
final alwaysExpandedOverride = isExpandedProvider
.overrideWithProvider((param) => StateProvider((ref) => true));
final neverExpandedOverride = isExpandedProvider
.overrideWithProvider((param) => StateProvider((ref) => false));
final emptyObjectInstance = AsyncValue.data(
InstanceDetails.object(
const [],
hash: 0,
instanceRefId: 'map0',
setter: null,
evalForInstance: FakeEvalOnDartLibrary(),
type: 'MyClass',
),
);
final object2Instance = AsyncValue.data(
InstanceDetails.object(
[
ObjectField(
name: 'first',
isFinal: true,
ownerName: '',
ownerUri: '',
eval: FakeEvalOnDartLibrary(),
ref: Result.error(Error(), StackTrace.empty),
isDefinedByDependency: false,
),
ObjectField(
name: 'second',
isFinal: true,
ownerName: '',
ownerUri: '',
eval: FakeEvalOnDartLibrary(),
ref: Result.error(Error(), StackTrace.empty),
isDefinedByDependency: false,
),
],
hash: 0,
instanceRefId: 'object',
setter: null,
evalForInstance: FakeEvalOnDartLibrary(),
type: 'MyClass',
),
);
final emptyMapInstance = AsyncValue.data(
InstanceDetails.map(const [], hash: 0, instanceRefId: 'map0', setter: null),
);
final map2Instance = AsyncValue.data(
InstanceDetails.map(
[
stringInstance.value!,
list2Instance.value!,
],
hash: 0,
instanceRefId: '0',
setter: null,
),
);
final emptyListInstance = AsyncValue.data(
InstanceDetails.list(
length: 0,
hash: 0,
instanceRefId: 'list0',
setter: null,
),
);
final list2Instance = AsyncValue.data(
InstanceDetails.list(
length: 2,
hash: 0,
instanceRefId: 'list2',
setter: null,
),
);
final stringInstance = AsyncValue.data(
InstanceDetails.string('string', instanceRefId: 'string', setter: null),
);
final nullInstance = AsyncValue.data(InstanceDetails.nill(setter: null));
final trueInstance = AsyncValue.data(
InstanceDetails.boolean('true', instanceRefId: 'true', setter: null),
);
final int42Instance = AsyncValue.data(
InstanceDetails.number('42', instanceRefId: '42', setter: null),
);
final enumValueInstance = AsyncValue.data(
InstanceDetails.enumeration(
type: 'Enum',
value: 'value',
setter: null,
instanceRefId: 'Enum.value',
),
);
void main() {
setUpAll(() async => await loadFonts());
setUp(() {
setGlobal(
DevToolsEnvironmentParameters,
ExternalDevToolsEnvironmentParameters(),
);
setGlobal(IdeTheme, getIdeTheme());
setGlobal(ServiceConnectionManager, FakeServiceConnectionManager());
});
group('InstanceViewer', () {
testWidgets(
'showInternalProperties: false hides private properties from dependencies',
(tester) async {
const objPath = InstancePath.fromInstanceId('obj');
InstancePath pathForProperty(String name) {
return objPath.pathForChild(
PathToProperty.objectProperty(
name: name,
ownerUri: '',
ownerName: '',
),
);
}
await tester.pumpWidget(
ProviderScope(
overrides: [
instanceProvider(objPath).overrideWithValue(
AsyncValue.data(
ObjectInstance(
[
ObjectField(
name: 'first',
isFinal: false,
ownerName: '',
ownerUri: '',
eval: FakeEvalOnDartLibrary(),
ref: Result.error(Error(), StackTrace.empty),
isDefinedByDependency: true,
),
ObjectField(
name: '_second',
isFinal: false,
ownerName: '',
ownerUri: '',
eval: FakeEvalOnDartLibrary(),
ref: Result.error(Error(), StackTrace.empty),
isDefinedByDependency: true,
),
ObjectField(
name: 'third',
isFinal: false,
ownerName: '',
ownerUri: '',
eval: FakeEvalOnDartLibrary(),
ref: Result.error(Error(), StackTrace.empty),
isDefinedByDependency: false,
),
ObjectField(
name: '_forth',
isFinal: false,
ownerName: '',
ownerUri: '',
eval: FakeEvalOnDartLibrary(),
ref: Result.error(Error(), StackTrace.empty),
isDefinedByDependency: false,
),
],
hash: 0,
instanceRefId: 'object',
setter: null,
evalForInstance: FakeEvalOnDartLibrary(),
type: 'MyClass',
),
),
),
instanceProvider(pathForProperty('first'))
.overrideWithValue(int42Instance),
instanceProvider(pathForProperty('_second'))
.overrideWithValue(int42Instance),
instanceProvider(pathForProperty('third'))
.overrideWithValue(int42Instance),
instanceProvider(pathForProperty('_forth'))
.overrideWithValue(int42Instance),
],
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: false,
rootPath: objPath,
),
),
),
),
);
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/show_internal_properties.png',
),
);
},
);
testWidgets('field editing flow', (tester) async {
const objPath = InstancePath.fromInstanceId('obj');
final propertyPath = objPath.pathForChild(
const PathToProperty.objectProperty(
name: 'first',
ownerUri: '',
ownerName: '',
),
);
await tester.pumpWidget(
ProviderScope(
overrides: [
instanceProvider(objPath).overrideWithValue(
AsyncValue.data(
ObjectInstance(
[
ObjectField(
name: 'first',
isFinal: false,
ownerName: '',
ownerUri: '',
eval: FakeEvalOnDartLibrary(),
ref: Result.error(Error(), StackTrace.empty),
isDefinedByDependency: false,
),
],
hash: 0,
instanceRefId: 'object',
setter: null,
evalForInstance: FakeEvalOnDartLibrary(),
type: 'MyClass',
),
),
),
instanceProvider(propertyPath).overrideWithValue(
AsyncValue.data(
InstanceDetails.number(
'0',
instanceRefId: '0',
setter: (_) async {},
),
),
),
],
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: objPath,
),
),
),
),
);
await tester.pumpAndSettle();
await tester.tap(find.byKey(ValueKey(propertyPath)));
await tester.pump();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden('../test_infra/goldens/instance_viewer/edit.png'),
);
// can press esc to unfocus active node
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
await tester.pump();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/edit_esc.png',
),
);
});
testWidgets(
'renders <loading> while an instance is fetched',
(tester) async {
await tester.pumpWidget(
ProviderScope(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('0'))
.overrideWithValue(const AsyncValue.loading()),
],
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('0'),
),
),
),
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/loading.png',
),
);
},
);
// TODO(rrousselGit) find a way to test "data then loading then wait then loading then wait shows "loading" after a total of one second"
// This is tricky because tester.pump(duration) completes the Timer even if the duration is < 1 second
testWidgets(
'once valid data was fetched, going back to loading and emiting an error immediately updates the UI',
(tester) async {
const app = MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('0'),
),
),
);
await tester.pumpWidget(
ProviderScope(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('0'))
.overrideWithValue(nullInstance),
],
child: app,
),
);
await tester.pumpAndSettle();
await tester.pumpWidget(
ProviderScope(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('0'))
.overrideWithValue(const AsyncValue.loading()),
],
child: app,
),
);
await tester.pump();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/null.png',
),
);
await tester.pumpWidget(
ProviderScope(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('0'))
.overrideWithValue(
AsyncValue.error(StateError('test error')),
),
],
child: app,
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/error.png',
),
);
},
);
testWidgets(
'once valid data was fetched, going back to loading and emiting a new value immediately updates the UI',
(tester) async {
const app = MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('0'),
),
),
);
await tester.pumpWidget(
ProviderScope(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('0'))
.overrideWithValue(nullInstance),
],
child: app,
),
);
await tester.pumpAndSettle();
await tester.pumpWidget(
ProviderScope(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('0'))
.overrideWithValue(const AsyncValue.loading()),
],
child: app,
),
);
await tester.pump();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/null.png',
),
);
await tester.pumpWidget(
ProviderScope(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('0'))
.overrideWithValue(int42Instance),
],
child: app,
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/num.png',
),
);
},
);
testWidgets('renders enums', (tester) async {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('enum'))
.overrideWithValue(enumValueInstance),
],
);
addTearDown(container.dispose);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('enum'),
),
),
),
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden('../test_infra/goldens/instance_viewer/enum.png'),
);
});
testWidgets('renders null', (tester) async {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('null'))
.overrideWithValue(nullInstance),
],
);
addTearDown(container.dispose);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('null'),
),
),
),
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden('../test_infra/goldens/instance_viewer/null.png'),
);
});
testWidgets('renders bools', (tester) async {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('bool'))
.overrideWithValue(trueInstance),
],
);
addTearDown(container.dispose);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('bool'),
),
),
),
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden('../test_infra/goldens/instance_viewer/bool.png'),
);
});
testWidgets('renders strings', (tester) async {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('string'))
.overrideWithValue(stringInstance),
],
);
addTearDown(container.dispose);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('string'),
),
),
),
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/string.png',
),
);
});
testWidgets('renders numbers', (tester) async {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('num'))
.overrideWithValue(int42Instance),
],
);
addTearDown(container.dispose);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('num'),
),
),
),
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden('../test_infra/goldens/instance_viewer/num.png'),
);
});
testWidgets('renders maps', (tester) async {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('map'))
.overrideWithValue(map2Instance),
// {'string': 42, [...]: ['string', null]}
instanceProvider(
const InstancePath.fromInstanceId(
'map',
pathToProperty: [PathToProperty.mapKey(ref: 'string')],
),
).overrideWithValue(int42Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'map',
pathToProperty: [PathToProperty.mapKey(ref: 'list2')],
),
).overrideWithValue(list2Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'map',
pathToProperty: [
PathToProperty.mapKey(ref: 'list2'),
PathToProperty.listIndex(0),
],
),
).overrideWithValue(stringInstance),
instanceProvider(
const InstancePath.fromInstanceId(
'map',
pathToProperty: [
PathToProperty.mapKey(ref: 'list2'),
PathToProperty.listIndex(1),
],
),
).overrideWithValue(nullInstance),
],
);
addTearDown(container.dispose);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('map'),
),
),
),
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/collasped_map.png',
),
);
container
.read(
isExpandedProvider(
const InstancePath.fromInstanceId(
'map',
pathToProperty: [PathToProperty.mapKey(ref: 'list2')],
),
).notifier,
)
.state = true;
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/expanded_map.png',
),
);
});
testWidgets('renders objects', (tester) async {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('object'))
.overrideWithValue(object2Instance),
// MyClass(first: 42, second: ['string', null])
instanceProvider(
const InstancePath.fromInstanceId(
'object',
pathToProperty: [
PathToProperty.objectProperty(
name: 'first',
ownerUri: '',
ownerName: '',
),
],
),
).overrideWithValue(int42Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'object',
pathToProperty: [
PathToProperty.objectProperty(
name: 'second',
ownerUri: '',
ownerName: '',
),
],
),
).overrideWithValue(list2Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'object',
pathToProperty: [
PathToProperty.objectProperty(
name: 'second',
ownerUri: '',
ownerName: '',
),
PathToProperty.listIndex(0),
],
),
).overrideWithValue(stringInstance),
instanceProvider(
const InstancePath.fromInstanceId(
'object',
pathToProperty: [
PathToProperty.objectProperty(
name: 'second',
ownerUri: '',
ownerName: '',
),
PathToProperty.listIndex(1),
],
),
).overrideWithValue(nullInstance),
],
);
addTearDown(container.dispose);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('object'),
),
),
),
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/collasped_object.png',
),
);
container
.read(
isExpandedProvider(
const InstancePath.fromInstanceId(
'object',
pathToProperty: [
PathToProperty.objectProperty(
name: 'second',
ownerUri: '',
ownerName: '',
),
],
),
).notifier,
)
.state = true;
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/expanded_object.png',
),
);
});
testWidgets('renders lists', (tester) async {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('list'))
.overrideWithValue(list2Instance),
// [true, {'string': 42, [...]: null}]
instanceProvider(
const InstancePath.fromInstanceId(
'list',
pathToProperty: [
PathToProperty.listIndex(0),
],
),
).overrideWithValue(trueInstance),
instanceProvider(
const InstancePath.fromInstanceId(
'list',
pathToProperty: [
PathToProperty.listIndex(1),
],
),
).overrideWithValue(map2Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'list',
pathToProperty: [
PathToProperty.listIndex(1),
PathToProperty.mapKey(ref: 'string'),
],
),
).overrideWithValue(int42Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'list',
pathToProperty: [
PathToProperty.listIndex(1),
PathToProperty.mapKey(ref: 'list2'),
],
),
).overrideWithValue(nullInstance),
],
);
addTearDown(container.dispose);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('list'),
),
),
),
),
);
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/collasped_list.png',
),
);
container
.read(
isExpandedProvider(
const InstancePath.fromInstanceId(
'list',
pathToProperty: [PathToProperty.listIndex(1)],
),
).notifier,
)
.state = true;
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesDevToolsGolden(
'../test_infra/goldens/instance_viewer/expanded_list.png',
),
);
});
testWidgets('does not listen to unexpanded nodes', (tester) async {
final container = ProviderContainer(
overrides: [
neverExpandedOverride,
instanceProvider(const InstancePath.fromInstanceId('list2'))
.overrideWithValue(list2Instance),
],
);
addTearDown(container.dispose);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: const MaterialApp(
home: Scaffold(
body: InstanceViewer(
showInternalProperties: true,
rootPath: InstancePath.fromInstanceId('list2'),
),
),
),
),
);
expect(
container
.readProviderElement(
instanceProvider(const InstancePath.fromInstanceId('list2')),
)
.hasListeners,
isTrue,
);
expect(
container
.readProviderElement(
instanceProvider(
const InstancePath.fromInstanceId(
'list2',
pathToProperty: [PathToProperty.listIndex(0)],
),
),
)
.hasListeners,
isFalse,
);
expect(
container
.readProviderElement(
instanceProvider(
const InstancePath.fromInstanceId(
'list2',
pathToProperty: [PathToProperty.listIndex(1)],
),
),
)
.hasListeners,
isFalse,
);
});
});
group('estimatedChildCountProvider', () {
group('primitives', () {
test('count for one line when not expanded', () {
final container = ProviderContainer(
overrides: [
neverExpandedOverride,
instanceProvider(const InstancePath.fromInstanceId('string'))
.overrideWithValue(stringInstance),
instanceProvider(const InstancePath.fromInstanceId('null'))
.overrideWithValue(nullInstance),
instanceProvider(const InstancePath.fromInstanceId('bool'))
.overrideWithValue(trueInstance),
instanceProvider(const InstancePath.fromInstanceId('num'))
.overrideWithValue(int42Instance),
instanceProvider(const InstancePath.fromInstanceId('enum'))
.overrideWithValue(enumValueInstance),
],
);
addTearDown(container.dispose);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('string'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('null'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('bool'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('num'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('enum'),
),
),
1,
);
});
test('count for one line when expanded', () {
final container = ProviderContainer(
overrides: [
// force expanded status
alwaysExpandedOverride,
instanceProvider(const InstancePath.fromInstanceId('string'))
.overrideWithValue(stringInstance),
instanceProvider(const InstancePath.fromInstanceId('null'))
.overrideWithValue(nullInstance),
instanceProvider(const InstancePath.fromInstanceId('bool'))
.overrideWithValue(trueInstance),
instanceProvider(const InstancePath.fromInstanceId('num'))
.overrideWithValue(int42Instance),
instanceProvider(const InstancePath.fromInstanceId('enum'))
.overrideWithValue(enumValueInstance),
],
);
addTearDown(container.dispose);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('string'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('null'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('bool'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('num'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('enum'),
),
),
1,
);
});
});
group('lists', () {
test(
'count for one line when not expanded regarless of the list length',
() {
final container = ProviderContainer(
overrides: [
neverExpandedOverride,
instanceProvider(const InstancePath.fromInstanceId('empty'))
.overrideWithValue(emptyListInstance),
instanceProvider(const InstancePath.fromInstanceId('list-2'))
.overrideWithValue(emptyListInstance),
],
);
addTearDown(container.dispose);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('empty'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('list-2'),
),
),
1,
);
},
);
test('when expanded, recursively traverse the list content', () {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('empty'))
.overrideWithValue(emptyListInstance),
// ['string', [42, true]]
instanceProvider(const InstancePath.fromInstanceId('list-2'))
.overrideWithValue(list2Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'list-2',
pathToProperty: [PathToProperty.listIndex(0)],
),
).overrideWithValue(stringInstance),
instanceProvider(
const InstancePath.fromInstanceId(
'list-2',
pathToProperty: [PathToProperty.listIndex(1)],
),
).overrideWithValue(list2Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'list-2',
pathToProperty: [
PathToProperty.listIndex(1),
PathToProperty.listIndex(0),
],
),
).overrideWithValue(int42Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'list-2',
pathToProperty: [
PathToProperty.listIndex(1),
PathToProperty.listIndex(1),
],
),
).overrideWithValue(trueInstance),
],
);
addTearDown(container.dispose);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('empty'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('list-2'),
),
),
// header + 2 items
3,
);
// expand the nested list
container
.read(
isExpandedProvider(
const InstancePath.fromInstanceId(
'list-2',
pathToProperty: [PathToProperty.listIndex(1)],
),
).notifier,
)
.state = true;
// now the estimatedChildCount traverse the nested list too
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('list-2'),
),
),
// header + string + sub-list header + sub-list 2 items
5,
);
});
});
group('maps', () {
test(
'count for one line when not expanded regarless of the map length',
() {
final container = ProviderContainer(
overrides: [
neverExpandedOverride,
instanceProvider(const InstancePath.fromInstanceId('empty'))
.overrideWithValue(emptyMapInstance),
instanceProvider(const InstancePath.fromInstanceId('map-2'))
.overrideWithValue(map2Instance),
],
);
addTearDown(container.dispose);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('empty'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('map-2'),
),
),
1,
);
},
);
test('when expanded, recursively traverse the map content', () {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('empty'))
.overrideWithValue(emptyMapInstance),
// {'string': 'string', [...]: [42, true]]
instanceProvider(const InstancePath.fromInstanceId('map-2'))
.overrideWithValue(map2Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'map-2',
pathToProperty: [PathToProperty.mapKey(ref: 'string')],
),
).overrideWithValue(stringInstance),
instanceProvider(
const InstancePath.fromInstanceId(
'map-2',
pathToProperty: [PathToProperty.mapKey(ref: 'list2')],
),
).overrideWithValue(list2Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'map-2',
pathToProperty: [
PathToProperty.mapKey(ref: 'list2'),
PathToProperty.listIndex(0),
],
),
).overrideWithValue(int42Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'map-2',
pathToProperty: [
PathToProperty.mapKey(ref: 'list2'),
PathToProperty.listIndex(1),
],
),
).overrideWithValue(trueInstance),
],
);
addTearDown(container.dispose);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('empty'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('map-2'),
),
),
// header + 2 items
3,
);
// expand the nested list
container
.read(
isExpandedProvider(
const InstancePath.fromInstanceId(
'map-2',
pathToProperty: [PathToProperty.mapKey(ref: 'list2')],
),
).notifier,
)
.state = true;
// now the estimatedChildCount traverse the nested list too
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('map-2'),
),
),
// header + string + sub-list header + sub-list 2 items
5,
);
});
});
group('objects', () {
test(
'count for one line when not expanded regarless of the number of fields',
() {
final container = ProviderContainer(
overrides: [
neverExpandedOverride,
instanceProvider(const InstancePath.fromInstanceId('empty'))
.overrideWithValue(emptyObjectInstance),
instanceProvider(const InstancePath.fromInstanceId('object-2'))
.overrideWithValue(object2Instance),
],
);
addTearDown(container.dispose);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('empty'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('object-2'),
),
),
1,
);
},
);
test('when expanded, recursively traverse the object content', () {
final container = ProviderContainer(
overrides: [
instanceProvider(const InstancePath.fromInstanceId('empty'))
.overrideWithValue(emptyObjectInstance),
// Class(first: 'string', second: [42, true])
instanceProvider(const InstancePath.fromInstanceId('object-2'))
.overrideWithValue(object2Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'object-2',
pathToProperty: [
PathToProperty.objectProperty(
name: 'first',
ownerUri: '',
ownerName: '',
),
],
),
).overrideWithValue(stringInstance),
instanceProvider(
const InstancePath.fromInstanceId(
'object-2',
pathToProperty: [
PathToProperty.objectProperty(
name: 'second',
ownerUri: '',
ownerName: '',
),
],
),
).overrideWithValue(list2Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'object-2',
pathToProperty: [
PathToProperty.objectProperty(
name: 'second',
ownerUri: '',
ownerName: '',
),
PathToProperty.listIndex(0),
],
),
).overrideWithValue(int42Instance),
instanceProvider(
const InstancePath.fromInstanceId(
'object-2',
pathToProperty: [
PathToProperty.objectProperty(
name: 'second',
ownerUri: '',
ownerName: '',
),
PathToProperty.listIndex(1),
],
),
).overrideWithValue(trueInstance),
],
);
addTearDown(container.dispose);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('empty'),
),
),
1,
);
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('object-2'),
),
),
// header + 2 items
3,
);
// expand the nested list
container
.read(
isExpandedProvider(
const InstancePath.fromInstanceId(
'object-2',
pathToProperty: [
PathToProperty.objectProperty(
name: 'second',
ownerUri: '',
ownerName: '',
),
],
),
).notifier,
)
.state = true;
// now the estimatedChildCount traverse the nested list too
expect(
container.read(
estimatedChildCountProvider(
const InstancePath.fromInstanceId('object-2'),
),
),
// header + string + sub-list header + sub-list 2 items
5,
);
});
});
});
group('isExpandedProvider', () {
test('the graph root starts as expanded', () {
final container = ProviderContainer();
addTearDown(container.dispose);
expect(
container
.read(
isExpandedProvider(const InstancePath.fromProviderId('0'))
.notifier,
)
.state,
isTrue,
);
expect(
container
.read(
isExpandedProvider(const InstancePath.fromInstanceId('0'))
.notifier,
)
.state,
isTrue,
);
});
test('children nodes are not expanded by default', () {
final container = ProviderContainer();
addTearDown(container.dispose);
expect(
container
.read(
isExpandedProvider(
const InstancePath.fromProviderId(
'0',
pathToProperty: [PathToProperty.listIndex(0)],
),
).notifier,
)
.state,
isFalse,
);
expect(
container
.read(
isExpandedProvider(
const InstancePath.fromInstanceId(
'0',
pathToProperty: [PathToProperty.listIndex(0)],
),
).notifier,
)
.state,
isFalse,
);
});
});
}
// ignore: subtype_of_sealed_class, fake for testing.
class FakeEvalOnDartLibrary extends Fake implements EvalOnDartLibrary {}
| devtools/packages/devtools_app/test/shared/instance_viewer_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/shared/instance_viewer_test.dart",
"repo_id": "devtools",
"token_count": 23978
} | 169 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/framework/scaffold.dart';
import 'package:devtools_app/src/shared/framework_controller.dart';
import 'package:devtools_app/src/shared/survey.dart';
import 'package:devtools_app_shared/service.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
void main() {
late MockServiceConnectionManager mockServiceConnection;
late MockServiceManager mockServiceManager;
setUp(() {
mockServiceConnection = createMockServiceConnectionWithDefaults();
mockServiceManager =
mockServiceConnection.serviceManager as MockServiceManager;
when(mockServiceManager.service).thenReturn(null);
when(mockServiceManager.connectedAppInitialized).thenReturn(false);
when(mockServiceManager.connectedState).thenReturn(
ValueNotifier<ConnectedState>(const ConnectedState(false)),
);
when(mockServiceManager.hasConnection).thenReturn(false);
final mockErrorBadgeManager = MockErrorBadgeManager();
when(mockServiceConnection.errorBadgeManager)
.thenReturn(mockErrorBadgeManager);
when(mockErrorBadgeManager.errorCountNotifier(any))
.thenReturn(ValueNotifier<int>(0));
setGlobal(ServiceConnectionManager, mockServiceConnection);
setGlobal(FrameworkController, FrameworkController());
setGlobal(SurveyService, SurveyService());
setGlobal(OfflineModeController, OfflineModeController());
setGlobal(IdeTheme, IdeTheme());
setGlobal(NotificationService, NotificationService());
setGlobal(BannerMessagesController, BannerMessagesController());
});
Widget wrapScaffold(Widget child) {
return wrapWithControllers(
child,
analytics: AnalyticsController(
enabled: false,
firstRun: false,
consentMessage: 'fake message',
),
releaseNotes: ReleaseNotesController(),
);
}
testWidgets(
'does not display floating debugger tab controls when no app is connected',
(WidgetTester tester) async {
when(mockServiceManager.connectedAppInitialized).thenReturn(false);
await tester.pumpWidget(
wrapScaffold(
DevToolsScaffold(
page: _screen1.screenId,
screens: const [_screen1, _screen2],
),
),
);
expect(find.byKey(_k1), findsOneWidget);
expect(find.byKey(_k2), findsNothing);
expect(find.byType(FloatingDebuggerControls), findsNothing);
},
);
}
class _TestScreen extends Screen {
const _TestScreen(
this.name,
this.key, {
bool showFloatingDebuggerControls = true,
Key? tabKey,
}) : super(
name,
title: name,
icon: Icons.computer,
tabKey: tabKey,
showFloatingDebuggerControls: showFloatingDebuggerControls,
);
final String name;
final Key key;
@override
Widget buildScreenBody(BuildContext context) {
return SizedBox(key: key);
}
}
// Keys and tabs for use in the test.
const _k1 = Key('body key 1');
const _k2 = Key('body key 2');
const _t1 = Key('tab key 1');
const _t2 = Key('tab key 2');
const _screen1 = _TestScreen('screen1', _k1, tabKey: _t1);
const _screen2 = _TestScreen('screen2', _k2, tabKey: _t2);
| devtools/packages/devtools_app/test/shared/scaffold_no_app_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/shared/scaffold_no_app_test.dart",
"repo_id": "devtools",
"token_count": 1300
} | 170 |
import 'package:devtools_app/src/shared/utils.dart';
import 'package:fake_async/fake_async.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('DebounceTimer', () {
test('the callback happens immediately', () {
fakeAsync((async) {
int callbackCounter = 0;
DebounceTimer.periodic(
const Duration(seconds: 1),
() async {
callbackCounter++;
await Future<void>.delayed(const Duration(seconds: 60));
},
);
async.elapse(const Duration(milliseconds: 40));
expect(callbackCounter, 1);
});
});
test('only triggers another callback after the first is done', () {
fakeAsync((async) {
int callbackCounter = 0;
DebounceTimer.periodic(
const Duration(milliseconds: 500),
() async {
callbackCounter++;
await Future<void>.delayed(const Duration(seconds: 30));
},
);
async.elapse(const Duration(seconds: 31));
expect(callbackCounter, 2);
});
});
test('calls the callback at the beginning and then once per period', () {
fakeAsync((async) {
int callbackCounter = 0;
DebounceTimer.periodic(
const Duration(seconds: 1),
() async {
callbackCounter++;
await Future<void>.delayed(
const Duration(milliseconds: 1),
);
},
);
async.elapse(const Duration(milliseconds: 40500));
expect(callbackCounter, 41);
});
});
test(
'cancels the periodic timer when cancel is called between the first and second callback calls',
() {
fakeAsync((async) {
int callbackCounter = 0;
final timer = DebounceTimer.periodic(
const Duration(seconds: 1),
() async {
callbackCounter++;
await Future<void>.delayed(
const Duration(milliseconds: 1),
);
},
);
async.elapse(const Duration(milliseconds: 500));
expect(callbackCounter, 1);
timer.cancel();
async.elapse(const Duration(seconds: 20));
expect(callbackCounter, 1);
});
},
);
test(
'cancels the periodic timer when cancelled after multiple periodic calls',
() {
fakeAsync((async) {
int callbackCounter = 0;
final timer = DebounceTimer.periodic(
const Duration(seconds: 1),
() async {
callbackCounter++;
await Future<void>.delayed(
const Duration(milliseconds: 1),
);
},
);
async.elapse(const Duration(milliseconds: 20500));
expect(callbackCounter, 21);
timer.cancel();
async.elapse(const Duration(seconds: 20));
expect(callbackCounter, 21);
});
},
);
});
}
| devtools/packages/devtools_app/test/shared/utils_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/shared/utils_test.dart",
"repo_id": "devtools",
"token_count": 1389
} | 171 |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:developer' as developer;
import 'dart:math' as math;
// These lints get in the way of testing autocomplete.
// ignore_for_file: unused_import, unused_local_variable, unused_element, prefer_final_locals
import 'autocomplete_helper_library.dart';
export 'other_classes.dart';
// Unused parameters are needed to test autocomplete.
// ignore_for_file: avoid-unused-parameters
class FooClass {
FooClass();
FooClass.namedConstructor();
factory FooClass.factory1() => FooClass();
int field1 = 1;
int field2 = 2;
static int staticField1 = 3;
static int staticField2 = 4;
static void staticMethod() {}
void func1() {}
void func2() {}
int operator [](int index) {
return 7;
}
}
class _PrivateClass {}
class AnotherClass {
int operator [](int index) {
return 42;
}
static int someStaticMethod() {
return math.max(3, 4);
}
void someInstanceMethod() {}
void pauseWithScopedVariablesMethod() {
var foo = FooClass();
var foobar = 2;
var baz = 3;
var bar = 4;
developer.debugger();
}
var someField = 3;
static var someStaticField = 2;
int get someProperty => 42;
// ignore: avoid-dynamic, gets in the way of testing.
set someSomeProperty(v) {}
}
var someTopLevelField = 9;
int get someTopLevelGetter => 42;
set someTopLevelSetter(v) {}
void someTopLevelMember() {}
const _privateField1 = 1;
const _privateField2 = 2;
| devtools/packages/devtools_app/test/test_infra/fixtures/flutter_app/lib/src/autocomplete.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/fixtures/flutter_app/lib/src/autocomplete.dart",
"repo_id": "devtools",
"token_count": 525
} | 172 |
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: avoid_print
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:devtools_app/devtools_app.dart';
import 'package:vm_service/utils.dart';
import 'package:vm_service/vm_service.dart';
import 'package:vm_service/vm_service_io.dart';
// TODO(kenz): eventually delete this class in favor of
// integration_test/test_infra/test_app_driver.dart once the tests that
// depend on this class are moved over to be true integration tests.
/// This class was copied from
/// flutter/packages/flutter_tools/test/integration/test_driver.dart. Its
/// supporting classes were also copied from flutter/packages/flutter_tools.
/// Those files are marked as such and live in the parent directory of this file
/// (flutter_tools/).
// Set this to true for debugging to get JSON written to stdout.
const bool _printDebugOutputToStdOut = false;
const Duration defaultTimeout = Duration(seconds: 40);
const Duration appStartTimeout = Duration(seconds: 240);
const Duration quitTimeout = Duration(seconds: 10);
abstract class FlutterTestDriver {
FlutterTestDriver(this.projectFolder, {String? logPrefix})
: _logPrefix = logPrefix != null ? '$logPrefix: ' : '';
final Directory projectFolder;
final String _logPrefix;
late Process proc;
late int procPid;
final StreamController<String> stdoutController =
StreamController<String>.broadcast();
final StreamController<String> stderrController =
StreamController<String>.broadcast();
final StreamController<String> _allMessages =
StreamController<String>.broadcast();
final StringBuffer errorBuffer = StringBuffer();
late String lastResponse;
late Uri _vmServiceWsUri;
bool hasExited = false;
VmServiceWrapper? vmService;
String get lastErrorInfo => errorBuffer.toString();
Stream<String> get stderr => stderrController.stream;
Stream<String> get stdout => stdoutController.stream;
Uri get vmServiceUri => _vmServiceWsUri;
String _debugPrint(String msg) {
const int maxLength = 500;
final String truncatedMsg =
msg.length > maxLength ? '${msg.substring(0, maxLength)}...' : msg;
_allMessages.add(truncatedMsg);
if (_printDebugOutputToStdOut) {
print('$_logPrefix$truncatedMsg');
}
return msg;
}
Future<void> setupProcess(
List<String> args, {
required String flutterExecutable,
FlutterRunConfiguration runConfig = const FlutterRunConfiguration(),
File? pidFile,
}) async {
final testArgs = [
...args,
if (runConfig.withDebugger) '--start-paused',
if (pidFile != null) ...['--pid-file', pidFile.path],
];
_debugPrint('Spawning flutter $testArgs in ${projectFolder.path}');
proc = await Process.start(
flutterExecutable,
testArgs,
workingDirectory: projectFolder.path,
environment: <String, String>{
'FLUTTER_TEST': 'true',
'DART_VM_OPTIONS': '',
},
);
// This class doesn't use the result of the future. It's made available
// via a getter for external uses.
unawaited(
proc.exitCode.then((int code) {
_debugPrint('Process exited ($code)');
hasExited = true;
}),
);
transformToLines(proc.stdout)
.listen((String line) => stdoutController.add(line));
transformToLines(proc.stderr)
.listen((String line) => stderrController.add(line));
// Capture stderr to a buffer so we can show it all if any requests fail.
stderrController.stream.listen(errorBuffer.writeln);
// This is just debug printing to aid running/debugging tests locally.
stdoutController.stream.listen(_debugPrint);
stderrController.stream.listen(_debugPrint);
}
Future<int> killGracefully() {
_debugPrint('Sending SIGTERM to $procPid..');
Process.killPid(procPid);
return proc.exitCode.timeout(quitTimeout, onTimeout: _killForcefully);
}
Future<int> _killForcefully() {
_debugPrint('Sending SIGKILL to $procPid..');
Process.killPid(procPid, ProcessSignal.sigkill);
return proc.exitCode;
}
String? flutterIsolateId;
Future<String> getFlutterIsolateId() async {
// Currently these tests only have a single isolate. If this
// ceases to be the case, this code will need changing.
if (flutterIsolateId == null) {
final VM vm = await vmService!.getVM();
flutterIsolateId = vm.isolates!.first.id!;
}
return flutterIsolateId!;
}
Future<Isolate> _getFlutterIsolate() async {
return await vmService!.getIsolate(await getFlutterIsolateId());
}
Future<Isolate> waitForPause() async {
_debugPrint('Waiting for isolate to pause');
final String flutterIsolate = await getFlutterIsolateId();
Future<Isolate> waitForPause() async {
final Completer<Event> pauseEvent = Completer<Event>();
// Start listening for pause events.
final StreamSubscription<Event> pauseSub = vmService!.onDebugEvent
.where(
(Event event) =>
event.isolate!.id == flutterIsolate &&
event.kind!.startsWith('Pause'),
)
.listen(pauseEvent.complete);
// But also check if the isolate was already paused (only after we've set
// up the sub) to avoid races. If it was paused, we don't need to wait
// for the event.
final Isolate isolate = await vmService!.getIsolate(flutterIsolate);
if (!isolate.pauseEvent!.kind!.startsWith('Pause')) {
await pauseEvent.future;
}
// Cancel the sub on either of the above.
await pauseSub.cancel();
return _getFlutterIsolate();
}
return _timeoutWithMessages<Isolate>(
waitForPause,
message: 'Isolate did not pause',
);
}
Future<Isolate?> resume({String? step, bool wait = true}) async {
_debugPrint('Sending resume ($step)');
await _timeoutWithMessages<Object?>(
() async => vmService!.resume(await getFlutterIsolateId(), step: step),
message: 'Isolate did not respond to resume ($step)',
);
return wait ? waitForPause() : null;
}
Future<Map<String, dynamic>> waitFor({
String? event,
int? id,
Duration? timeout,
bool ignoreAppStopEvent = false,
}) {
final Completer<Map<String, dynamic>> response =
Completer<Map<String, dynamic>>();
late StreamSubscription<String> sub;
sub = stdoutController.stream.listen((String line) async {
final json = _parseFlutterResponse(line);
if (json == null) {
return;
} else if ((event != null && json['event'] == event) ||
(id != null && json['id'] == id)) {
await sub.cancel();
response.complete(json);
} else if (!ignoreAppStopEvent && json['event'] == 'app.stop') {
await sub.cancel();
final StringBuffer error = StringBuffer();
error.write('Received app.stop event while waiting for ');
error.write(
'${event != null ? '$event event' : 'response to request $id.'}.\n\n',
);
final params = json['params'];
if (params != null && params is Map<String, Object?>) {
if (params['error'] != null) {
error.write('${params['error']}\n\n');
}
if (params['trace'] != null) {
error.write('${params['trace']}\n\n');
}
}
response.completeError(error.toString());
}
});
return _timeoutWithMessages<Map<String, dynamic>>(
() => response.future,
timeout: timeout,
message: event != null
? 'Did not receive expected $event event.'
: 'Did not receive response to request "$id".',
).whenComplete(() => sub.cancel());
}
Future<T> _timeoutWithMessages<T>(
Future<T> Function() f, {
Duration? timeout,
String? message,
}) {
// Capture output to a buffer so if we don't get the response we want we can show
// the output that did arrive in the timeout error.
final StringBuffer messages = StringBuffer();
final DateTime start = DateTime.now();
void logMessage(String m) {
final int ms = DateTime.now().difference(start).inMilliseconds;
messages.writeln('[+ ${ms.toString().padLeft(5)}] $m');
}
final StreamSubscription<String> sub =
_allMessages.stream.listen(logMessage);
return f().timeout(
timeout ?? defaultTimeout,
onTimeout: () {
logMessage('<timed out>');
throw '$message';
},
).catchError((Object? error) {
throw '$error\nReceived:\n${messages.toString()}';
}).whenComplete(() => sub.cancel());
}
Map<String, Object?>? _parseFlutterResponse(String line) {
if (line.startsWith('[') && line.endsWith(']')) {
try {
final Map<String, dynamic>? resp = (json.decode(line) as List)[0];
lastResponse = line;
return resp;
} catch (e) {
// Not valid JSON, so likely some other output that was surrounded by [brackets]
return null;
}
}
return null;
}
}
class FlutterRunTestDriver extends FlutterTestDriver {
FlutterRunTestDriver(Directory projectFolder, {String? logPrefix})
: super(projectFolder, logPrefix: logPrefix);
String? _currentRunningAppId;
Future<void> run({
required String flutterExecutable,
FlutterRunConfiguration runConfig = const FlutterRunConfiguration(),
File? pidFile,
}) async {
final args = <String>[
'run',
'--machine',
];
if (runConfig.trackWidgetCreation) {
args.add('--track-widget-creation');
}
if (runConfig.entryScript != null) {
args.addAll(['-t', runConfig.entryScript ?? '']);
}
args.addAll(['-d', 'flutter-tester']);
await setupProcess(
args,
flutterExecutable: flutterExecutable,
runConfig: runConfig,
pidFile: pidFile,
);
}
@override
Future<void> setupProcess(
List<String> args, {
required String flutterExecutable,
FlutterRunConfiguration runConfig = const FlutterRunConfiguration(),
File? pidFile,
}) async {
await super.setupProcess(
args,
flutterExecutable: flutterExecutable,
runConfig: runConfig,
pidFile: pidFile,
);
// Stash the PID so that we can terminate the VM more reliably than using
// proc.kill() (because proc is a shell, because `flutter` is a shell
// script).
final Map<String, dynamic> connected =
await waitFor(event: 'daemon.connected');
final Map<String, dynamic> params = connected['params'];
procPid = params['pid'];
// Set this up now, but we don't wait it yet. We want to make sure we don't
// miss it while waiting for debugPort below.
final Future<Map<String, dynamic>> started =
waitFor(event: 'app.started', timeout: appStartTimeout);
if (runConfig.withDebugger) {
final Map<String, dynamic> debugPort =
await waitFor(event: 'app.debugPort', timeout: appStartTimeout);
final Map<String, dynamic> params = debugPort['params'];
final String wsUriString = params['wsUri'];
_vmServiceWsUri = Uri.parse(wsUriString);
// Map to WS URI.
_vmServiceWsUri =
convertToWebSocketUrl(serviceProtocolUrl: _vmServiceWsUri);
vmService = await vmServiceConnectUriWithFactory<VmServiceWrapper>(
_vmServiceWsUri.toString(),
vmServiceFactory: ({
// ignore: avoid-dynamic, mirrors types of [VmServiceFactory].
required Stream<dynamic> /*String|List<int>*/ inStream,
required void Function(String message) writeMessage,
Log? log,
DisposeHandler? disposeHandler,
Future? streamClosed,
String? wsUri,
bool trackFutures = false,
}) =>
VmServiceWrapper.defaultFactory(
inStream: inStream,
writeMessage: writeMessage,
log: log,
disposeHandler: disposeHandler,
streamClosed: streamClosed,
wsUri: wsUri,
trackFutures: true,
),
);
final vmServiceLocal = vmService!;
vmServiceLocal.onSend.listen((String s) => _debugPrint('==> $s'));
vmServiceLocal.onReceive.listen((String s) => _debugPrint('<== $s'));
await Future.wait(<Future<Success>>[
vmServiceLocal.streamListen(EventStreams.kIsolate),
vmServiceLocal.streamListen(EventStreams.kDebug),
]);
// On hot restarts, the isolate ID we have for the Flutter thread will
// exit so we need to invalidate our cached ID.
vmServiceLocal.onIsolateEvent.listen((Event event) {
if (event.kind == EventKind.kIsolateExit &&
event.isolate!.id == flutterIsolateId) {
flutterIsolateId = null;
}
});
// Because we start paused, resume so the app is in a "running" state as
// expected by tests. Tests will reload/restart as required if they need
// to hit breakpoints, etc.
await waitForPause();
if (runConfig.pauseOnExceptions) {
await vmServiceLocal.setIsolatePauseMode(
await getFlutterIsolateId(),
exceptionPauseMode: ExceptionPauseMode.kUnhandled,
);
}
await resume(wait: false);
}
// Now await the started event; if it had already happened the future will
// have already completed.
final Map<String, dynamic> startedParams = (await started)['params'];
_currentRunningAppId = startedParams['appId'];
}
Future<void> hotRestart({bool pause = false}) =>
_restart(fullRestart: true, pause: pause);
Future<void> hotReload() => _restart();
Future<void> _restart({bool fullRestart = false, bool pause = false}) async {
if (_currentRunningAppId == null) {
throw Exception('App has not started yet');
}
final hotReloadResp = await _sendRequest(
'app.restart',
<String, Object?>{
'appId': _currentRunningAppId,
'fullRestart': fullRestart,
'pause': pause,
},
);
if (hotReloadResp == null ||
(hotReloadResp as Map<String, Object?>)['code'] != 0) {
_throwErrorResponse(
'Hot ${fullRestart ? 'restart' : 'reload'} request failed',
);
}
}
Future<int> stop() async {
final vmServiceLocal = vmService;
if (vmServiceLocal != null) {
_debugPrint('Closing VM service');
await Future.delayed(const Duration(milliseconds: 500));
await vmServiceLocal.dispose();
}
if (_currentRunningAppId != null) {
_debugPrint('Stopping app');
await Future.any<void>(<Future<void>>[
proc.exitCode,
_sendRequest(
'app.stop',
<String, Object?>{'appId': _currentRunningAppId},
),
]).timeout(
quitTimeout,
onTimeout: () {
_debugPrint('app.stop did not return within $quitTimeout');
},
);
_currentRunningAppId = null;
}
_debugPrint('Waiting for process to end');
return proc.exitCode.timeout(quitTimeout, onTimeout: killGracefully);
}
int id = 1;
Future<Object?> _sendRequest(String method, Object? params) async {
final int requestId = id++;
final request = <String, Object?>{
'id': requestId,
'method': method,
'params': params,
};
final String jsonEncoded = json.encode(<Map<String, Object?>>[request]);
_debugPrint(jsonEncoded);
// Set up the response future before we send the request to avoid any
// races. If the method we're calling is app.stop then we tell waitFor not
// to throw if it sees an app.stop event before the response to this request.
final Future<Map<String, dynamic>> responseFuture = waitFor(
id: requestId,
ignoreAppStopEvent: method == 'app.stop',
);
proc.stdin.writeln(jsonEncoded);
final Map<String, dynamic> response = await responseFuture;
if (response['error'] != null || response['result'] == null) {
_throwErrorResponse('Unexpected error response');
}
return response['result'];
}
void _throwErrorResponse(String msg) {
throw '$msg\n\n$lastResponse\n\n${errorBuffer.toString()}'.trim();
}
}
Stream<String> transformToLines(Stream<List<int>> byteStream) {
return byteStream
.transform<String>(utf8.decoder)
.transform<String>(const LineSplitter());
}
class FlutterRunConfiguration {
const FlutterRunConfiguration({
this.withDebugger = false,
this.pauseOnExceptions = false,
this.trackWidgetCreation = true,
this.entryScript,
});
final bool withDebugger;
final bool pauseOnExceptions;
final bool trackWidgetCreation;
final String? entryScript;
}
| devtools/packages/devtools_app/test/test_infra/flutter_test_driver.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/flutter_test_driver.dart",
"repo_id": "devtools",
"token_count": 6307
} | 173 |
>// Copyright 2022 The Chromium Authors. All rights reserved.
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart
>// Use of this source code is governed by a BSD-style license that can be
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart
>// found in the LICENSE file.
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart
>
>const a = 'aaaaa';
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^^^^^^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
>
>const list1 = [];
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^ punctuation.terminator.dart
>const list2 = <String>[];
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^ keyword.operator.comparison.dart
# ^^^^^^ support.class.dart
# ^ keyword.operator.comparison.dart
# ^ punctuation.terminator.dart
>const list3 = ['', '$a'];
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.comma.dart
# ^ string.interpolated.single.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart variable.parameter.dart
# ^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
>const list4 = <String>['', '$a'];
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^ keyword.operator.comparison.dart
# ^^^^^^ support.class.dart
# ^ keyword.operator.comparison.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.comma.dart
# ^ string.interpolated.single.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart variable.parameter.dart
# ^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
>
>const set1 = {};
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^ punctuation.terminator.dart
>const set2 = <String>{};
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^ keyword.operator.comparison.dart
# ^^^^^^ support.class.dart
# ^ keyword.operator.comparison.dart
# ^ punctuation.terminator.dart
>const set3 = {'', '$a'};
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.comma.dart
# ^ string.interpolated.single.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart variable.parameter.dart
# ^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
>const set4 = <String>{'', '$a'};
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^ keyword.operator.comparison.dart
# ^^^^^^ support.class.dart
# ^ keyword.operator.comparison.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.comma.dart
# ^ string.interpolated.single.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart variable.parameter.dart
# ^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
>
>const map1 = <String, String>{};
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^ keyword.operator.comparison.dart
# ^^^^^^ support.class.dart
# ^ punctuation.comma.dart
# ^^^^^^ support.class.dart
# ^ keyword.operator.comparison.dart
# ^ punctuation.terminator.dart
>const map2 = {'': '$a'};
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^^ string.interpolated.single.dart
# ^ keyword.operator.ternary.dart
# ^ string.interpolated.single.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart variable.parameter.dart
# ^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
>const map3 = <String, String>{'': '$a'};
#^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^ keyword.operator.comparison.dart
# ^^^^^^ support.class.dart
# ^ punctuation.comma.dart
# ^^^^^^ support.class.dart
# ^ keyword.operator.comparison.dart
# ^^ string.interpolated.single.dart
# ^ keyword.operator.ternary.dart
# ^ string.interpolated.single.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart
# ^ string.interpolated.single.dart string.interpolated.expression.dart variable.parameter.dart
# ^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
| devtools/packages/devtools_app/test/test_infra/goldens/syntax_highlighting/literals.dart.golden/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/goldens/syntax_highlighting/literals.dart.golden",
"repo_id": "devtools",
"token_count": 3197
} | 174 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:stager/stager.dart';
/// To run:
/// flutter run -t test/scenes/hello.stager_app.g.dart -d macos
class HelloScene extends Scene {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Card(
child: Text('Hello, I am $title.'),
),
);
}
@override
Future<void> setUp() async {}
@override
String get title => '$runtimeType';
}
| devtools/packages/devtools_app/test/test_infra/scenes/hello.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/scenes/hello.dart",
"repo_id": "devtools",
"token_count": 211
} | 175 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:vm_service/vm_service.dart';
final httpGetResponseBodyData = [
123,
10,
32,
32,
34,
117,
115,
101,
114,
73,
100,
34,
58,
32,
49,
44,
10,
32,
32,
34,
105,
100,
34,
58,
32,
49,
44,
10,
32,
32,
34,
116,
105,
116,
108,
101,
34,
58,
32,
34,
113,
117,
105,
100,
101,
109,
32,
109,
111,
108,
101,
115,
116,
105,
97,
101,
32,
101,
110,
105,
109,
34,
10,
125,
];
final testSocket1 = WebSocket(SocketStatistic.parse(testSocket1Json)!, 0);
final Map<String, dynamic> testSocket1Json = {
'id': '10000',
'startTime': 1000000,
'endTime': 2000000,
'lastReadTime': 1800000,
'lastWriteTime': 1850000,
'address': 'InternetAddress(\'2606:4700:3037::ac43:bd8f\', IPv6)',
'port': 443,
'socketType': 'tcp',
'readBytes': 10,
'writeBytes': 15,
};
final testSocket2 = WebSocket(SocketStatistic.parse(testSocket2Json)!, 0);
final Map<String, dynamic> testSocket2Json = {
'id': '11111',
'startTime': 3000000,
// This socket has no end time.
'lastReadTime': 3500000,
'lastWriteTime': 3600000,
'address': 'InternetAddress(\'2606:4700:3037::ac43:0000\', IPv6)',
'port': 80,
'socketType': 'tcp',
'readBytes': 20,
'writeBytes': 25,
};
final testSocket3 = WebSocket(SocketStatistic.parse(testSocket3Json)!, 0);
final Map<String, dynamic> testSocket3Json = {
'id': '10000',
'startTime': 1000000,
'endTime': 2000000,
'lastReadTime': 1800000,
'lastWriteTime': 1850000,
'address': 'InternetAddress(\'2606:4700:3037::ac43:bd8f\', IPv6)',
'port': 443,
'socketType': 'tcp',
'readBytes': 100,
'writeBytes': 150,
};
final httpGetRequest = HttpProfileRequest.parse(httpGetJson)!;
final httpGet = DartIOHttpRequestData(
httpGetRequest,
requestFullDataFromVmService: false,
);
final Map<String, dynamic> httpGetJson = {
'type': 'HttpProfileRequest',
'id': '1',
'isolateId': 'isolates/2013291945734727',
'method': 'GET',
'uri': 'https://jsonplaceholder.typicode.com/albums/1',
'events': [
{'timestamp': 6326808941, 'event': 'Connection established'},
{'timestamp': 6326808965, 'event': 'Request sent'},
{'timestamp': 6327090622, 'event': 'Waiting (TTFB)'},
{'timestamp': 6327091650, 'event': 'Content Download'},
],
'startTime': 6326279935,
'endTime': 6326808974,
'request': {
'headers': {
'content-length': ['0'],
},
'connectionInfo': {
'localPort': 45648,
'remoteAddress': '2606:4700:3033::ac43:bdd9',
'remotePort': 443,
},
'contentLength': 0,
'cookies': [],
'followRedirects': true,
'maxRedirects': 5,
'method': 'GET',
'persistentConnection': true,
'uri': 'https://jsonplaceholder.typicode.com/albums/1',
'filterKey': 'HTTP/client',
},
'response': {
'startTime': 6327090749,
'headers': {
'content-encoding': ['gzip'],
'pragma': ['no-cache'],
'connection': ['keep-alive'],
'cache-control': ['max-age=43200'],
'content-type': ['application/json; charset=utf-8'],
},
'compressionState': 'HttpClientResponseCompressionState.decompressed',
'connectionInfo': {
'localPort': 45648,
'remoteAddress': '2606:4700:3033::ac43:bdd9',
'remotePort': 443,
},
'contentLength': -1,
'cookies': [],
'isRedirect': false,
'persistentConnection': true,
'reasonPhrase': 'OK',
'redirects': [],
'statusCode': 200,
'endTime': 6327091628,
},
'requestBody': [],
'responseBody': httpGetResponseBodyData,
};
final httpPostRequest = HttpProfileRequest.parse(httpPostJson)!;
final httpPost = DartIOHttpRequestData(
httpPostRequest,
requestFullDataFromVmService: false,
);
final Map<String, dynamic> httpPostJson = {
'type': 'HttpProfileRequest',
'id': '2',
'isolateId': 'isolates/979700762893215',
'method': 'POST',
'uri': 'https://jsonplaceholder.typicode.com/posts',
'events': [
{'timestamp': 2400314657, 'event': 'Connection established'},
{'timestamp': 2400320066, 'event': 'Request sent'},
{'timestamp': 2400994822, 'event': 'Waiting (TTFB)'},
{'timestamp': 2401000729, 'event': 'Content Download'},
],
'startTime': 2399492629,
'endTime': 2400321715,
'request': {
'headers': {
'transfer-encoding': [],
},
'connectionInfo': {
'localPort': 55972,
'remoteAddress': '2606:4700:3033::ac43:bdd9',
'remotePort': 443,
},
'contentLength': -1,
'cookies': [],
'followRedirects': true,
'maxRedirects': 5,
'method': 'POST',
'persistentConnection': true,
'uri': 'https://jsonplaceholder.typicode.com/posts',
'filterKey': 'HTTP/client',
},
'response': {
'startTime': 2400995842,
'headers': {
'date': ['Wed, 04 Aug 2021 07:57:26 GMT'],
'location': ['http://jsonplaceholder.typicode.com/posts/101'],
'content-length': [15],
'connection': ['keep-alive'],
'cache-control': ['no-cache'],
'content-type': ['application/json; charset=utf-8'],
'x-powered-by': ['Express'],
'expires': [-1],
},
'compressionState': 'HttpClientResponseCompressionState.notCompressed',
'connectionInfo': {
'localPort': 55972,
'remoteAddress': '2606:4700:3033::ac43:bdd9',
'remotePort': 443,
},
'contentLength': 15,
'cookies': [],
'isRedirect': false,
'persistentConnection': true,
'reasonPhrase': 'Created',
'redirects': [],
'statusCode': 201,
'endTime': 2401000670,
},
'requestBody': httpPostRequestBodyData,
'responseBody': httpPostResponseBodyData,
};
final httpPostRequestBodyData = [
...[123, 10, 32, 34, 116, 105, 116, 108, 101, 34, 58, 32, 34, 102, 111, 111],
...[34, 44, 32, 34, 98, 111, 100, 121, 34, 58, 32, 34, 98, 97, 114, 34],
...[44, 32, 34, 117, 115, 101, 114, 73, 100, 34, 58, 32, 49, 10, 125, 10, 32],
];
final httpPostResponseBodyData = [
...[123, 10, 32, 32, 34, 105, 100, 34, 58, 32, 49, 48, 49, 10, 125],
];
final httpPutRequest = HttpProfileRequest.parse(httpPutJson)!;
final httpPut = DartIOHttpRequestData(
httpPutRequest,
requestFullDataFromVmService: false,
);
final Map<String, dynamic> httpPutJson = {
'type': 'HttpProfileRequest',
'id': '3',
'isolateId': 'isolates/4447876918484683',
'method': 'PUT',
'uri': 'https://jsonplaceholder.typicode.com/posts/1',
'events': [
{'timestamp': 1205855316, 'event': 'Connection established'},
{'timestamp': 1205858323, 'event': 'Request sent'},
{'timestamp': 1206602445, 'event': 'Waiting (TTFB)'},
{'timestamp': 1206609213, 'event': 'Content Download'},
],
'startTime': 1205283313,
'endTime': 1205859179,
'request': {
'headers': {
'transfer-encoding': [],
},
'connectionInfo': {
'localPort': 43684,
'remoteAddress': '2606:4700:3033::ac43:bdd9',
'remotePort': 443,
},
'contentLength': -1,
'cookies': [],
'followRedirects': true,
'maxRedirects': 5,
'method': 'PUT',
'persistentConnection': true,
'uri': 'https://jsonplaceholder.typicode.com/posts/1',
'filterKey': 'HTTP/client',
},
'response': {
'startTime': 1206603670,
'headers': {
'connection': ['keep-alive'],
'cache-control': ['no-cache'],
'date': ['Wed, 04 Aug 2021 08:57:24 GMT'],
'content-type': ['application/json; charset=utf-8'],
'pragma': ['no-cache'],
'access-control-allow-credentials': [true],
'content-length': [13],
'expires': [-1],
},
'compressionState': 'HttpClientResponseCompressionState.notCompressed',
'connectionInfo': {
'localPort': 43684,
'remoteAddress': '2606:4700:3033::ac43:bdd9',
'remotePort': 443,
},
'contentLength': 13,
'cookies': [],
'isRedirect': false,
'persistentConnection': true,
'reasonPhrase': 'OK',
'redirects': [],
'statusCode': 200,
'endTime': 1206609144,
},
'requestBody': httpPutRequestBodyData,
'responseBody': httpPutResponseBodyData,
};
final httpPutRequestBodyData = [
...[32, 32, 32, 32, 123, 10, 32, 32, 32, 32, 32, 32, 116, 105, 116, 108],
...[101, 58, 32, 39, 102, 111, 111, 39, 44, 10, 32, 32, 32, 32, 32, 32],
...[98, 111, 100, 121, 58, 32, 39, 98, 97, 114, 39, 44, 10, 32, 32, 32],
...[32, 32, 32, 117, 115, 101, 114, 73, 100, 58, 32, 49, 44, 10, 32, 32],
...[32, 32, 125, 10, 32, 32, 32, 32],
];
final httpPutResponseBodyData = [
...[123, 10, 32, 32, 34, 105, 100, 34, 58, 32, 49, 48, 49, 10, 125],
];
final httpPatchRequest = HttpProfileRequest.parse(httpPatchJson)!;
final httpPatch = DartIOHttpRequestData(
httpPatchRequest,
requestFullDataFromVmService: false,
);
final Map<String, dynamic> httpPatchJson = {
'type': 'HttpProfileRequest',
'id': '4',
'isolateId': 'isolates/4447876918484683',
'method': 'PATCH',
'uri': 'https://jsonplaceholder.typicode.com/posts/1',
'events': [
{'timestamp': 1910722654, 'event': 'Connection established'},
{'timestamp': 1910722783, 'event': 'Request sent'},
{'timestamp': 1911415225, 'event': 'Waiting (TTFB)'},
{'timestamp': 1911421003, 'event': 'Content Download'},
],
'startTime': 1910177192,
'endTime': 1910722856,
'request': {
'headers': {
'transfer-encoding': [],
},
'connectionInfo': {
'localPort': 43864,
'remoteAddress': '2606:4700:3033::ac43:bdd9',
'remotePort': 443,
},
'contentLength': -1,
'cookies': [],
'followRedirects': true,
'maxRedirects': 5,
'method': 'PATCH',
'persistentConnection': true,
'uri': 'https://jsonplaceholder.typicode.com/posts/1',
'filterKey': 'HTTP/client',
},
'response': {
'startTime': 1911415812,
'headers': {
'connection': ['keep-alive'],
'cache-control': ['no-cache'],
'transfer-encoding': ['chunked'],
'date': ['Wed, 04 Aug 2021 09:09:09 GMT'],
'content-encoding': ['gzip'],
'content-type': ['application/json; charset=utf-8'],
'pragma': ['no-cache'],
'expires': [-1],
},
'compressionState': 'HttpClientResponseCompressionState.decompressed',
'connectionInfo': {
'localPort': 43864,
'remoteAddress': '2606:4700:3033::ac43:bdd9',
'remotePort': 443,
},
'contentLength': -1,
'cookies': [],
'isRedirect': false,
'persistentConnection': true,
'reasonPhrase': 'OK',
'redirects': [],
'statusCode': 200,
'endTime': 1911420918,
},
'requestBody': httpPatchRequestBodyData,
'responseBody': httpPatchResponseBodyData,
};
final httpPatchRequestBodyData = [
...[32, 32, 32, 32, 123, 10, 32, 32, 32, 32, 32, 32, 116, 105, 116, 108],
...[101, 58, 32, 39, 102, 111, 111, 39, 44, 10, 32, 32, 32, 32, 32, 32],
...[98, 111, 100, 121, 58, 32, 39, 98, 97, 114, 39, 44, 10, 32, 32, 32],
...[32, 32, 32, 117, 115, 101, 114, 73, 100, 58, 32, 49, 44, 10, 32, 32],
...[32, 32, 125, 10, 32, 32, 32, 32],
];
final httpPatchResponseBodyData = [
...[123, 10, 32, 32, 34, 116, 105, 116, 108, 101, 34, 58, 32, 34, 102, 111],
...[111, 34, 44, 10, 32, 32, 34, 98, 111, 100, 121, 34, 58, 32, 34, 98, 97],
...[114, 34, 44, 10, 32, 32, 34, 117, 115, 101, 114, 73, 100, 34, 58, 32, 49],
...[10, 125],
];
final httpGetWithErrorRequest = HttpProfileRequest.parse(httpGetWithErrorJson)!;
final httpGetWithError = DartIOHttpRequestData(
httpGetWithErrorRequest,
requestFullDataFromVmService: false,
);
final Map<String, dynamic> httpGetWithErrorJson = {
'type': '@HttpProfileRequest',
'id': '5',
'isolateId': 'isolates/1939772779732043',
'method': 'GET',
'uri': 'https://www.examplez.com/1',
'events': [],
'startTime': 5385227316,
'endTime': 5387256813,
'request': {
'error': 'HandshakeException: Connection terminated during handshake',
},
};
final httpWsHandshakeRequest = HttpProfileRequest.parse(httpWsHandshakeJson)!;
final httpWsHandshake = DartIOHttpRequestData(
httpWsHandshakeRequest,
requestFullDataFromVmService: false,
);
final Map<String, dynamic> httpWsHandshakeJson = {
'type': 'HttpProfileRequest',
'id': '6',
'isolateId': 'isolates/1350291957483171',
'method': 'GET',
'uri': 'http://localhost:8080',
'events': [
{'timestamp': 8140247076, 'event': 'Connection established'},
{'timestamp': 8140247156, 'event': 'Request sent'},
{'timestamp': 8140261573, 'event': 'Waiting (TTFB)'},
],
'startTime': 8140222102,
'endTime': 8140247377,
'request': {
'headers': {
'content-length': ['0'],
},
'connectionInfo': {
'localPort': 56744,
'remoteAddress': '127.0.0.1',
'remotePort': 8080,
},
'contentLength': 0,
'cookies': [],
'followRedirects': true,
'maxRedirects': 5,
'method': 'GET',
'persistentConnection': true,
'uri': 'http://localhost:8080',
'filterKey': 'HTTP/client',
},
'response': {
'startTime': 8140262898,
'headers': {
'connection': ['Upgrade'],
'upgrade': ['websocket'],
'content-length': [0],
'sec-websocket-version': [13],
'sec-websocket-accept': ['JF5SBCGrfyYAoLKzvj6A0ZVpk6c='],
},
'compressionState': 'HttpClientResponseCompressionState.notCompressed',
'connectionInfo': {
'localPort': 56744,
'remoteAddress': '127.0.0.1',
'remotePort': 8080,
},
'contentLength': 0,
'cookies': [],
'isRedirect': false,
'persistentConnection': true,
'reasonPhrase': 'Switching Protocols',
'redirects': [],
'statusCode': 101,
'endTime': 8140263470,
'error': 'Socket has been detached',
},
'requestBody': [],
'responseBody': [],
};
final Map<String, dynamic> httpGetPendingJson = {
'type': 'HttpProfileRequest',
'id': '7',
'isolateId': 'isolates/2013291945734727',
'method': 'GET',
'uri': 'https://jsonplaceholder.typicode.com/albums/10',
'events': [
{'timestamp': 6326808941, 'event': 'Connection established'},
{'timestamp': 6326808965, 'event': 'Request sent'},
{'timestamp': 6327090622, 'event': 'Waiting (TTFB)'},
{'timestamp': 6327091650, 'event': 'Content Download'},
],
'startTime': 6326279935,
'endTime': 6326808974,
'request': {
'headers': {
'content-length': ['0'],
},
'connectionInfo': {
'localPort': 45648,
'remoteAddress': '2606:4700:3033::ac43:bdd9',
'remotePort': 443,
},
'contentLength': 0,
'cookies': [],
'followRedirects': true,
'maxRedirects': 5,
'method': 'GET',
'persistentConnection': true,
'uri': 'https://jsonplaceholder.typicode.com/albums/1',
'filterKey': 'HTTP/client',
},
'requestBody': [],
};
| devtools/packages/devtools_app/test/test_infra/test_data/network.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/test_data/network.dart",
"repo_id": "devtools",
"token_count": 6221
} | 176 |
// Copyright 2020 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is copied from package:flutter/test/rendering_tester.dart
// and is convenient for adding tests to render object behavior similar to
// existing tests implemented in package:flutter.
import 'dart:async';
import 'dart:ui' show SemanticsUpdate;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart'
show EnginePhase, TestDefaultBinaryMessengerBinding, fail;
export 'package:flutter/foundation.dart' show FlutterError, FlutterErrorDetails;
export 'package:flutter_test/flutter_test.dart'
show EnginePhase, TestDefaultBinaryMessengerBinding;
class TestRenderingFlutterBinding extends BindingBase
with
SchedulerBinding,
ServicesBinding,
GestureBinding,
PaintingBinding,
SemanticsBinding,
RendererBinding,
TestDefaultBinaryMessengerBinding {
/// Creates a binding for testing rendering library functionality.
///
/// If [onErrors] is not null, it is called if [FlutterError] caught any errors
/// while drawing the frame. If [onErrors] is null and [FlutterError] caught at least
/// one error, this function fails the test. A test may override [onErrors] and
/// inspect errors using [takeFlutterErrorDetails].
///
/// Errors caught between frames will cause the test to fail unless
/// [FlutterError.onError] has been overridden.
TestRenderingFlutterBinding({this.onErrors}) {
FlutterError.onError = (FlutterErrorDetails details) {
FlutterError.dumpErrorToConsole(details);
Zone.current.parent!
.handleUncaughtError(details.exception, details.stack!);
};
}
/// The current [TestRenderingFlutterBinding], if one has been created.
///
/// Provides access to the features exposed by this binding. The binding must
/// be initialized before using this getter; this is typically done by calling
/// [TestRenderingFlutterBinding.ensureInitialized].
static TestRenderingFlutterBinding get instance =>
BindingBase.checkInstance(_instance);
static TestRenderingFlutterBinding? _instance;
@override
void initInstances() {
super.initInstances();
_instance = this;
// TODO(goderbauer): Create (fake) window if embedder doesn't provide an implicit view.
assert(platformDispatcher.implicitView != null);
_renderView = initRenderView(platformDispatcher.implicitView!);
}
@override
RenderView get renderView => _renderView;
late RenderView _renderView;
@override
PipelineOwner get pipelineOwner => rootPipelineOwner;
/// Creates a [RenderView] object to be the root of the
/// [RenderObject] rendering tree, and initializes it so that it
/// will be rendered when the next frame is requested.
///
/// Called automatically when the binding is created.
RenderView initRenderView(FlutterView view) {
final RenderView renderView = RenderView(view: view);
rootPipelineOwner.rootNode = renderView;
addRenderView(renderView);
renderView.prepareInitialFrame();
return renderView;
}
@override
PipelineOwner createRootPipelineOwner() {
return PipelineOwner(
onSemanticsOwnerCreated: () {
renderView.scheduleInitialSemantics();
},
onSemanticsUpdate: (SemanticsUpdate update) {
renderView.updateSemantics(update);
},
onSemanticsOwnerDisposed: () {
renderView.clearSemantics();
},
);
}
/// Creates and initializes the binding. This function is
/// idempotent; calling it a second time will just return the
/// previously-created instance.
static TestRenderingFlutterBinding ensureInitialized({
VoidCallback? onErrors,
}) {
if (_instance != null) {
return _instance!;
}
return TestRenderingFlutterBinding(onErrors: onErrors);
}
final List<FlutterErrorDetails> _errors = <FlutterErrorDetails>[];
/// A function called after drawing a frame if [FlutterError] caught any errors.
///
/// This function is expected to inspect these errors and decide whether they
/// are expected or not. Use [takeFlutterErrorDetails] to take one error at a
/// time, or [takeAllFlutterErrorDetails] to iterate over all errors.
VoidCallback? onErrors;
/// Returns the error least recently caught by [FlutterError] and removes it
/// from the list of captured errors.
///
/// Returns null if no errors were captures, or if the list was exhausted by
/// calling this method repeatedly.
FlutterErrorDetails? takeFlutterErrorDetails() {
if (_errors.isEmpty) {
return null;
}
return _errors.removeAt(0);
}
/// Returns all error details caught by [FlutterError] from least recently caught to
/// most recently caught, and removes them from the list of captured errors.
///
/// The returned iterable takes errors lazily. If, for example, you iterate over 2
/// errors, but there are 5 errors total, this binding will still fail the test.
/// Tests are expected to take and inspect all errors.
Iterable<FlutterErrorDetails> takeAllFlutterErrorDetails() sync* {
// sync* and yield are used for lazy evaluation. Otherwise, the list would be
// drained eagerly and allow a test pass with unexpected errors.
while (_errors.isNotEmpty) {
yield _errors.removeAt(0);
}
}
/// Returns all exceptions caught by [FlutterError] from least recently caught to
/// most recently caught, and removes them from the list of captured errors.
///
/// The returned iterable takes errors lazily. If, for example, you iterate over 2
/// errors, but there are 5 errors total, this binding will still fail the test.
/// Tests are expected to take and inspect all errors.
Iterable<Object?> takeAllFlutterExceptions() sync* {
// sync* and yield are used for lazy evaluation. Otherwise, the list would be
// drained eagerly and allow a test pass with unexpected errors.
while (_errors.isNotEmpty) {
yield _errors.removeAt(0).exception;
}
}
EnginePhase phase = EnginePhase.composite;
/// Pumps a frame and runs its entire life cycle.
///
/// This method runs all of the [SchedulerPhase]s in a frame, this is useful
/// to test [SchedulerPhase.postFrameCallbacks].
void pumpCompleteFrame() {
final FlutterExceptionHandler? oldErrorHandler = FlutterError.onError;
FlutterError.onError = _errors.add;
try {
TestRenderingFlutterBinding.instance.handleBeginFrame(null);
TestRenderingFlutterBinding.instance.handleDrawFrame();
} finally {
FlutterError.onError = oldErrorHandler;
if (_errors.isNotEmpty) {
if (onErrors != null) {
onErrors!();
if (_errors.isNotEmpty) {
_errors.forEach(FlutterError.dumpErrorToConsole);
fail(
'There are more errors than the test inspected using TestRenderingFlutterBinding.takeFlutterErrorDetails.',
);
}
} else {
_errors.forEach(FlutterError.dumpErrorToConsole);
fail(
'Caught error while rendering frame. See preceding logs for details.',
);
}
}
}
}
@override
void drawFrame() {
assert(
phase != EnginePhase.build,
'rendering_tester does not support testing the build phase; use flutter_test instead',
);
final FlutterExceptionHandler? oldErrorHandler = FlutterError.onError;
FlutterError.onError = _errors.add;
try {
rootPipelineOwner.flushLayout();
if (phase == EnginePhase.layout) {
return;
}
rootPipelineOwner.flushCompositingBits();
if (phase == EnginePhase.compositingBits) {
return;
}
rootPipelineOwner.flushPaint();
if (phase == EnginePhase.paint) {
return;
}
for (final RenderView renderView in renderViews) {
renderView.compositeFrame();
}
if (phase == EnginePhase.composite) {
return;
}
rootPipelineOwner.flushSemantics();
if (phase == EnginePhase.flushSemantics) {
return;
}
assert(
phase == EnginePhase.flushSemantics ||
phase == EnginePhase.sendSemanticsUpdate,
);
} finally {
FlutterError.onError = oldErrorHandler;
if (_errors.isNotEmpty) {
if (onErrors != null) {
onErrors!();
if (_errors.isNotEmpty) {
_errors.forEach(FlutterError.dumpErrorToConsole);
fail(
'There are more errors than the test inspected using TestRenderingFlutterBinding.takeFlutterErrorDetails.',
);
}
} else {
_errors.forEach(FlutterError.dumpErrorToConsole);
fail(
'Caught error while rendering frame. See preceding logs for details.',
);
}
}
}
}
}
/// Place the box in the render tree, at the given size and with the given
/// alignment on the screen.
///
/// If you've updated `box` and want to lay it out again, use [pumpFrame].
///
/// Once a particular [RenderBox] has been passed to [layout], it cannot easily
/// be put in a different place in the tree or passed to [layout] again, because
/// [layout] places the given object into another [RenderBox] which you would
/// need to unparent it from (but that box isn't itself made available).
///
/// The EnginePhase must not be [EnginePhase.build], since the rendering layer
/// has no build phase.
///
/// If `onErrors` is not null, it is set as [TestRenderingFlutterBinding.onError].
void layout(
RenderBox box, {
// If you want to just repump the last box, call pumpFrame().
BoxConstraints? constraints,
Alignment alignment = Alignment.center,
EnginePhase phase = EnginePhase.layout,
VoidCallback? onErrors,
}) {
assert(
box.parent == null,
); // We stick the box in another, so you can't reuse it easily, sorry.
TestRenderingFlutterBinding.instance.renderView.child = null;
if (constraints != null) {
box = RenderPositionedBox(
alignment: alignment,
child: RenderConstrainedBox(
additionalConstraints: constraints,
child: box,
),
);
}
TestRenderingFlutterBinding.instance.renderView.child = box;
pumpFrame(phase: phase, onErrors: onErrors);
}
/// Pumps a single frame.
///
/// If `onErrors` is not null, it is set as [TestRenderingFlutterBinding.onError].
void pumpFrame({
EnginePhase phase = EnginePhase.layout,
VoidCallback? onErrors,
}) {
assert(
TestRenderingFlutterBinding.instance.renderView.child != null,
); // call layout() first!
if (onErrors != null) {
TestRenderingFlutterBinding.instance.onErrors = onErrors;
}
TestRenderingFlutterBinding.instance.phase = phase;
TestRenderingFlutterBinding.instance.drawFrame();
}
class TestCallbackPainter extends CustomPainter {
const TestCallbackPainter({required this.onPaint});
final VoidCallback onPaint;
@override
void paint(Canvas canvas, Size size) {
onPaint();
}
@override
bool shouldRepaint(TestCallbackPainter oldPainter) => true;
}
class RenderSizedBox extends RenderBox {
RenderSizedBox(this._size);
final Size _size;
@override
double computeMinIntrinsicWidth(double height) {
return _size.width;
}
@override
double computeMaxIntrinsicWidth(double height) {
return _size.width;
}
@override
double computeMinIntrinsicHeight(double width) {
return _size.height;
}
@override
double computeMaxIntrinsicHeight(double width) {
return _size.height;
}
@override
bool get sizedByParent => true;
@override
void performResize() {
size = constraints.constrain(_size);
}
@override
void performLayout() {}
@override
bool hitTestSelf(Offset position) => true;
}
class FakeTickerProvider implements TickerProvider {
@override
Ticker createTicker(TickerCallback onTick, [bool disableAnimations = false]) {
return FakeTicker();
}
}
class FakeTicker implements Ticker {
@override
bool muted = false;
@override
void absorbTicker(Ticker originalTicker) {}
@override
String? get debugLabel => null;
@override
bool get isActive => throw UnimplementedError();
@override
bool get isTicking => throw UnimplementedError();
@override
bool get scheduled => throw UnimplementedError();
@override
bool get shouldScheduleTick => throw UnimplementedError();
@override
void dispose() {}
@override
void scheduleTick({bool rescheduling = false}) {}
@override
TickerFuture start() {
throw UnimplementedError();
}
@override
void stop({bool canceled = false}) {}
@override
void unscheduleTick() {}
@override
String toString({bool debugIncludeStack = false}) => super.toString();
@override
DiagnosticsNode describeForError(String name) {
return DiagnosticsProperty<Ticker>(
name,
this,
style: DiagnosticsTreeStyle.errorProperty,
);
}
}
class TestClipPaintingContext extends PaintingContext {
TestClipPaintingContext() : super(ContainerLayer(), Rect.zero);
@override
ClipRectLayer? pushClipRect(
bool needsCompositing,
Offset offset,
Rect clipRect,
PaintingContextCallback painter, {
Clip clipBehavior = Clip.hardEdge,
ClipRectLayer? oldLayer,
}) {
this.clipBehavior = clipBehavior;
return null;
}
Clip clipBehavior = Clip.none;
}
class TestPushLayerPaintingContext extends PaintingContext {
TestPushLayerPaintingContext() : super(ContainerLayer(), Rect.zero);
final List<ContainerLayer> pushedLayers = <ContainerLayer>[];
@override
void pushLayer(
ContainerLayer childLayer,
PaintingContextCallback painter,
Offset offset, {
Rect? childPaintBounds,
}) {
pushedLayers.add(childLayer);
super.pushLayer(
childLayer,
painter,
offset,
childPaintBounds: childPaintBounds,
);
}
}
// Absorbs errors that don't have "overflowed" in their error details.
void absorbOverflowedErrors() {
final Iterable<FlutterErrorDetails> errorDetails =
TestRenderingFlutterBinding.instance.takeAllFlutterErrorDetails();
final Iterable<FlutterErrorDetails> filtered =
errorDetails.where((FlutterErrorDetails details) {
return !details.toString().contains('overflowed');
});
if (filtered.isNotEmpty) {
filtered.forEach(FlutterError.reportError);
}
}
// Reports any FlutterErrors.
void expectNoFlutterErrors() {
final Iterable<FlutterErrorDetails> errorDetails =
TestRenderingFlutterBinding.instance.takeAllFlutterErrorDetails();
errorDetails.forEach(FlutterError.reportError);
}
RenderConstrainedBox get box200x200 => RenderConstrainedBox(
additionalConstraints:
const BoxConstraints.tightFor(height: 200.0, width: 200.0),
);
| devtools/packages/devtools_app/test/test_infra/utils/rendering_tester.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/utils/rendering_tester.dart",
"repo_id": "devtools",
"token_count": 5058
} | 177 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/screens/vm_developer/object_inspector/vm_simple_list_display.dart';
import 'package:devtools_app/src/screens/vm_developer/vm_developer_common_widgets.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:vm_service/vm_service.dart';
import '../vm_developer_test_utils.dart';
void main() {
late MockSubtypeTestCacheObject mockSubtypeTestCacheObject;
const windowSize = Size(4000.0, 4000.0);
setUp(() {
setUpMockScriptManager();
setGlobal(BreakpointManager, BreakpointManager());
setGlobal(IdeTheme, IdeTheme());
setGlobal(ServiceConnectionManager, FakeServiceConnectionManager());
setGlobal(
DevToolsEnvironmentParameters,
ExternalDevToolsEnvironmentParameters(),
);
setGlobal(PreferencesController, PreferencesController());
mockSubtypeTestCacheObject = MockSubtypeTestCacheObject();
mockVmObject(mockSubtypeTestCacheObject);
final cache = Instance(id: 'inst-2', length: 0, elements: []);
when(mockSubtypeTestCacheObject.obj).thenReturn(
SubtypeTestCache(
id: 'subtype-test-cache-id',
size: 64,
cache: cache,
classRef: ClassRef(id: 'cls-id-2', name: 'SubtypeTestCache'),
json: {},
),
);
when(mockSubtypeTestCacheObject.elementsAsInstance).thenReturn(cache);
});
group('Subtype test cache display test', () {
testWidgetsWithWindowSize(
'basic layout',
windowSize,
(WidgetTester tester) async {
await tester.pumpWidget(
wrap(
VmSimpleListDisplay(
vmObject: mockSubtypeTestCacheObject,
controller: ObjectInspectorViewController(),
),
),
);
await tester.pumpAndSettle();
expect(find.byType(VmObjectDisplayBasicLayout), findsOneWidget);
expect(find.byType(VMInfoCard), findsOneWidget);
expect(find.text('General Information'), findsOneWidget);
expect(find.text('Object Class:'), findsOneWidget);
expect(find.text('SubtypeTestCache'), findsOneWidget);
expect(find.text('Shallow Size:'), findsOneWidget);
expect(find.text('Retained Size:'), findsOneWidget);
expect(find.text('64 B'), findsOneWidget);
expect(find.byType(RequestableSizeWidget), findsNWidgets(2));
expect(find.byType(RetainingPathWidget), findsOneWidget);
expect(find.byType(InboundReferencesTree), findsOneWidget);
expect(find.byType(ExpansionTileInstanceList), findsOneWidget);
},
);
});
}
| devtools/packages/devtools_app/test/vm_developer/object_inspector/vm_simple_list_display_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/vm_developer/object_inspector/vm_simple_list_display_test.dart",
"repo_id": "devtools",
"token_count": 1147
} | 178 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart' as devtools_shared_ui;
import 'package:flutter/material.dart';
/// Example of using a [DevToolsDialog] widget from
/// 'package:devtools_app_shared/ui.dart'.
class MyDialog extends StatelessWidget {
const MyDialog({super.key});
@override
Widget build(BuildContext context) {
return devtools_shared_ui.DevToolsDialog(
title: const devtools_shared_ui.DialogTitleText('My Cool Dialog'),
content: const Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Here is the body of my dialog.'),
SizedBox(height: devtools_shared_ui.denseSpacing),
Text('It communicates something important'),
],
),
actions: [
devtools_shared_ui.DialogTextButton(
onPressed: () {
// Do someting and then remove the dialog.
Navigator.of(context).pop(devtools_shared_ui.dialogDefaultContext);
},
child: const Text('DO SOMETHING'),
),
const devtools_shared_ui.DialogCancelButton(),
],
);
}
}
| devtools/packages/devtools_app_shared/example/ui/dialog_example.dart/0 | {
"file_path": "devtools/packages/devtools_app_shared/example/ui/dialog_example.dart",
"repo_id": "devtools",
"token_count": 511
} | 179 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'package:flutter/material.dart';
import '../utils/utils.dart';
import 'theme/theme.dart';
/// Create a bordered, fixed-height header area with a title and optional child
/// on the right-hand side.
///
/// This is typically used as a title for a logical area of the screen.
class AreaPaneHeader extends StatelessWidget implements PreferredSizeWidget {
const AreaPaneHeader({
Key? key,
required this.title,
this.maxLines = 1,
this.actions = const [],
this.leftPadding = defaultSpacing,
this.rightPadding = densePadding,
this.tall = false,
this.dense = false,
this.roundedTopBorder = true,
this.includeTopBorder = true,
this.includeBottomBorder = true,
this.includeLeftBorder = false,
this.includeRightBorder = false,
}) : super(key: key);
final Widget title;
final int maxLines;
final List<Widget> actions;
final double leftPadding;
final double rightPadding;
final bool tall;
final bool dense;
// TODO(kenz): add support for a non uniform border to allow for
// rounded corners when some border sides are missing. This is a
// challenge for Flutter since it is not supported out of the box:
// https://github.com/flutter/flutter/issues/12583.
/// Whether to use a full border with rounded top corners consistent with
/// material 3 styling.
///
/// When true, the rounded border will take precedence over any value
/// specified by [includeTopBorder], [includeBottomBorder],
/// [includeLeftBorder], and [includeRightBorder].
final bool roundedTopBorder;
final bool includeTopBorder;
final bool includeBottomBorder;
final bool includeLeftBorder;
final bool includeRightBorder;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final borderSide = defaultBorderSide(theme);
final decoration = !roundedTopBorder
? BoxDecoration(
border: Border(
top: includeTopBorder ? borderSide : BorderSide.none,
bottom: includeBottomBorder ? borderSide : BorderSide.none,
left: includeLeftBorder ? borderSide : BorderSide.none,
right: includeRightBorder ? borderSide : BorderSide.none,
),
color: theme.colorScheme.surface,
)
: null;
Widget container = Container(
decoration: decoration,
padding: EdgeInsets.only(left: leftPadding, right: rightPadding),
alignment: Alignment.centerLeft,
child: Row(
children: [
Expanded(
child: DefaultTextStyle(
maxLines: maxLines,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.titleSmall!,
child: title,
),
),
...actions,
],
),
);
if (roundedTopBorder) {
container = RoundedOutlinedBorder.onlyTop(child: container);
}
return SizedBox.fromSize(
size: preferredSize,
child: container,
);
}
@override
Size get preferredSize {
return Size.fromHeight(
tall ? defaultHeaderHeight + 2 * densePadding : defaultHeaderHeight,
);
}
}
/// A blank, drop-in replacement for [AreaPaneHeader].
///
/// Acts as an empty header widget with zero size that is compatible with
/// interfaces that expect a [PreferredSizeWidget].
final class BlankHeader extends StatelessWidget implements PreferredSizeWidget {
const BlankHeader({super.key});
@override
Widget build(BuildContext context) {
return Container();
}
@override
Size get preferredSize => Size.zero;
}
/// Wraps [child] in a rounded border with default styling.
///
/// This border can optionally be made non-uniform by setting any of
/// [showTop], [showBottom], [showLeft] or [showRight] to false.
///
/// If [clip] is true, the child will be wrapped in a [ClipRRect] to ensure the
/// rounded corner of the border is drawn as expected. This should not be
/// necessary in most cases.
final class RoundedOutlinedBorder extends StatelessWidget {
const RoundedOutlinedBorder({
super.key,
this.showTopLeft = true,
this.showTopRight = true,
this.showBottomLeft = true,
this.showBottomRight = true,
this.clip = false,
required this.child,
});
factory RoundedOutlinedBorder.onlyTop({
required Widget? child,
bool clip = false,
}) =>
RoundedOutlinedBorder(
showBottomLeft: false,
showBottomRight: false,
clip: clip,
child: child,
);
factory RoundedOutlinedBorder.onlyBottom({
required Widget? child,
bool clip = false,
}) =>
RoundedOutlinedBorder(
showTopLeft: false,
showTopRight: false,
clip: clip,
child: child,
);
final bool showTopLeft;
final bool showTopRight;
final bool showBottomLeft;
final bool showBottomRight;
/// Whether we should clip [child].
///
/// This should be used sparingly and only where necessary for performance
/// reasons.
final bool clip;
final Widget? child;
@override
Widget build(BuildContext context) {
final borderRadius = BorderRadius.only(
topLeft: showTopLeft ? defaultRadius : Radius.zero,
topRight: showTopRight ? defaultRadius : Radius.zero,
bottomLeft: showBottomLeft ? defaultRadius : Radius.zero,
bottomRight: showBottomRight ? defaultRadius : Radius.zero,
);
var child = this.child;
if (clip) {
child = ClipRRect(
borderRadius: borderRadius,
clipBehavior: Clip.hardEdge,
child: child,
);
}
return Container(
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).focusColor),
borderRadius: borderRadius,
),
child: child,
);
}
}
/// Wraps [child] in a border with default styling.
///
/// This border can optionally be made non-uniform by setting any of
/// [showTop], [showBottom], [showLeft] or [showRight] to false.
final class OutlineDecoration extends StatelessWidget {
const OutlineDecoration({
Key? key,
this.child,
this.showTop = true,
this.showBottom = true,
this.showLeft = true,
this.showRight = true,
}) : super(key: key);
factory OutlineDecoration.onlyBottom({required Widget? child}) =>
OutlineDecoration(
showTop: false,
showLeft: false,
showRight: false,
child: child,
);
factory OutlineDecoration.onlyTop({required Widget? child}) =>
OutlineDecoration(
showBottom: false,
showLeft: false,
showRight: false,
child: child,
);
factory OutlineDecoration.onlyLeft({required Widget? child}) =>
OutlineDecoration(
showBottom: false,
showTop: false,
showRight: false,
child: child,
);
factory OutlineDecoration.onlyRight({required Widget? child}) =>
OutlineDecoration(
showBottom: false,
showTop: false,
showLeft: false,
child: child,
);
final bool showTop;
final bool showBottom;
final bool showLeft;
final bool showRight;
final Widget? child;
@override
Widget build(BuildContext context) {
final color = Theme.of(context).focusColor;
final border = BorderSide(color: color);
return Container(
decoration: BoxDecoration(
border: Border(
left: showLeft ? border : BorderSide.none,
right: showRight ? border : BorderSide.none,
top: showTop ? border : BorderSide.none,
bottom: showBottom ? border : BorderSide.none,
),
),
child: child,
);
}
}
/// [BorderSide] styled with the DevTools default color palette.
BorderSide defaultBorderSide(ThemeData theme) {
return BorderSide(color: theme.focusColor);
}
/// Convenience [Divider] with [Padding] that provides a good divider in forms.
final class PaddedDivider extends StatelessWidget {
const PaddedDivider({
Key? key,
this.padding = const EdgeInsets.only(bottom: 10.0),
}) : super(key: key);
const PaddedDivider.thin({super.key})
: padding = const EdgeInsets.only(bottom: 4.0);
const PaddedDivider.noPadding({super.key}) : padding = EdgeInsets.zero;
PaddedDivider.vertical({super.key, double padding = densePadding})
: padding = EdgeInsets.symmetric(vertical: padding);
/// The padding to place around the divider.
final EdgeInsets padding;
@override
Widget build(BuildContext context) {
return Padding(
padding: padding,
child: const Divider(thickness: 1.0),
);
}
}
/// A button with default DevTools styling and analytics handling.
///
/// * `onPressed`: The callback to be called upon pressing the button.
/// * `minScreenWidthForTextBeforeScaling`: The minimum width the button can be before the text is
/// omitted.
class DevToolsButton extends StatelessWidget {
const DevToolsButton({
Key? key,
required this.onPressed,
this.icon,
this.label,
this.tooltip,
this.color,
this.minScreenWidthForTextBeforeScaling,
this.elevated = false,
this.outlined = true,
this.tooltipPadding,
}) : assert(
label != null || icon != null,
'Either icon or label must be specified.',
),
super(key: key);
factory DevToolsButton.iconOnly({
required IconData icon,
String? tooltip,
VoidCallback? onPressed,
bool outlined = true,
}) {
return DevToolsButton(
icon: icon,
outlined: outlined,
tooltip: tooltip,
onPressed: onPressed,
);
}
final IconData? icon;
final String? label;
final String? tooltip;
final Color? color;
final VoidCallback? onPressed;
final double? minScreenWidthForTextBeforeScaling;
/// Whether this icon label button should use an elevated button style.
final bool elevated;
/// Whether this icon label button should use an outlined button style.
final bool outlined;
final EdgeInsetsGeometry? tooltipPadding;
@override
Widget build(BuildContext context) {
var tooltip = this.tooltip;
if (label == null) {
return SizedBox(
// This is required to force the button size.
height: defaultButtonHeight,
width: defaultButtonHeight,
child: maybeWrapWithTooltip(
tooltip: tooltip,
tooltipPadding: tooltipPadding,
child: outlined
? IconButton.outlined(
onPressed: onPressed,
iconSize: defaultIconSize,
icon: Icon(icon),
)
: IconButton(
onPressed: onPressed,
iconSize: defaultIconSize,
icon: Icon(
icon,
),
),
),
);
}
final colorScheme = Theme.of(context).colorScheme;
var textColor = color;
if (textColor == null && elevated) {
textColor =
onPressed == null ? colorScheme.onSurface : colorScheme.onPrimary;
}
final iconLabel = MaterialIconLabel(
label: label!,
iconData: icon,
minScreenWidthForTextBeforeScaling: minScreenWidthForTextBeforeScaling,
color: textColor,
);
// If we hid the label due to a small screen width and the button does not
// have a tooltip, use the label as a tooltip.
final labelHidden =
!isScreenWiderThan(context, minScreenWidthForTextBeforeScaling);
if (labelHidden && tooltip == null) {
tooltip = label;
}
if (elevated) {
return SizedBox(
// This is required to force the button size.
height: defaultButtonHeight,
child: maybeWrapWithTooltip(
tooltip: tooltip,
tooltipPadding: tooltipPadding,
child: ElevatedButton(
onPressed: onPressed,
child: iconLabel,
),
),
);
}
// TODO(kenz): this SizedBox wrapper should be unnecessary once
// https://github.com/flutter/flutter/issues/79894 is fixed.
return maybeWrapWithTooltip(
tooltip: tooltip,
tooltipPadding: tooltipPadding,
child: SizedBox(
height: defaultButtonHeight,
width: !isScreenWiderThan(context, minScreenWidthForTextBeforeScaling)
? buttonMinWidth
: null,
child: outlined
? OutlinedButton(
style: denseAwareOutlinedButtonStyle(
context,
minScreenWidthForTextBeforeScaling,
),
onPressed: onPressed,
child: iconLabel,
)
: TextButton(
onPressed: onPressed,
style: denseAwareTextButtonStyle(
context,
minScreenWidthForTextBeforeScaling:
minScreenWidthForTextBeforeScaling,
),
child: iconLabel,
),
),
);
}
}
/// A widget, commonly used for icon buttons, that provides a tooltip with a
/// common delay before the tooltip is shown.
final class DevToolsTooltip extends StatelessWidget {
const DevToolsTooltip({
Key? key,
this.message,
this.richMessage,
required this.child,
this.waitDuration = tooltipWait,
this.preferBelow = false,
this.enableTapToDismiss = true,
this.padding = const EdgeInsets.all(defaultSpacing),
this.decoration,
this.textStyle,
}) : assert((message == null) != (richMessage == null)),
super(key: key);
final String? message;
final InlineSpan? richMessage;
final Widget child;
final Duration waitDuration;
final bool preferBelow;
final bool enableTapToDismiss;
final EdgeInsetsGeometry? padding;
final Decoration? decoration;
final TextStyle? textStyle;
@override
Widget build(BuildContext context) {
TextStyle? style = textStyle;
if (richMessage == null) {
style ??= TextStyle(
color: Theme.of(context).colorScheme.tooltipTextColor,
fontSize: defaultFontSize,
);
}
return Tooltip(
message: message,
richMessage: richMessage,
waitDuration: waitDuration,
preferBelow: preferBelow,
enableTapToDismiss: enableTapToDismiss,
padding: padding,
textStyle: style,
decoration: decoration,
child: child,
);
}
}
final class DevToolsToggleButtonGroup extends StatelessWidget {
const DevToolsToggleButtonGroup({
Key? key,
required this.children,
required this.selectedStates,
required this.onPressed,
this.fillColor,
this.selectedColor,
this.borderColor,
}) : super(key: key);
final List<Widget> children;
final List<bool> selectedStates;
final void Function(int)? onPressed;
final Color? fillColor;
final Color? selectedColor;
final Color? borderColor;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return SizedBox(
height: defaultButtonHeight,
child: ToggleButtons(
borderRadius: defaultBorderRadius,
fillColor: fillColor,
selectedColor: selectedColor,
borderColor: borderColor,
textStyle: theme.textTheme.bodySmall,
constraints: BoxConstraints(
minWidth: defaultButtonHeight,
minHeight: defaultButtonHeight,
),
isSelected: selectedStates,
onPressed: onPressed,
children: children,
),
);
}
}
final class DevToolsToggleButton extends StatelessWidget {
const DevToolsToggleButton({
Key? key,
required this.onPressed,
required this.isSelected,
required this.message,
required this.icon,
this.outlined = true,
this.label,
this.shape,
}) : super(key: key);
final String message;
final VoidCallback onPressed;
final bool isSelected;
final IconData icon;
final String? label;
final OutlinedBorder? shape;
final bool outlined;
@override
Widget build(BuildContext context) {
return DevToolsToggleButtonGroup(
borderColor: outlined || isSelected
? Theme.of(context).focusColor
: Colors.transparent,
selectedStates: [isSelected],
onPressed: (_) => onPressed(),
children: [
DevToolsTooltip(
message: message,
child: Container(
padding: const EdgeInsets.symmetric(horizontal: denseSpacing),
child: MaterialIconLabel(
iconData: icon,
label: label,
),
),
),
],
);
}
}
/// A group of buttons that share a common border.
///
/// This widget ensures the buttons are displayed with proper borders on the
/// interior and exterior of the group. The attirbutes for each button can be
/// defined by [ButtonGroupItemData] and included in [items].
final class RoundedButtonGroup extends StatelessWidget {
const RoundedButtonGroup({
super.key,
required this.items,
this.minScreenWidthForTextBeforeScaling,
});
final List<ButtonGroupItemData> items;
final double? minScreenWidthForTextBeforeScaling;
@override
Widget build(BuildContext context) {
Widget buildButton(int index) {
final itemData = items[index];
Widget button = _ButtonGroupButton(
buttonData: itemData,
roundedLeftBorder: index == 0,
roundedRightBorder: index == items.length - 1,
minScreenWidthForTextBeforeScaling: minScreenWidthForTextBeforeScaling,
);
if (index != 0) {
button = Container(
decoration: BoxDecoration(
border: Border(
left: BorderSide(
color: Theme.of(context).focusColor,
),
),
),
child: button,
);
}
return button;
}
return SizedBox(
height: defaultButtonHeight,
child: RoundedOutlinedBorder(
child: Row(
children: [
for (int i = 0; i < items.length; i++) buildButton(i),
],
),
),
);
}
}
final class _ButtonGroupButton extends StatelessWidget {
const _ButtonGroupButton({
required this.buttonData,
this.roundedLeftBorder = false,
this.roundedRightBorder = false,
this.minScreenWidthForTextBeforeScaling,
});
final ButtonGroupItemData buttonData;
final bool roundedLeftBorder;
final bool roundedRightBorder;
final double? minScreenWidthForTextBeforeScaling;
@override
Widget build(BuildContext context) {
return DevToolsTooltip(
message: buttonData.tooltip,
child: OutlinedButton(
autofocus: buttonData.autofocus,
style: OutlinedButton.styleFrom(
padding: const EdgeInsets.symmetric(horizontal: densePadding),
side: BorderSide.none,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.horizontal(
left: roundedLeftBorder ? defaultRadius : Radius.zero,
right: roundedRightBorder ? defaultRadius : Radius.zero,
),
),
),
onPressed: buttonData.onPressed,
child: MaterialIconLabel(
label: buttonData.label,
iconData: buttonData.icon,
minScreenWidthForTextBeforeScaling:
minScreenWidthForTextBeforeScaling,
),
),
);
}
}
final class ButtonGroupItemData {
const ButtonGroupItemData({
this.label,
this.icon,
String? tooltip,
this.onPressed,
this.autofocus = false,
}) : tooltip = tooltip ?? label,
assert(label != null || icon != null);
final String? label;
final IconData? icon;
final String? tooltip;
final VoidCallback? onPressed;
final bool autofocus;
}
final class DevToolsFilterButton extends StatelessWidget {
const DevToolsFilterButton({
Key? key,
required this.onPressed,
required this.isFilterActive,
this.message = 'Filter',
this.outlined = true,
}) : super(key: key);
final VoidCallback onPressed;
final bool isFilterActive;
final String message;
final bool outlined;
@override
Widget build(BuildContext context) {
return DevToolsToggleButton(
onPressed: onPressed,
isSelected: isFilterActive,
message: message,
icon: Icons.filter_list,
outlined: outlined,
);
}
}
/// Label including an image icon and optional text.
final class ImageIconLabel extends StatelessWidget {
const ImageIconLabel(
this.icon,
this.text, {
super.key,
this.unscaledMinIncludeTextWidth,
});
final Widget icon;
final String text;
final double? unscaledMinIncludeTextWidth;
@override
Widget build(BuildContext context) {
// TODO(jacobr): display the label as a tooltip for the icon particularly
// when the text is not shown.
return Row(
children: [
icon,
// TODO(jacobr): animate showing and hiding the text.
if (isScreenWiderThan(context, unscaledMinIncludeTextWidth))
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(text),
),
],
);
}
}
final class MaterialIconLabel extends StatelessWidget {
const MaterialIconLabel({
super.key,
required this.label,
required this.iconData,
this.color,
this.minScreenWidthForTextBeforeScaling,
}) : assert(
label != null || iconData != null,
'Either iconData or label must be specified.',
);
final IconData? iconData;
final Color? color;
final String? label;
final double? minScreenWidthForTextBeforeScaling;
@override
Widget build(BuildContext context) {
// TODO(jacobr): display the label as a tooltip for the icon particularly
// when the text is not shown.
return Row(
mainAxisSize: MainAxisSize.min,
children: [
if (iconData != null)
Icon(
iconData,
size: defaultIconSize,
color: color,
),
// TODO(jacobr): animate showing and hiding the text.
if (label != null &&
isScreenWiderThan(context, minScreenWidthForTextBeforeScaling))
Padding(
padding: EdgeInsets.only(
left: iconData != null ? densePadding : 0.0,
),
child: Text(
label!,
style: Theme.of(context).regularTextStyleWithColor(color),
),
),
],
);
}
}
/// Helper that will wrap [child] in a [DevToolsTooltip] widget if [tooltip] is
/// non-null.
Widget maybeWrapWithTooltip({
required String? tooltip,
EdgeInsetsGeometry? tooltipPadding,
required Widget child,
}) {
if (tooltip != null && tooltip.isNotEmpty) {
return DevToolsTooltip(
message: tooltip,
padding: tooltipPadding,
child: child,
);
}
return child;
}
/// Displays a [json] map as selectable, formatted text.
final class FormattedJson extends StatelessWidget {
const FormattedJson({
super.key,
this.json,
this.formattedString,
this.useSubtleStyle = false,
}) : assert((json == null) != (formattedString == null));
static const encoder = JsonEncoder.withIndent(' ');
final Map<String, dynamic>? json;
final String? formattedString;
final bool useSubtleStyle;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return SelectableText(
json != null ? encoder.convert(json) : formattedString!,
style: useSubtleStyle ? theme.subtleFixedFontStyle : theme.fixedFontStyle,
);
}
}
/// An extension on [ScrollController] to facilitate having the scrolling widget
/// auto scroll to the bottom on new content.
extension ScrollControllerAutoScroll on ScrollController {
// TODO(devoncarew): We lose dock-to-bottom when we receive content when we're
// off screen.
/// Return whether the view is currently scrolled to the bottom.
bool get atScrollBottom {
final pos = position;
return pos.pixels == pos.maxScrollExtent;
}
/// Scroll the content to the bottom using the app's default animation
/// duration and curve..
Future<void> autoScrollToBottom() async {
await animateTo(
position.maxScrollExtent,
duration: rapidDuration,
curve: defaultCurve,
);
// Scroll again if we've received new content in the interim.
if (hasClients) {
final pos = position;
if (pos.pixels != pos.maxScrollExtent) {
jumpTo(pos.maxScrollExtent);
}
}
}
}
| devtools/packages/devtools_app_shared/lib/src/ui/common.dart/0 | {
"file_path": "devtools/packages/devtools_app_shared/lib/src/ui/common.dart",
"repo_id": "devtools",
"token_count": 9451
} | 180 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
import 'dart:js_interop';
import 'package:web/web.dart';
extension MessageExtension on Event {
bool get isMessageEvent =>
// TODO(srujzs): This is necessary in order to support package:web 0.4.0.
// This was not needed with 0.3.0, hence the lint.
(this as JSObject).instanceOfString('MessageEvent');
}
extension NodeListExtension on NodeList {
external void forEach(JSFunction callback);
}
| devtools/packages/devtools_app_shared/lib/src/utils/web_utils.dart/0 | {
"file_path": "devtools/packages/devtools_app_shared/lib/src/utils/web_utils.dart",
"repo_id": "devtools",
"token_count": 185
} | 181 |
name: foo
issueTracker: https://www.google.com/
version: 1.0.0
materialIconCodePoint: "0xe50a"
| devtools/packages/devtools_extensions/example/packages_with_extensions/foo/packages/foo/extension/devtools/config.yaml/0 | {
"file_path": "devtools/packages/devtools_extensions/example/packages_with_extensions/foo/packages/foo/extension/devtools/config.yaml",
"repo_id": "devtools",
"token_count": 36
} | 182 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:js_interop';
import 'dart:math' as math;
import 'package:devtools_app_shared/service.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:web/web.dart' hide Text, Clipboard;
import '../../api/api.dart';
import '../../api/model.dart';
import '../../utils.dart';
import '../devtools_extension.dart';
part '_simulated_devtools_controller.dart';
part 'connection_ui/_connect.dart';
part 'connection_ui/_dtd_connect.dart';
part 'connection_ui/_vm_service_connect.dart';
/// Wraps [child] in a simulated DevTools environment.
///
/// The simulated environment implements and exposes the same extension host
/// APIs that DevTools does.
///
/// To use this wrapper, set the 'use_simulated_environment' environment
/// variable to true. See [_simulatedEnvironmentEnabled] from
/// `devtools_extension.dart`.
class SimulatedDevToolsWrapper extends StatefulWidget {
const SimulatedDevToolsWrapper({
super.key,
required this.child,
required this.requiresRunningApplication,
required this.onDtdConnectionChange,
});
final Widget child;
final bool requiresRunningApplication;
final Future<void> Function(String?) onDtdConnectionChange;
@override
State<SimulatedDevToolsWrapper> createState() =>
SimulatedDevToolsWrapperState();
}
@visibleForTesting
class SimulatedDevToolsWrapperState extends State<SimulatedDevToolsWrapper>
with AutoDisposeMixin {
late final SimulatedDevToolsController simController;
late final ScrollController scrollController;
bool get vmServiceConnected => vmServiceConnectionState.connected;
late ConnectedState vmServiceConnectionState;
bool dtdConnected = false;
@override
void initState() {
super.initState();
simController = SimulatedDevToolsController()..init();
scrollController = ScrollController();
vmServiceConnectionState = serviceManager.connectedState.value;
addAutoDisposeListener(serviceManager.connectedState, () {
setState(() {
vmServiceConnectionState = serviceManager.connectedState.value;
});
});
dtdConnected = dtdManager.hasConnection;
addAutoDisposeListener(dtdManager.connection, () {
setState(() {
dtdConnected = dtdManager.hasConnection;
});
});
}
@override
void dispose() {
simController.dispose();
scrollController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return LayoutBuilder(
builder: (context, constraints) {
final availableWidth = constraints.maxWidth;
const environmentPanelMinWidth =
VmServiceConnectionDisplay.totalControlsWidth + 2 * defaultSpacing;
final environmentPanelFraction =
environmentPanelMinWidth / availableWidth;
final childFraction = 1 - environmentPanelFraction;
return SplitPane(
axis: Axis.horizontal,
initialFractions: [childFraction, environmentPanelFraction],
minSizes: const [100.0, 0.0],
children: [
OutlineDecoration.onlyRight(
child: Padding(
padding: const EdgeInsets.all(defaultSpacing),
child: widget.child,
),
),
LayoutBuilder(
builder: (context, environmentPanelConstraints) {
final availableEnvironmentPanelWidth =
environmentPanelConstraints.maxWidth;
final environmentPanelWidth = math.max(
environmentPanelMinWidth,
availableEnvironmentPanelWidth,
);
return Scrollbar(
controller: scrollController,
thumbVisibility: true,
child: SingleChildScrollView(
controller: scrollController,
scrollDirection: Axis.horizontal,
child: SizedBox(
width: environmentPanelWidth,
child: OutlineDecoration.onlyLeft(
child: Padding(
padding: const EdgeInsets.all(defaultSpacing),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Simulated DevTools Environment',
style: theme.textTheme.titleMedium,
),
const PaddedDivider(),
VmServiceConnectionDisplay(
connected: vmServiceConnected,
simController: simController,
),
const PaddedDivider(),
DTDConnectionDisplay(
simController: simController,
connected: dtdConnected,
onConnectionChange:
widget.onDtdConnectionChange,
),
_SimulatedApi(
simController: simController,
requiresRunningApplication:
widget.requiresRunningApplication,
connectedToApplication: vmServiceConnected,
),
const PaddedDivider(),
Expanded(
child: _LogsView(simController: simController),
),
],
),
),
),
),
),
);
},
),
],
);
},
);
}
}
class _SimulatedApi extends StatelessWidget {
const _SimulatedApi({
required this.simController,
required this.requiresRunningApplication,
required this.connectedToApplication,
});
final SimulatedDevToolsController simController;
final bool requiresRunningApplication;
final bool connectedToApplication;
@override
Widget build(BuildContext context) {
if (requiresRunningApplication && !connectedToApplication) {
return const SizedBox.shrink();
}
return Padding(
padding: const EdgeInsets.symmetric(vertical: denseSpacing),
child: Column(
children: [
Row(
children: [
DevToolsButton(
label: 'PING',
onPressed: simController.ping,
),
const SizedBox(width: denseSpacing),
DevToolsButton(
label: 'TOGGLE THEME',
onPressed: simController.toggleTheme,
),
const SizedBox(width: denseSpacing),
DevToolsButton(
label: 'FORCE RELOAD',
onPressed: simController.forceReload,
),
// TODO(kenz): add buttons for other simulated events as the extension
// API expands.
],
),
const SizedBox(height: defaultSpacing),
if (connectedToApplication)
Row(
children: [
DevToolsButton(
icon: Icons.bolt,
tooltip: 'Hot reload connected app',
onPressed: simController.hotReloadConnectedApp,
),
const SizedBox(width: denseSpacing),
DevToolsButton(
icon: Icons.replay,
tooltip: 'Hot restart connected app',
onPressed: simController.hotRestartConnectedApp,
),
],
),
],
),
);
}
}
class _LogsView extends StatelessWidget {
const _LogsView({required this.simController});
final SimulatedDevToolsController simController;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Logs:',
style: Theme.of(context).textTheme.titleMedium,
),
DevToolsButton.iconOnly(
icon: Icons.clear,
outlined: false,
tooltip: 'Clear logs',
onPressed: () => simController.messageLogs.clear(),
),
],
),
const PaddedDivider.thin(),
Expanded(
child: _LogMessages(
simController: simController,
),
),
],
);
}
}
class _LogMessages extends StatefulWidget {
const _LogMessages({required this.simController});
final SimulatedDevToolsController simController;
@override
State<_LogMessages> createState() => _LogMessagesState();
}
class _LogMessagesState extends State<_LogMessages> {
final _scrollController = ScrollController();
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return ValueListenableBuilder(
valueListenable: widget.simController.messageLogs,
builder: (context, logs, _) {
if (_scrollController.hasClients && _scrollController.atScrollBottom) {
unawaited(_scrollController.autoScrollToBottom());
}
return Scrollbar(
controller: _scrollController,
thumbVisibility: true,
child: ListView.builder(
controller: _scrollController,
itemCount: logs.length,
itemBuilder: (context, index) {
final log = logs[index];
Widget logEntry = LogListItem(log: log);
if (index != 0) {
logEntry = OutlineDecoration.onlyTop(child: logEntry);
}
return logEntry;
},
),
);
},
);
}
}
@visibleForTesting
class LogListItem extends StatelessWidget {
const LogListItem({super.key, required this.log});
final MessageLogEntry log;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: densePadding),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'[${log.timestamp.toString()}] from ${log.source.display}',
style: Theme.of(context).fixedFontStyle,
),
if (log.message != null) Text(log.message!),
if (log.data != null)
FormattedJson(
json: log.data,
),
],
),
);
}
}
| devtools/packages/devtools_extensions/lib/src/template/_simulated_devtools_environment/_simulated_devtools_environment.dart/0 | {
"file_path": "devtools/packages/devtools_extensions/lib/src/template/_simulated_devtools_environment/_simulated_devtools_environment.dart",
"repo_id": "devtools",
"token_count": 5274
} | 183 |
include: ../analysis_options.yaml
| devtools/packages/devtools_shared/analysis_options.yaml/0 | {
"file_path": "devtools/packages/devtools_shared/analysis_options.yaml",
"repo_id": "devtools",
"token_count": 11
} | 184 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:collection/collection.dart';
/// Describes an extension that can be dynamically loaded into a custom screen
/// in DevTools.
class DevToolsExtensionConfig implements Comparable {
DevToolsExtensionConfig._({
required this.name,
required this.path,
required this.issueTrackerLink,
required this.version,
required this.materialIconCodePoint,
required this.isPubliclyHosted,
});
factory DevToolsExtensionConfig.parse(Map<String, Object?> json) {
// Defaults to the code point for [Icons.extensions_outlined] if null.
late int codePoint;
final codePointFromJson = json[materialIconCodePointKey];
const defaultCodePoint = 0xf03f;
if (codePointFromJson is String?) {
codePoint =
int.tryParse(codePointFromJson ?? '0xf03f') ?? defaultCodePoint;
} else {
codePoint = codePointFromJson as int? ?? defaultCodePoint;
}
if (json
case {
nameKey: final String name,
pathKey: final String path,
issueTrackerKey: final String issueTracker,
versionKey: final String version,
isPubliclyHostedKey: final String isPubliclyHosted,
}) {
final underscoresAndLetters = RegExp(r'^[a-z0-9_]*$');
if (!underscoresAndLetters.hasMatch(name)) {
throw StateError(
'The "name" field in the extension config.yaml should only contain '
'lowercase letters, numbers, and underscores but instead was '
'"$name". This should be a valid Dart package name that matches the '
'package name this extension belongs to.',
);
}
return DevToolsExtensionConfig._(
name: name,
path: path,
issueTrackerLink: issueTracker,
version: version,
materialIconCodePoint: codePoint,
isPubliclyHosted: bool.parse(isPubliclyHosted),
);
} else {
if (!json.keys.contains(isPubliclyHostedKey)) {
throw StateError(
'Missing key "$isPubliclyHostedKey" when trying to parse '
'DevToolsExtensionConfig object.',
);
}
const requiredKeysFromConfigFile = {
nameKey,
pathKey,
issueTrackerKey,
versionKey,
};
// We do not expect the config.yaml file to contain
// [isPubliclyHostedKey], as this should be inferred.
final jsonKeysFromConfigFile = Set.of(json.keys.toSet())
..remove(isPubliclyHostedKey);
final diff = requiredKeysFromConfigFile.difference(
jsonKeysFromConfigFile,
);
if (diff.isNotEmpty) {
throw StateError(
'Missing required fields ${diff.toString()} in the extension '
'config.yaml.',
);
} else {
// All the required keys are present, but the value types did not match.
final sb = StringBuffer();
for (final entry in json.entries) {
sb.writeln(
' ${entry.key}: ${entry.value} (${entry.value.runtimeType})',
);
}
throw StateError(
'Unexpected value types in the extension config.yaml. Expected all '
'values to be of type String, but one or more had a different type:\n'
'${sb.toString()}',
);
}
}
}
static const nameKey = 'name';
static const pathKey = 'path';
static const issueTrackerKey = 'issueTracker';
static const versionKey = 'version';
static const materialIconCodePointKey = 'materialIconCodePoint';
static const isPubliclyHostedKey = 'isPubliclyHosted';
/// The package name that this extension is for.
final String name;
/// The path that this extension's assets live at.
///
/// This location will be in the user's pub cache.
final String path;
// TODO(kenz): we might want to add validation to these issue tracker
// links to ensure they don't point to the DevTools repo or flutter repo.
// If an invalid issue tracker link is provided, we can default to
// 'pub.dev/packages/$name'.
/// The link to the issue tracker for this DevTools extension.
///
/// This should not point to the flutter/devtools or flutter/flutter issue
/// trackers, but rather to the issue tracker for the package that provides
/// the extension, or to the repo where the extension is developed.
final String issueTrackerLink;
/// The version for the DevTools extension.
///
/// This may match the version of the parent package or use a different
/// versioning system as decided by the extension author.
final String version;
/// The code point for the material icon that will parsed by Flutter's
/// [IconData] class for displaying in DevTools.
///
/// This code point should be part of the 'MaterialIcons' font family.
/// See https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/icons.dart.
final int materialIconCodePoint;
/// Whether this extension is distrubuted in a public package on pub.dev.
final bool isPubliclyHosted;
String get displayName => name.toLowerCase();
String get analyticsSafeName => isPubliclyHosted ? name : 'private';
Map<String, Object?> toJson() => {
nameKey: name,
pathKey: path,
issueTrackerKey: issueTrackerLink,
versionKey: version,
materialIconCodePointKey: materialIconCodePoint,
isPubliclyHostedKey: isPubliclyHosted.toString(),
};
@override
// ignore: avoid-dynamic, avoids invalid_override error
int compareTo(other) {
final otherConfig = other as DevToolsExtensionConfig;
final compare = name.compareTo(otherConfig.name);
if (compare == 0) {
return path.compareTo(otherConfig.path);
}
return compare;
}
@override
bool operator ==(Object other) {
return other is DevToolsExtensionConfig &&
other.name == name &&
other.path == path &&
other.issueTrackerLink == issueTrackerLink &&
other.version == version &&
other.materialIconCodePoint == materialIconCodePoint &&
other.isPubliclyHosted == isPubliclyHosted;
}
@override
int get hashCode => Object.hash(
name,
path,
issueTrackerLink,
version,
materialIconCodePoint,
isPubliclyHosted,
);
}
/// Describes the enablement state of a DevTools extension.
enum ExtensionEnabledState {
/// The extension has been enabled manually by the user.
enabled,
/// The extension has been disabled manually by the user.
disabled,
/// The extension has been neither enabled nor disabled by the user.
none,
/// Something went wrong with reading or writing the activation state.
///
/// We should ignore extensions with this activation state.
error;
/// Parses [value] and returns the matching [ExtensionEnabledState] if found.
static ExtensionEnabledState from(String? value) {
return ExtensionEnabledState.values
.firstWhereOrNull((e) => e.name == value) ??
ExtensionEnabledState.none;
}
}
| devtools/packages/devtools_shared/lib/src/extensions/extension_model.dart/0 | {
"file_path": "devtools/packages/devtools_shared/lib/src/extensions/extension_model.dart",
"repo_id": "devtools",
"token_count": 2508
} | 185 |
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
class RegisteredService {
const RegisteredService({
required this.service,
required this.title,
});
final String service;
final String title;
}
/// Flutter memory service registered by Flutter Tools.
///
/// We call this service to get version information about the Flutter Android
/// memory info using Android's ADB.
const flutterMemory = RegisteredService(
service: 'flutterMemoryInfo',
title: 'Flutter Memory Info',
);
const flutterListViews = '_flutter.listViews';
/// Flutter engine returns estimate how much memory is used by layer/picture
/// raster cache entries in bytes.
const flutterEngineRasterCache = '_flutter.estimateRasterCacheMemory';
/// Returns a normalized vm service uri.
///
/// Removes trailing characters, trailing url fragments, and decodes urls that
/// were accidentally encoded.
///
/// For example, given a [value] of http://127.0.0.1:60667/72K34Xmq0X0=/#/vm,
/// this method will return the URI http://127.0.0.1:60667/72K34Xmq0X0=/.
///
/// Returns null if the [Uri] parsed from [value] is not [Uri.absolute]
/// (ie, it has no scheme or it has a fragment).
Uri? normalizeVmServiceUri(String value) {
value = value.trim();
// Clean up urls that have a devtools server's prefix, aka:
// http://127.0.0.1:9101?uri=http%3A%2F%2F127.0.0.1%3A56142%2FHOwgrxalK00%3D%2F
const uriParamToken = '?uri=';
if (value.contains(uriParamToken)) {
value = value.substring(
value.indexOf(uriParamToken) + uriParamToken.length,
);
}
// Cleanup encoded urls likely copied from the uri of an existing running
// DevTools app.
if (value.contains('%3A%2F%2F')) {
value = Uri.decodeFull(value);
}
final uri = Uri.parse(value.trim()).removeFragment();
if (!uri.isAbsolute) {
return null;
}
if (uri.path.endsWith('/')) return uri;
return uri.replace(path: uri.path);
}
| devtools/packages/devtools_shared/lib/src/service_utils.dart/0 | {
"file_path": "devtools/packages/devtools_shared/lib/src/service_utils.dart",
"repo_id": "devtools",
"token_count": 693
} | 186 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_shared/devtools_extensions.dart';
import 'package:test/test.dart';
void main() {
group('$DevToolsExtensionConfig', () {
test('parses with a String materialIconCodePoint field', () {
final config = DevToolsExtensionConfig.parse({
'name': 'foo',
'path': 'path/to/foo/extension',
'issueTracker': 'www.google.com',
'version': '1.0.0',
'materialIconCodePoint': '0xf012',
'isPubliclyHosted': 'false',
});
expect(config.name, 'foo');
expect(config.path, 'path/to/foo/extension');
expect(config.issueTrackerLink, 'www.google.com');
expect(config.version, '1.0.0');
expect(config.materialIconCodePoint, 0xf012);
});
test('parses with an int materialIconCodePoint field', () {
final config = DevToolsExtensionConfig.parse({
'name': 'foo',
'path': 'path/to/foo/extension',
'issueTracker': 'www.google.com',
'version': '1.0.0',
'materialIconCodePoint': 0xf012,
'isPubliclyHosted': 'false',
});
expect(config.name, 'foo');
expect(config.path, 'path/to/foo/extension');
expect(config.issueTrackerLink, 'www.google.com');
expect(config.version, '1.0.0');
expect(config.materialIconCodePoint, 0xf012);
});
test('parses with a null materialIconCodePoint field', () {
final config = DevToolsExtensionConfig.parse({
'name': 'foo',
'path': 'path/to/foo/extension',
'issueTracker': 'www.google.com',
'version': '1.0.0',
'isPubliclyHosted': 'false',
});
expect(config.name, 'foo');
expect(config.path, 'path/to/foo/extension');
expect(config.issueTrackerLink, 'www.google.com');
expect(config.version, '1.0.0');
expect(config.materialIconCodePoint, 0xf03f);
});
test('parse throws when missing a required field', () {
Matcher throwsMissingRequiredFieldsError() {
return throwsA(
isA<StateError>().having(
(e) => e.message,
'missing required fields StateError',
startsWith('Missing required fields'),
),
);
}
Matcher throwsMissingIsPubliclyHostedError() {
return throwsA(
isA<StateError>().having(
(e) => e.message,
'missing isPubliclyHosted key StateError',
startsWith('Missing key "isPubliclyHosted"'),
),
);
}
// Missing 'name'.
expect(
() {
DevToolsExtensionConfig.parse({
'path': 'path/to/foo/extension',
'issueTracker': 'www.google.com',
'version': '1.0.0',
'isPubliclyHosted': 'false',
});
},
throwsMissingRequiredFieldsError(),
);
// Missing 'path'.
expect(
() {
DevToolsExtensionConfig.parse({
'name': 'foo',
'issueTracker': 'www.google.com',
'version': '1.0.0',
'isPubliclyHosted': 'false',
});
},
throwsMissingRequiredFieldsError(),
);
// Missing 'issueTracker'.
expect(
() {
DevToolsExtensionConfig.parse({
'name': 'foo',
'path': 'path/to/foo/extension',
'version': '1.0.0',
'isPubliclyHosted': 'false',
});
},
throwsMissingRequiredFieldsError(),
);
// Missing 'version'.
expect(
() {
DevToolsExtensionConfig.parse({
'name': 'foo',
'path': 'path/to/foo/extension',
'issueTracker': 'www.google.com',
'isPubliclyHosted': 'false',
});
},
throwsMissingRequiredFieldsError(),
);
// Missing 'isPubliclyHosted'.
expect(
() {
DevToolsExtensionConfig.parse({
'name': 'foo',
'path': 'path/to/foo/extension',
'version': '1.0.0',
'issueTracker': 'www.google.com',
});
},
throwsMissingIsPubliclyHostedError(),
);
});
test('parse throws when value has unexpected type', () {
Matcher throwsUnexpectedValueTypesError() {
return throwsA(
isA<StateError>().having(
(e) => e.message,
'unexpected value types StateError',
startsWith('Unexpected value types'),
),
);
}
expect(
() {
DevToolsExtensionConfig.parse({
'name': 23,
'path': 'path/to/foo/extension',
'issueTracker': 'www.google.com',
'version': '1.0.0',
'isPubliclyHosted': 'false',
});
},
throwsUnexpectedValueTypesError(),
);
expect(
() {
DevToolsExtensionConfig.parse({
'name': 'foo',
'path': 'path/to/foo/extension',
'issueTracker': 'www.google.com',
'version': '1.0.0',
'isPubliclyHosted': false,
});
},
throwsUnexpectedValueTypesError(),
);
});
test('parse throws for invalid name', () {
Matcher throwsInvalidNameError() {
return throwsA(
isA<StateError>().having(
(e) => e.message,
'unexpected value types StateError',
startsWith('The "name" field in the extension config.yaml should'),
),
);
}
expect(
() {
DevToolsExtensionConfig.parse({
'name': 'name with spaces',
'path': 'path/to/foo/extension',
'issueTracker': 'www.google.com',
'version': '1.0.0',
'isPubliclyHosted': 'false',
});
},
throwsInvalidNameError(),
);
expect(
() {
DevToolsExtensionConfig.parse({
'name': 'Name_With_Capital_Letters',
'path': 'path/to/foo/extension',
'issueTracker': 'www.google.com',
'version': '1.0.0',
'isPubliclyHosted': 'false',
});
},
throwsInvalidNameError(),
);
expect(
() {
DevToolsExtensionConfig.parse({
'name': 'name.with\'specialchars/',
'path': 'path/to/foo/extension',
'issueTracker': 'www.google.com',
'version': '1.0.0',
'isPubliclyHosted': 'false',
});
},
throwsInvalidNameError(),
);
});
});
}
| devtools/packages/devtools_shared/test/extensions/extension_model_test.dart/0 | {
"file_path": "devtools/packages/devtools_shared/test/extensions/extension_model_test.dart",
"repo_id": "devtools",
"token_count": 3293
} | 187 |
# 1.0.0
* Migrate to null safety.
# 0.0.3
* Add Creative Commons LICENSE
# 0.0.2
* Restructure package directories.
# 0.0.1
* Create `codicon` package and expose `IconData` consts for each VS code icon.
| devtools/third_party/packages/codicon/CHANGELOG.md/0 | {
"file_path": "devtools/third_party/packages/codicon/CHANGELOG.md",
"repo_id": "devtools",
"token_count": 75
} | 188 |
var service_worker = (function () {
'use strict';
function getAugmentedNamespace(n) {
if (n.__esModule) return n;
var f = n.default;
if (typeof f == "function") {
var a = function a () {
if (this instanceof a) {
var args = [null];
args.push.apply(args, arguments);
var Ctor = Function.bind.apply(f, args);
return new Ctor();
}
return f.apply(this, arguments);
};
a.prototype = f.prototype;
} else a = {};
Object.defineProperty(a, '__esModule', {value: true});
Object.keys(n).forEach(function (k) {
var d = Object.getOwnPropertyDescriptor(n, k);
Object.defineProperty(a, k, d.get ? d : {
enumerable: true,
get: function () {
return n[k];
}
});
});
return a;
}
var service_worker = {};
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.push(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.push(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
}
function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
}
function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
}
function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
}
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
}
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
var tslib_es6 = /*#__PURE__*/Object.freeze({
__proto__: null,
__extends: __extends,
get __assign () { return __assign; },
__rest: __rest,
__decorate: __decorate,
__param: __param,
__esDecorate: __esDecorate,
__runInitializers: __runInitializers,
__propKey: __propKey,
__setFunctionName: __setFunctionName,
__metadata: __metadata,
__awaiter: __awaiter,
__generator: __generator,
__createBinding: __createBinding,
__exportStar: __exportStar,
__values: __values,
__read: __read,
__spread: __spread,
__spreadArrays: __spreadArrays,
__spreadArray: __spreadArray,
__await: __await,
__asyncGenerator: __asyncGenerator,
__asyncDelegator: __asyncDelegator,
__asyncValues: __asyncValues,
__makeTemplateObject: __makeTemplateObject,
__importStar: __importStar,
__importDefault: __importDefault,
__classPrivateFieldGet: __classPrivateFieldGet,
__classPrivateFieldSet: __classPrivateFieldSet,
__classPrivateFieldIn: __classPrivateFieldIn
});
var require$$0 = /*@__PURE__*/getAugmentedNamespace(tslib_es6);
// Copyright (C) 2020 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
Object.defineProperty(service_worker, "__esModule", { value: true });
const tslib_1 = require$$0;
const LOG_TAG = `ServiceWorker: `;
const CACHE_NAME = 'ui-perfetto-dev';
// If the fetch() for the / doesn't respond within 3s, return a cached version.
// This is to avoid that a user waits too much if on a flaky network.
const INDEX_TIMEOUT_MS = 3000;
// Use more relaxed timeouts when caching the subresources for the new version
// in the background.
const INSTALL_TIMEOUT_MS = 30000;
// The install() event is fired:
// 1. On the first visit, when there is no SW installed.
// 2. Every time the user opens the site and the version has been updated (they
// will get the newer version regardless, unless we hit INDEX_TIMEOUT_MS).
// The latter happens because:
// - / (index.html) is always served from the network (% timeout) and it pulls
// /v1.2-sha/frontend_bundle.js.
// - /v1.2-sha/frontend_bundle.js will register /service_worker.js?v=v1.2-sha.
// The service_worker.js script itself never changes, but the browser
// re-installs it because the version in the V? query-string argument changes.
// The reinstallation will cache the new files from the v.1.2-sha/manifest.json.
self.addEventListener('install', (event) => {
const doInstall = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
if (yield caches.has('BYPASS_SERVICE_WORKER')) {
// Throw will prevent the installation.
throw new Error(LOG_TAG + 'skipping installation, bypass enabled');
}
// Delete old cache entries from the pre-feb-2021 service worker.
for (const key of yield caches.keys()) {
if (key.startsWith('dist-')) {
yield caches.delete(key);
}
}
// The UI should register this as service_worker.js?v=v1.2-sha. Extract the
// version number and pre-fetch all the contents for the version.
const match = /\bv=([\w.-]*)/.exec(location.search);
if (!match) {
throw new Error('Failed to install. Was epecting a query string like ' +
`?v=v1.2-sha query string, got "${location.search}" instead`);
}
yield installAppVersionIntoCache(match[1]);
// skipWaiting() still waits for the install to be complete. Without this
// call, the new version would be activated only when all tabs are closed.
// Instead, we ask to activate it immediately. This is safe because the
// subresources are versioned (e.g. /v1.2-sha/frontend_bundle.js). Even if
// there is an old UI tab opened while we activate() a newer version, the
// activate() would just cause cache-misses, hence fetch from the network,
// for the old tab.
self.skipWaiting();
});
event.waitUntil(doInstall());
});
self.addEventListener('activate', (event) => {
console.info(LOG_TAG + 'activated');
const doActivate = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
// This makes a difference only for the very first load, when no service
// worker is present. In all the other cases the skipWaiting() will hot-swap
// the active service worker anyways.
yield self.clients.claim();
});
event.waitUntil(doActivate());
});
self.addEventListener('fetch', (event) => {
// The early return here will cause the browser to fall back on standard
// network-based fetch.
if (!shouldHandleHttpRequest(event.request)) {
console.debug(LOG_TAG + `serving ${event.request.url} from network`);
return;
}
event.respondWith(handleHttpRequest(event.request));
});
function shouldHandleHttpRequest(req) {
// Suppress warning: 'only-if-cached' can be set only with 'same-origin' mode.
// This seems to be a chromium bug. An internal code search suggests this is a
// socially acceptable workaround.
if (req.cache === 'only-if-cached' && req.mode !== 'same-origin') {
return false;
}
const url = new URL(req.url);
if (url.pathname === '/live_reload')
return false;
return req.method === 'GET' && url.origin === self.location.origin;
}
function handleHttpRequest(req) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (!shouldHandleHttpRequest(req)) {
throw new Error(LOG_TAG + `${req.url} shouldn't have been handled`);
}
// We serve from the cache even if req.cache == 'no-cache'. It's a bit
// contra-intuitive but it's the most consistent option. If the user hits the
// reload button*, the browser requests the "/" index with a 'no-cache' fetch.
// However all the other resources (css, js, ...) are requested with a
// 'default' fetch (this is just how Chrome works, it's not us). If we bypass
// the service worker cache when we get a 'no-cache' request, we can end up in
// an inconsistent state where the index.html is more recent than the other
// resources, which is undesirable.
// * Only Ctrl+R. Ctrl+Shift+R will always bypass service-worker for all the
// requests (index.html and the rest) made in that tab.
const cacheOps = { cacheName: CACHE_NAME };
const url = new URL(req.url);
if (url.pathname === '/') {
try {
console.debug(LOG_TAG + `Fetching live ${req.url}`);
// The await bleow is needed to fall through in case of an exception.
return yield fetchWithTimeout(req, INDEX_TIMEOUT_MS);
}
catch (err) {
console.warn(LOG_TAG + `Failed to fetch ${req.url}, using cache.`, err);
// Fall through the code below.
}
}
else if (url.pathname === '/offline') {
// Escape hatch to force serving the offline version without attemping the
// network fetch.
const cachedRes = yield caches.match(new Request('/'), cacheOps);
if (cachedRes)
return cachedRes;
}
const cachedRes = yield caches.match(req, cacheOps);
if (cachedRes) {
console.debug(LOG_TAG + `serving ${req.url} from cache`);
return cachedRes;
}
// In any other case, just propagate the fetch on the network, which is the
// safe behavior.
console.warn(LOG_TAG + `cache miss on ${req.url}, using live network`);
return fetch(req);
});
}
function installAppVersionIntoCache(version) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const manifestUrl = `${version}/manifest.json`;
try {
console.log(LOG_TAG + `Starting installation of ${manifestUrl}`);
yield caches.delete(CACHE_NAME);
const resp = yield fetchWithTimeout(manifestUrl, INSTALL_TIMEOUT_MS);
const manifest = yield resp.json();
const manifestResources = manifest['resources'];
if (!manifestResources || !(manifestResources instanceof Object)) {
throw new Error(`Invalid manifest ${manifestUrl} : ${manifest}`);
}
const cache = yield caches.open(CACHE_NAME);
const urlsToCache = [];
// We use cache:reload to make sure that the index is always current and we
// don't end up in some cycle where we keep re-caching the index coming from
// the service worker itself.
urlsToCache.push(new Request('/', { cache: 'reload', mode: 'same-origin' }));
for (const [resource, integrity] of Object.entries(manifestResources)) {
// We use cache: no-cache rather then reload here because the versioned
// sub-resources are expected to be immutable and should never be
// ambiguous. A revalidation request is enough.
const reqOpts = {
cache: 'no-cache',
mode: 'same-origin',
integrity: `${integrity}`,
};
urlsToCache.push(new Request(`${version}/${resource}`, reqOpts));
}
yield cache.addAll(urlsToCache);
console.log(LOG_TAG + 'installation completed for ' + version);
}
catch (err) {
console.error(LOG_TAG + `Installation failed for ${manifestUrl}`, err);
yield caches.delete(CACHE_NAME);
throw err;
}
});
}
function fetchWithTimeout(req, timeoutMs) {
const url = req.url || `${req}`;
return new Promise((resolve, reject) => {
const timerId = setTimeout(() => {
reject(new Error(`Timed out while fetching ${url}`));
}, timeoutMs);
fetch(req).then((resp) => {
clearTimeout(timerId);
if (resp.ok) {
resolve(resp);
}
else {
reject(new Error(`Fetch failed for ${url}: ${resp.status} ${resp.statusText}`));
}
}, reject);
});
}
return service_worker;
})();
//# sourceMappingURL=service_worker.js.map
| devtools/third_party/packages/perfetto_ui_compiled/lib/dist/service_worker.js/0 | {
"file_path": "devtools/third_party/packages/perfetto_ui_compiled/lib/dist/service_worker.js",
"repo_id": "devtools",
"token_count": 10065
} | 189 |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:widget_icons/widget_icons.dart';
class WidgetTheme {
const WidgetTheme({
this.icon,
this.color = otherWidgetColor,
});
final IconData? icon;
final Color color;
static WidgetTheme fromName(String? widgetType) {
if (widgetType == null) {
return const WidgetTheme();
}
return themeMap[_stripBrackets(widgetType)] ?? const WidgetTheme();
}
/// Strips the brackets off the widget name.
///
/// For example: `AnimatedBuilder<String>` -> `AnimatedBuilder`.
static String _stripBrackets(String widgetType) {
final bracketIndex = widgetType.indexOf('<');
if (bracketIndex == -1) {
return widgetType;
}
return widgetType.substring(0, bracketIndex);
}
static const contentWidgetColor = Color(0xff06AC3B);
static const highLevelWidgetColor = Color(0xffAEAEB1);
static const animationWidgetColor = Color(0xffE09D0E);
static const otherWidgetColor = Color(0xff0EA7E0);
static const animatedTheme = WidgetTheme(
icon: WidgetIcons.animated,
color: animationWidgetColor,
);
static const transitionTheme = WidgetTheme(
icon: WidgetIcons.transition,
color: animationWidgetColor,
);
static const textTheme = WidgetTheme(
icon: WidgetIcons.text,
color: contentWidgetColor,
);
static const imageTheme = WidgetTheme(
icon: WidgetIcons.image,
color: contentWidgetColor,
);
static const tabTheme = WidgetTheme(icon: WidgetIcons.tab);
static const scrollTheme = WidgetTheme(icon: WidgetIcons.scroll);
static const highLevelTheme = WidgetTheme(color: highLevelWidgetColor);
static const listTheme = WidgetTheme(icon: WidgetIcons.list_view);
static const flexibleTheme = WidgetTheme(icon: WidgetIcons.flexible);
static const alignTheme = WidgetTheme(icon: WidgetIcons.align);
static const gestureTheme = WidgetTheme(icon: WidgetIcons.gesture);
static const textButtonTheme = WidgetTheme(icon: WidgetIcons.text_button);
static const toggleTheme = WidgetTheme(
icon: WidgetIcons.toggle,
color: contentWidgetColor,
);
static const Map<String, WidgetTheme> themeMap = {
// High-level
'RenderObjectToWidgetAdapter': WidgetTheme(
icon: WidgetIcons.root,
color: highLevelWidgetColor,
),
'CupertinoApp': highLevelTheme,
'MaterialApp': highLevelTheme,
'WidgetsApp': highLevelTheme,
// Text
'DefaultTextStyle': textTheme,
'RichText': textTheme,
'SelectableText': textTheme,
'Text': textTheme,
// Images
'Icon': imageTheme,
'Image': imageTheme,
'RawImage': imageTheme,
// Animations
'AnimatedAlign': animatedTheme,
'AnimatedBuilder': animatedTheme,
'AnimatedContainer': animatedTheme,
'AnimatedCrossFade': animatedTheme,
'AnimatedDefaultTextStyle': animatedTheme,
'AnimatedListState': animatedTheme,
'AnimatedModalBarrier': animatedTheme,
'AnimatedOpacity': animatedTheme,
'AnimatedPhysicalModel': animatedTheme,
'AnimatedPositioned': animatedTheme,
'AnimatedSize': animatedTheme,
'AnimatedWidget': animatedTheme,
// Transitions
'DecoratedBoxTransition': transitionTheme,
'FadeTransition': transitionTheme,
'PositionedTransition': transitionTheme,
'RotationTransition': transitionTheme,
'ScaleTransition': transitionTheme,
'SizeTransition': transitionTheme,
'SlideTransition': transitionTheme,
'Hero': WidgetTheme(
icon: WidgetIcons.hero,
color: animationWidgetColor,
),
// Scroll
'CustomScrollView': scrollTheme,
'DraggableScrollableSheet': scrollTheme,
'SingleChildScrollView': scrollTheme,
'Scrollable': scrollTheme,
'Scrollbar': scrollTheme,
'ScrollConfiguration': scrollTheme,
'GridView': WidgetTheme(icon: WidgetIcons.grid_view),
'ListView': listTheme,
'ReorderableListView': listTheme,
'NestedScrollView': listTheme,
// Input
'Checkbox': WidgetTheme(
icon: WidgetIcons.checkbox,
color: contentWidgetColor,
),
'Radio': WidgetTheme(
icon: WidgetIcons.radio_button,
color: contentWidgetColor,
),
'Switch': toggleTheme,
'CupertinoSwitch': toggleTheme,
// Layout
'Container': WidgetTheme(icon: WidgetIcons.container),
'Center': WidgetTheme(icon: WidgetIcons.center),
'Row': WidgetTheme(icon: WidgetIcons.row),
'Column': WidgetTheme(icon: WidgetIcons.column),
'Padding': WidgetTheme(icon: WidgetIcons.padding),
'SizedBox': WidgetTheme(icon: WidgetIcons.sized_box),
'ConstrainedBox': WidgetTheme(icon: WidgetIcons.constrained_box),
'Align': alignTheme,
'Positioned': alignTheme,
'Expanded': flexibleTheme,
'Flexible': flexibleTheme,
'Stack': WidgetTheme(icon: WidgetIcons.stack),
'Wrap': WidgetTheme(icon: WidgetIcons.wrap),
// Buttons
'FloatingActionButton': WidgetTheme(
icon: WidgetIcons.floating_action_button,
color: contentWidgetColor,
),
'InkWell': WidgetTheme(icon: WidgetIcons.inkwell),
'GestureDetector': gestureTheme,
'RawGestureDetector': gestureTheme,
'TextButton': textButtonTheme,
'CupertinoButton': textButtonTheme,
'ElevatedButton': textButtonTheme,
'OutlinedButton': WidgetTheme(icon: WidgetIcons.outlined_button),
// Tabs
'Tab': tabTheme,
'TabBar': tabTheme,
'TabBarView': tabTheme,
'BottomNavigationBar': tabTheme,
'CupertinoTabScaffold': tabTheme,
'CupertinoTabView': tabTheme,
// Other
'Scaffold': WidgetTheme(icon: WidgetIcons.scaffold),
'CircularProgressIndicator':
WidgetTheme(icon: WidgetIcons.circular_progress),
'Card': WidgetTheme(icon: WidgetIcons.card),
'Divider': WidgetTheme(icon: WidgetIcons.divider),
'AlertDialog': WidgetTheme(icon: WidgetIcons.alert_dialog),
'CircleAvatar': WidgetTheme(icon: WidgetIcons.circle_avatar),
'Opacity': WidgetTheme(icon: WidgetIcons.opacity),
'Drawer': WidgetTheme(icon: WidgetIcons.drawer),
'PageView': WidgetTheme(icon: WidgetIcons.page_view),
'Material': WidgetTheme(icon: WidgetIcons.material),
};
}
| devtools/third_party/packages/widget_icons/lib/widget_theme.dart/0 | {
"file_path": "devtools/third_party/packages/widget_icons/lib/widget_theme.dart",
"repo_id": "devtools",
"token_count": 2242
} | 190 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'dart:io';
/// Outputs the time intervals between adjacent cpu samples.
///
/// A json file path is required as a command line argument.
/// Ex: dart cpu_sample_intervals.dart ~/Downloads/example_json.dart
void main(List<String> arguments) async {
if (arguments.isEmpty) {
print('You must specify a json input file path.\n'
'Ex: dart cpu_sample_intervals.dart ~/Downloads/example.json');
return;
}
final File file = File(arguments.first);
final Map<String, dynamic> timelineDump =
(jsonDecode(await file.readAsString()) as Map).cast<String, dynamic>();
final List<dynamic> cpuSampleTraceEvents =
timelineDump['cpuProfile']['traceEvents'] as List;
final List<int> deltas = [];
for (int i = 0; i < cpuSampleTraceEvents.length - 1; i++) {
final Map<String, dynamic> current =
(cpuSampleTraceEvents[i] as Map).cast<String, dynamic>();
final Map<String, dynamic> next =
(cpuSampleTraceEvents[i + 1] as Map).cast<String, dynamic>();
deltas.add((next['ts'] as int) - (current['ts'] as int));
}
print(deltas);
}
| devtools/tool/cpu_sample_intervals.dart/0 | {
"file_path": "devtools/tool/cpu_sample_intervals.dart",
"repo_id": "devtools",
"token_count": 438
} | 191 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:io' as io;
import 'package:args/command_runner.dart';
import '../model.dart';
const _toVersionArg = 'to-version';
class RollbackCommand extends Command {
RollbackCommand() : super() {
argParser.addOption(_toVersionArg, mandatory: true);
}
@override
String get name => 'rollback';
@override
String get description => 'Rolls back to a specific DevTools version.';
@override
Future run() async {
final repo = DevToolsRepo.getInstance();
print('DevTools repo at ${repo.repoPath}.');
final tempDir =
(await io.Directory.systemTemp.createTemp('devtools-rollback'))
.absolute;
print('file://${tempDir.path}');
final tarball = io.File(
'${tempDir.path}/devtools.tar.gz',
);
final extractDir =
await io.Directory('${tempDir.path}/extract/').absolute.create();
final client = io.HttpClient();
final version = argResults![_toVersionArg] as String;
print('downloading tarball to ${tarball.path}');
final tarballRequest = await client.getUrl(
Uri.http(
'storage.googleapis.com',
'pub-packages/packages/devtools-$version.tar.gz',
),
);
final tarballResponse = await tarballRequest.close();
await tarballResponse.pipe(tarball.openWrite());
print('Tarball written; unzipping.');
await io.Process.run(
'tar',
['-x', '-z', '-f', tarball.path.split('/').last, '-C', extractDir.path],
workingDirectory: tempDir.path,
);
print('file://${tempDir.path}');
final buildDir = io.Directory('${repo.repoPath}/packages/devtools/build/');
await buildDir.delete(recursive: true);
await io.Directory('${extractDir.path}build/')
.rename('${repo.repoPath}/packages/devtools/build/');
print('Build outputs from Devtools version $version checked out and moved '
'to ${buildDir.path}');
print('To complete the rollback, go to ${repo.repoPath}/packages/devtools, '
'rev pubspec.yaml, update the changelog, unhide build/ from the '
'packages/devtools/.gitignore file, then run pub publish.');
// TODO(djshuckerow): automatically rev pubspec.yaml and update the
// changelog so that the user can just run pub publish from
// packages/devtools.
}
}
| devtools/tool/lib/commands/rollback.dart/0 | {
"file_path": "devtools/tool/lib/commands/rollback.dart",
"repo_id": "devtools",
"token_count": 897
} | 192 |
# A YAML format of https://clang.llvm.org/extra/clang-tidy/.
# Prefix check with "-" to ignore.
Checks: >-
bugprone-argument-comment,
bugprone-use-after-move,
bugprone-unchecked-optional-access,
clang-analyzer-*,
clang-diagnostic-*,
darwin-*,
google-*,
modernize-use-default-member-init,
objc-*,
-objc-nsinvocation-argument-lifetime,
readability-identifier-naming,
-google-build-using-namespace,
-google-default-arguments,
-google-objc-global-variable-declaration,
-google-objc-avoid-throwing-exception,
-google-readability-casting,
-clang-analyzer-nullability.NullPassedToNonnull,
-clang-analyzer-nullability.NullablePassedToNonnull,
-clang-analyzer-nullability.NullReturnedFromNonnull,
-clang-analyzer-nullability.NullableReturnedFromNonnull,
-clang-analyzer-nullability.NullableDereferenced,
performance-for-range-copy,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: true
- key: readability-identifier-naming.EnumConstantCase
value: "CamelCase"
- key: readability-identifier-naming.EnumConstantPrefix
value: "k"
- key: readability-identifier-naming.GlobalConstantCase
value: "CamelCase"
- key: readability-identifier-naming.GlobalConstantPrefix
value: "k"
- key: readability-identifier-naming.PrivateMemberCase
value: "lower_case"
- key: readability-identifier-naming.PrivateMemberSuffix
value: "_"
# Intended to include (lint) all headers except:
# ... those in ../../gen (generated files don't need to follow clang tidy)
# ... those in flutter/third_party (we didn't author this code, it's a dep)
#
# Unfortunately Clang Tidy uses an ancient version of regular expressions
# without lookaheads, so the next best thing is to write out every directory
# except third_party.
#
# If we ever add a new root directory, we'll have to update this expression.
#
# See the test in ./tools/clang_tidy/test/header_filter_regex_test.dart which
# should theoretically catch if new directories are added but this regex is not
# updated.
#
# tl;dr: I'm sorry.
HeaderFilterRegex: "[..\/]+\/flutter\/(assets|benchmarking|bin|build|ci|common|display_list|docs|examples|flow|flutter_frontend_server|flutter_vma|fml|impeller|lib|runtime|shell|skia|sky|testing|tools|vulkan|wasm|web_sdk)\/.*"
| engine/.clang-tidy/0 | {
"file_path": "engine/.clang-tidy",
"repo_id": "engine",
"token_count": 852
} | 193 |
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is copied from
# https://crsrc.org/c/build/config/fuchsia/gn_configs.gni?q=gn_configs.gni
# with some local modifications to match the flutter setup.
declare_args() {
# Path to the fuchsia SDK. This is intended for use in other templates &
# rules to reference the contents of the fuchsia SDK.
fuchsia_sdk = "//fuchsia/sdk/$host_os"
# ID uniquely identifying the Fuchsia IDK build. This is exposed as a
# property so it can be used to locate images and packages on GCS and
# as a marker to indicate the "version" of the IDK.
# Defaults to the id found in the manifest.json file of the SDK.
fuchsia_sdk_id = ""
}
# TODO(zijiehe): Remove the override and move it into declare_args once the one
# in //build/config/sdk.gni being removed. - b/40935282
# The target API level for this repository. Embedders should override this
# value to specify the API level the packages produced from this repository
# should be targeting, e.g. in their top-level //.gn file. A value of -1
# means that no API level will be passed to the tools that consumes it.
fuchsia_target_api_level = 16
# The SDK manifest file. This is useful to include as a dependency
# for some targets in order to cause a rebuild when the version of the
# SDK is changed.
fuchsia_sdk_manifest_file = "${fuchsia_sdk}/meta/manifest.json"
# fuchsia_tool_dir is used to specify the directory in the SDK to locate
# tools for the host cpu architecture. If the host_cpu is not recognized,
# then tool dir defaults to x64.
fuchsia_tool_dir = "${fuchsia_sdk}/tools/${host_cpu}"
if (fuchsia_sdk_id == "") {
# Note: If we need to expose more than just the id in the future,
# we should consider exposing the entire json object for the metadata vs.
# adding a bunch of variables.
_meta = read_file(fuchsia_sdk_manifest_file, "json")
fuchsia_sdk_id = _meta.id
}
declare_args() {
# Specify a readelf_exec path to use. If not specified, the host's system
# executable will be used. Passed to populate_build_id_dir.py and
# prepare_package_inputs.py via the --readelf-exec flag.
# Must be a GN path (not an absolute path) since it is adjusted with
# rebase_path().
if (!defined(fuchsia_sdk_readelf_exec)) {
fuchsia_sdk_readelf_exec = ""
}
}
# third_party/googletest is still using this condition.
using_fuchsia_sdk = true
| engine/build/config/fuchsia/gn_configs.gni/0 | {
"file_path": "engine/build/config/fuchsia/gn_configs.gni",
"repo_id": "engine",
"token_count": 792
} | 194 |
Name: GLFW
License: zlib/libpng (BSD-like)
Upstream Git: https://github.com/glfw/glfw
Version: 3.2.1
Description:
GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and
Vulkan development on the desktop.
To update:
- Advance the pinned hash in DEPS, which should map the repository to
//third_party/glfw
- Update BUILD.gn if necessary for changes.
| engine/build/secondary/flutter/third_party/glfw/README/0 | {
"file_path": "engine/build/secondary/flutter/third_party/glfw/README",
"repo_id": "engine",
"token_count": 117
} | 195 |
# Copyright 2019 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is a dummy file to satisfy the ANGLE build. Flutter's use of ANGLE
# doesn't actually require any of the real content.
| engine/build/secondary/testing/test.gni/0 | {
"file_path": "engine/build/secondary/testing/test.gni",
"repo_id": "engine",
"token_count": 75
} | 196 |
engine/build/secondary/third_party/protobuf/OWNERS/0 | {
"file_path": "engine/build/secondary/third_party/protobuf/OWNERS",
"repo_id": "engine",
"token_count": 40
} | 197 |
|
# Copyright 2020 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is needed by the vulkan-headers build, but doesn't need to actually
# set anything.
if (is_linux) {
vulkan_use_x11 = true
vulkan_use_wayland = true
}
| engine/build_overrides/vulkan_headers.gni/0 | {
"file_path": "engine/build_overrides/vulkan_headers.gni",
"repo_id": "engine",
"token_count": 100
} | 198 |
{
"builds": [
{
"drone_dimensions": [
"device_type=none",
"os=Linux",
"kvm=1",
"cores=8"
],
"gclient_variables": {
"use_rbe": true
},
"gn": [
"--android",
"--android-cpu=x64",
"--no-lto",
"--rbe",
"--no-goma",
"--target-dir",
"android_emulator_opengles_debug_x64"
],
"dependencies": [
{
"dependency": "goldctl",
"version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd"
}
],
"name": "android_emulator_opengles_debug_x64",
"ninja": {
"config": "android_emulator_opengles_debug_x64",
"targets": [
"flutter/testing/scenario_app"
]
},
"tests": [
{
"language": "dart",
"name": "Android Scenario App Integration Tests (Impeller/OpenGLES)",
"test_timeout_secs": 900,
"max_attempts": 2,
"test_dependencies": [
{
"dependency": "android_virtual_device",
"version": "android_34_google_apis_x64.textpb"
},
{
"dependency": "avd_cipd_version",
"version": "build_id:8759428741582061553"
}
],
"contexts": [
"android_virtual_device"
],
"script": "flutter/testing/scenario_app/bin/run_android_tests.dart",
"parameters": [
"--out-dir=../out/android_emulator_opengles_debug_x64",
"--enable-impeller",
"--impeller-backend=opengles"
]
},
{
"language": "dart",
"name": "Android Scenario App Integration Tests (Impeller/OpenGLES, SurfaceTexture)",
"test_timeout_secs": 900,
"max_attempts": 2,
"test_dependencies": [
{
"dependency": "android_virtual_device",
"version": "android_34_google_apis_x64.textpb"
},
{
"dependency": "avd_cipd_version",
"version": "build_id:8759428741582061553"
}
],
"contexts": [
"android_virtual_device"
],
"script": "flutter/testing/scenario_app/bin/run_android_tests.dart",
"parameters": [
"--out-dir=../out/android_emulator_opengles_debug_x64",
"--enable-impeller",
"--impeller-backend=opengles",
"--force-surface-producer-surface-texture"
]
}
]
}
]
}
| engine/ci/builders/linux_android_emulator_opengles.json/0 | {
"file_path": "engine/ci/builders/linux_android_emulator_opengles.json",
"repo_id": "engine",
"token_count": 2318
} | 199 |
{
"drone_dimensions": [
"device_type=none",
"os=Linux"
],
"gclient_variables": {
"download_android_deps": false,
"use_rbe": true
},
"gn": [
"--runtime-mode",
"release",
"--prebuilt-dart-sdk",
"--build-embedder-examples",
"--rbe",
"--no-goma"
],
"name": "host_release",
"ninja": {
"config": "host_release",
"targets": [
"flutter/build/dart:copy_dart_sdk",
"flutter/display_list:display_list_benchmarks",
"flutter/display_list:display_list_builder_benchmarks",
"flutter/display_list:display_list_region_benchmarks",
"flutter/display_list:display_list_transform_benchmarks",
"flutter/fml:fml_benchmarks",
"flutter/impeller/geometry:geometry_benchmarks",
"flutter/impeller/aiks:canvas_benchmarks",
"flutter/lib/ui:ui_benchmarks",
"flutter/shell/common:shell_benchmarks",
"flutter/shell/testing",
"flutter/third_party/txt:txt_benchmarks",
"flutter/tools/path_ops",
"flutter/build/archives:flutter_patched_sdk",
"flutter:unittests"
]
},
"tests": [
{
"language": "bash",
"name": "Generate metrics test",
"script": "flutter/testing/benchmark/generate_metrics.sh"
},
{
"contexts": [
"metric_center_token"
],
"language": "bash",
"name": "Upload metrics",
"script": "flutter/testing/benchmark/upload_metrics.sh"
}
]
}
| engine/ci/builders/standalone/linux_benchmarks.json/0 | {
"file_path": "engine/ci/builders/standalone/linux_benchmarks.json",
"repo_id": "engine",
"token_count": 901
} | 200 |
Signature: 973316a2d1d1e3b6c5f83c1ec7746acb
====================================================================================================
LIBRARY: dart
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/common/builtin_clock.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/clock_snapshot.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/interned_data/interned_data.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/profiling/profile_common.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/profiling/profile_packet.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/trace.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/trace_packet.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/debug_annotation.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/process_descriptor.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/thread_descriptor.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/track_descriptor.proto
ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/track_event.proto
TYPE: LicenseType.apache
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/common/builtin_clock.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/clock_snapshot.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/interned_data/interned_data.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/profiling/profile_common.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/profiling/profile_packet.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/trace.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/trace_packet.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/debug_annotation.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/process_descriptor.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/thread_descriptor.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/track_descriptor.proto
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/track_event.proto
----------------------------------------------------------------------------------------------------
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/bigint_patch.dart
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/bigint_patch.dart
TYPE: LicenseType.mit
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/bigint_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/bigint_patch.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2003-2005 Tom Wu
Copyright (c) 2012 Adam Singer ([email protected])
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
In addition, the following condition applies:
All redistributions must retain an intact copy of this copyright notice
and disclaimer.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/platform/splay-tree-inl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/splay-tree.h + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/platform/splay-tree-inl.h
FILE: ../../../third_party/dart/runtime/platform/splay-tree.h
----------------------------------------------------------------------------------------------------
Copyright (c) 2010, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/snapshot_empty.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/snapshot_in.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/include/dart_tools_api.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/double.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/math.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/mirrors.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/object.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/string.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bitfield.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dart.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dart_api_impl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dart_entry.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dart_entry.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/debugger_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/debugger_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/debugger_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/double_conversion.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/double_conversion.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/exceptions.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/exceptions.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/handle_visitor.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/handles.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/freelist.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/marker.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/marker.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/pages.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/scavenger.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/sweeper.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/sweeper.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/verifier.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/longjump.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/memory_region.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/message.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/message.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/message_handler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/message_handler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/native_entry.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/native_entry.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/native_function.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/port.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/resolver.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/resolver.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/runtime_entry.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/runtime_entry.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/runtime_entry_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/runtime_entry_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/runtime_entry_list.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/runtime_entry_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stack_frame.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stub_code.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/timer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/timer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/token.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/unicode_data.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/visitor.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/queue.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/comparable.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/date_time.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/duration.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/function.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/iterable.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/pattern.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/set.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/stopwatch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/string_buffer.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/html/html_common/device.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/html/html_common/filtered_element_list.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/html/html_common/lists.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/iterable.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/sort.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/snapshot_empty.cc
FILE: ../../../third_party/dart/runtime/bin/snapshot_in.cc
FILE: ../../../third_party/dart/runtime/include/dart_tools_api.h
FILE: ../../../third_party/dart/runtime/lib/double.cc
FILE: ../../../third_party/dart/runtime/lib/math.cc
FILE: ../../../third_party/dart/runtime/lib/mirrors.h
FILE: ../../../third_party/dart/runtime/lib/object.cc
FILE: ../../../third_party/dart/runtime/lib/string.cc
FILE: ../../../third_party/dart/runtime/vm/bitfield.h
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.h
FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/dart.h
FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.h
FILE: ../../../third_party/dart/runtime/vm/dart_entry.cc
FILE: ../../../third_party/dart/runtime/vm/dart_entry.h
FILE: ../../../third_party/dart/runtime/vm/debugger_arm.cc
FILE: ../../../third_party/dart/runtime/vm/debugger_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/debugger_x64.cc
FILE: ../../../third_party/dart/runtime/vm/double_conversion.cc
FILE: ../../../third_party/dart/runtime/vm/double_conversion.h
FILE: ../../../third_party/dart/runtime/vm/exceptions.cc
FILE: ../../../third_party/dart/runtime/vm/exceptions.h
FILE: ../../../third_party/dart/runtime/vm/handle_visitor.h
FILE: ../../../third_party/dart/runtime/vm/handles.h
FILE: ../../../third_party/dart/runtime/vm/heap/freelist.cc
FILE: ../../../third_party/dart/runtime/vm/heap/marker.cc
FILE: ../../../third_party/dart/runtime/vm/heap/marker.h
FILE: ../../../third_party/dart/runtime/vm/heap/pages.h
FILE: ../../../third_party/dart/runtime/vm/heap/scavenger.cc
FILE: ../../../third_party/dart/runtime/vm/heap/sweeper.cc
FILE: ../../../third_party/dart/runtime/vm/heap/sweeper.h
FILE: ../../../third_party/dart/runtime/vm/heap/verifier.h
FILE: ../../../third_party/dart/runtime/vm/longjump.cc
FILE: ../../../third_party/dart/runtime/vm/memory_region.cc
FILE: ../../../third_party/dart/runtime/vm/message.cc
FILE: ../../../third_party/dart/runtime/vm/message.h
FILE: ../../../third_party/dart/runtime/vm/message_handler.cc
FILE: ../../../third_party/dart/runtime/vm/message_handler.h
FILE: ../../../third_party/dart/runtime/vm/native_entry.cc
FILE: ../../../third_party/dart/runtime/vm/native_entry.h
FILE: ../../../third_party/dart/runtime/vm/native_function.h
FILE: ../../../third_party/dart/runtime/vm/os.h
FILE: ../../../third_party/dart/runtime/vm/port.h
FILE: ../../../third_party/dart/runtime/vm/resolver.cc
FILE: ../../../third_party/dart/runtime/vm/resolver.h
FILE: ../../../third_party/dart/runtime/vm/runtime_entry.cc
FILE: ../../../third_party/dart/runtime/vm/runtime_entry.h
FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm.cc
FILE: ../../../third_party/dart/runtime/vm/runtime_entry_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/runtime_entry_list.h
FILE: ../../../third_party/dart/runtime/vm/runtime_entry_x64.cc
FILE: ../../../third_party/dart/runtime/vm/stack_frame.h
FILE: ../../../third_party/dart/runtime/vm/stub_code.h
FILE: ../../../third_party/dart/runtime/vm/timer.cc
FILE: ../../../third_party/dart/runtime/vm/timer.h
FILE: ../../../third_party/dart/runtime/vm/token.cc
FILE: ../../../third_party/dart/runtime/vm/unicode_data.cc
FILE: ../../../third_party/dart/runtime/vm/visitor.h
FILE: ../../../third_party/dart/sdk/lib/collection/queue.dart
FILE: ../../../third_party/dart/sdk/lib/core/comparable.dart
FILE: ../../../third_party/dart/sdk/lib/core/date_time.dart
FILE: ../../../third_party/dart/sdk/lib/core/duration.dart
FILE: ../../../third_party/dart/sdk/lib/core/function.dart
FILE: ../../../third_party/dart/sdk/lib/core/iterable.dart
FILE: ../../../third_party/dart/sdk/lib/core/map.dart
FILE: ../../../third_party/dart/sdk/lib/core/pattern.dart
FILE: ../../../third_party/dart/sdk/lib/core/set.dart
FILE: ../../../third_party/dart/sdk/lib/core/stopwatch.dart
FILE: ../../../third_party/dart/sdk/lib/core/string_buffer.dart
FILE: ../../../third_party/dart/sdk/lib/html/html_common/device.dart
FILE: ../../../third_party/dart/sdk/lib/html/html_common/filtered_element_list.dart
FILE: ../../../third_party/dart/sdk/lib/html/html_common/lists.dart
FILE: ../../../third_party/dart/sdk/lib/internal/iterable.dart
FILE: ../../../third_party/dart/sdk/lib/internal/sort.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/builtin.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/builtin.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/builtin_gen_snapshot.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/builtin_in.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/builtin_natives.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/crashpad.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/crypto.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/crypto.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/crypto_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/crypto_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/crypto_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/dartutils.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/dartutils.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/directory.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/directory.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/directory_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/directory_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/directory_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/eventhandler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/eventhandler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/eventhandler_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/eventhandler_linux.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/eventhandler_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/eventhandler_macos.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/eventhandler_win.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/fdutils.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/fdutils_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/fdutils_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/fdutils_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/io_buffer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/io_buffer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/io_natives.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/isolate_data.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/lockers.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/main.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/main_impl.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/platform.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/platform.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/platform_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/platform_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/platform_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/process.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/process_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/process_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/process_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/run_vm_tests.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/secure_socket_unsupported.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base_linux.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base_macos.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base_win.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread_linux.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread_macos.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread_win.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/utils.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/utils_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/utils_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/utils_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/utils_win.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/include/dart_api.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/array.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/bool.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/date.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/errors.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/function.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/growable_array.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/identical.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/integers.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/isolate.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/mirrors.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/regexp.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/stopwatch.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/assert.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/assert.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/floating_point.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/floating_point_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/floating_point_win.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/globals.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/hashmap.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/hashmap.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/syslog.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/syslog_android.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/syslog_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/syslog_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/syslog_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/text_buffer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/text_buffer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/unicode.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/unicode.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils_android.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils_android.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils_linux.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils_macos.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils_win.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/allocation.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/base_isolate.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bit_set.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bit_vector.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bit_vector.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bitmap.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bitmap.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/boolfield.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bootstrap.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bootstrap.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bootstrap_natives.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bootstrap_natives.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/class_finalizer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/class_table.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/class_table.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_descriptors.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_descriptors.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_observers.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_observers.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_patcher.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_patcher.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_patcher_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_patcher_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/aot/aot_call_specializer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_base.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_x86.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/object_pool_builder.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_printer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_printer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/inliner.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/cha.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/cha.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/intrinsifier.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/intrinsifier.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/jit/compiler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/jit/compiler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpuinfo_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpuinfo_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dart_api_message.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dart_api_state.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/datastream.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/debugger.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/debugger.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/double_internals.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/flag_list.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/flags.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/flags.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/globals.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/growable_array.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/handles.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/handles_impl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/hash_map.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/freelist.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/heap.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/heap.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/pages.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/pointer_block.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/pointer_block.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/scavenger.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/verifier.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions_ia32.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions_x64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/lockers.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/megamorphic_cache_table.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/megamorphic_cache_table.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/memory_region.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/native_arguments.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/native_message_handler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/native_message_handler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_set.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_store.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_android.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_android.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_android.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_linux.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_macos.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_win.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/parser.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/parser.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/port.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/proccpuinfo.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/proccpuinfo.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/raw_object.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/raw_object.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/scopes.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/scopes.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/snapshot.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/snapshot.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stack_frame.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stub_code.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/symbols.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/symbols.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_pool.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_pool.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/token.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/unicode.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/version.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/version_in.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/virtual_memory.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/virtual_memory.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/virtual_memory_posix.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/virtual_memory_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/zone.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/zone.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/crypto.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/http_date.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/foreign_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/interceptors.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_array.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_number.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_string.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/native_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/string_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/async_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/bigint_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/constant_map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/core_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/foreign_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/interceptors.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_array.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_number.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_string.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/math_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/string_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/builtin.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/common_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/directory_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/eventhandler_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/file_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/platform_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/secure_socket_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/array.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/double.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/double_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/empty_source.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/errors_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/expando_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/function_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/growable_array.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/identical_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/immutable_map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/integers.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/invocation_mirror_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/isolate_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/math_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/mirrors_impl.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/mirrors_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/object_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/print_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/regexp_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/stopwatch_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/string_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/timer_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/type_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/weak_property.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/array_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/bool_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/date_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/integers_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/map_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/string_buffer_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/async.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/async_error.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/broadcast_stream_controller.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/future.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/future_impl.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/stream_controller.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/stream_impl.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/stream_pipe.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/timer.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/collection.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/iterable.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/iterator.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/maps.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/splay_tree.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/bool.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/core.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/double.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/errors.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/exceptions.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/identical.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/int.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/invocation.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/iterator.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/list.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/num.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/object.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/print.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/regexp.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/string.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/type.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/uri.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/weak.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/html/dartium/nativewrappers.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/html/html_common/conversions.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/html/html_common/css_class_set.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/html/html_common/html_common_dart2js.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/html/html_common/metadata.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/async_cast.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/cast.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/internal.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/common.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/directory.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/directory_impl.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/eventhandler.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/io.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/platform.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/platform_impl.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/secure_server_socket.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/isolate/isolate.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/math/math.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/math/random.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/builtin.cc
FILE: ../../../third_party/dart/runtime/bin/builtin.h
FILE: ../../../third_party/dart/runtime/bin/builtin_gen_snapshot.cc
FILE: ../../../third_party/dart/runtime/bin/builtin_in.cc
FILE: ../../../third_party/dart/runtime/bin/builtin_natives.cc
FILE: ../../../third_party/dart/runtime/bin/crashpad.cc
FILE: ../../../third_party/dart/runtime/bin/crypto.cc
FILE: ../../../third_party/dart/runtime/bin/crypto.h
FILE: ../../../third_party/dart/runtime/bin/crypto_linux.cc
FILE: ../../../third_party/dart/runtime/bin/crypto_macos.cc
FILE: ../../../third_party/dart/runtime/bin/crypto_win.cc
FILE: ../../../third_party/dart/runtime/bin/dartutils.cc
FILE: ../../../third_party/dart/runtime/bin/dartutils.h
FILE: ../../../third_party/dart/runtime/bin/directory.cc
FILE: ../../../third_party/dart/runtime/bin/directory.h
FILE: ../../../third_party/dart/runtime/bin/directory_linux.cc
FILE: ../../../third_party/dart/runtime/bin/directory_macos.cc
FILE: ../../../third_party/dart/runtime/bin/directory_win.cc
FILE: ../../../third_party/dart/runtime/bin/eventhandler.cc
FILE: ../../../third_party/dart/runtime/bin/eventhandler.h
FILE: ../../../third_party/dart/runtime/bin/eventhandler_linux.cc
FILE: ../../../third_party/dart/runtime/bin/eventhandler_linux.h
FILE: ../../../third_party/dart/runtime/bin/eventhandler_macos.cc
FILE: ../../../third_party/dart/runtime/bin/eventhandler_macos.h
FILE: ../../../third_party/dart/runtime/bin/eventhandler_win.h
FILE: ../../../third_party/dart/runtime/bin/fdutils.h
FILE: ../../../third_party/dart/runtime/bin/fdutils_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/fdutils_linux.cc
FILE: ../../../third_party/dart/runtime/bin/fdutils_macos.cc
FILE: ../../../third_party/dart/runtime/bin/file_linux.cc
FILE: ../../../third_party/dart/runtime/bin/file_macos.cc
FILE: ../../../third_party/dart/runtime/bin/file_win.cc
FILE: ../../../third_party/dart/runtime/bin/io_buffer.cc
FILE: ../../../third_party/dart/runtime/bin/io_buffer.h
FILE: ../../../third_party/dart/runtime/bin/io_natives.h
FILE: ../../../third_party/dart/runtime/bin/isolate_data.h
FILE: ../../../third_party/dart/runtime/bin/lockers.h
FILE: ../../../third_party/dart/runtime/bin/main.cc
FILE: ../../../third_party/dart/runtime/bin/main_impl.cc
FILE: ../../../third_party/dart/runtime/bin/platform.cc
FILE: ../../../third_party/dart/runtime/bin/platform.h
FILE: ../../../third_party/dart/runtime/bin/platform_linux.cc
FILE: ../../../third_party/dart/runtime/bin/platform_macos.cc
FILE: ../../../third_party/dart/runtime/bin/platform_win.cc
FILE: ../../../third_party/dart/runtime/bin/process.h
FILE: ../../../third_party/dart/runtime/bin/process_linux.cc
FILE: ../../../third_party/dart/runtime/bin/process_macos.cc
FILE: ../../../third_party/dart/runtime/bin/process_win.cc
FILE: ../../../third_party/dart/runtime/bin/run_vm_tests.cc
FILE: ../../../third_party/dart/runtime/bin/secure_socket_unsupported.cc
FILE: ../../../third_party/dart/runtime/bin/socket_base_linux.h
FILE: ../../../third_party/dart/runtime/bin/socket_base_macos.h
FILE: ../../../third_party/dart/runtime/bin/socket_base_win.h
FILE: ../../../third_party/dart/runtime/bin/thread.h
FILE: ../../../third_party/dart/runtime/bin/thread_linux.cc
FILE: ../../../third_party/dart/runtime/bin/thread_linux.h
FILE: ../../../third_party/dart/runtime/bin/thread_macos.cc
FILE: ../../../third_party/dart/runtime/bin/thread_macos.h
FILE: ../../../third_party/dart/runtime/bin/thread_win.cc
FILE: ../../../third_party/dart/runtime/bin/thread_win.h
FILE: ../../../third_party/dart/runtime/bin/utils.h
FILE: ../../../third_party/dart/runtime/bin/utils_linux.cc
FILE: ../../../third_party/dart/runtime/bin/utils_macos.cc
FILE: ../../../third_party/dart/runtime/bin/utils_win.cc
FILE: ../../../third_party/dart/runtime/bin/utils_win.h
FILE: ../../../third_party/dart/runtime/include/dart_api.h
FILE: ../../../third_party/dart/runtime/lib/array.cc
FILE: ../../../third_party/dart/runtime/lib/bool.cc
FILE: ../../../third_party/dart/runtime/lib/date.cc
FILE: ../../../third_party/dart/runtime/lib/errors.cc
FILE: ../../../third_party/dart/runtime/lib/function.cc
FILE: ../../../third_party/dart/runtime/lib/growable_array.cc
FILE: ../../../third_party/dart/runtime/lib/identical.cc
FILE: ../../../third_party/dart/runtime/lib/integers.cc
FILE: ../../../third_party/dart/runtime/lib/isolate.cc
FILE: ../../../third_party/dart/runtime/lib/mirrors.cc
FILE: ../../../third_party/dart/runtime/lib/regexp.cc
FILE: ../../../third_party/dart/runtime/lib/stopwatch.cc
FILE: ../../../third_party/dart/runtime/platform/assert.cc
FILE: ../../../third_party/dart/runtime/platform/assert.h
FILE: ../../../third_party/dart/runtime/platform/floating_point.h
FILE: ../../../third_party/dart/runtime/platform/floating_point_win.cc
FILE: ../../../third_party/dart/runtime/platform/floating_point_win.h
FILE: ../../../third_party/dart/runtime/platform/globals.h
FILE: ../../../third_party/dart/runtime/platform/hashmap.cc
FILE: ../../../third_party/dart/runtime/platform/hashmap.h
FILE: ../../../third_party/dart/runtime/platform/syslog.h
FILE: ../../../third_party/dart/runtime/platform/syslog_android.cc
FILE: ../../../third_party/dart/runtime/platform/syslog_linux.cc
FILE: ../../../third_party/dart/runtime/platform/syslog_macos.cc
FILE: ../../../third_party/dart/runtime/platform/syslog_win.cc
FILE: ../../../third_party/dart/runtime/platform/text_buffer.cc
FILE: ../../../third_party/dart/runtime/platform/text_buffer.h
FILE: ../../../third_party/dart/runtime/platform/unicode.cc
FILE: ../../../third_party/dart/runtime/platform/unicode.h
FILE: ../../../third_party/dart/runtime/platform/utils.cc
FILE: ../../../third_party/dart/runtime/platform/utils.h
FILE: ../../../third_party/dart/runtime/platform/utils_android.cc
FILE: ../../../third_party/dart/runtime/platform/utils_android.h
FILE: ../../../third_party/dart/runtime/platform/utils_linux.cc
FILE: ../../../third_party/dart/runtime/platform/utils_linux.h
FILE: ../../../third_party/dart/runtime/platform/utils_macos.cc
FILE: ../../../third_party/dart/runtime/platform/utils_macos.h
FILE: ../../../third_party/dart/runtime/platform/utils_win.cc
FILE: ../../../third_party/dart/runtime/platform/utils_win.h
FILE: ../../../third_party/dart/runtime/vm/allocation.cc
FILE: ../../../third_party/dart/runtime/vm/base_isolate.h
FILE: ../../../third_party/dart/runtime/vm/bit_set.h
FILE: ../../../third_party/dart/runtime/vm/bit_vector.cc
FILE: ../../../third_party/dart/runtime/vm/bit_vector.h
FILE: ../../../third_party/dart/runtime/vm/bitmap.cc
FILE: ../../../third_party/dart/runtime/vm/bitmap.h
FILE: ../../../third_party/dart/runtime/vm/boolfield.h
FILE: ../../../third_party/dart/runtime/vm/bootstrap.cc
FILE: ../../../third_party/dart/runtime/vm/bootstrap.h
FILE: ../../../third_party/dart/runtime/vm/bootstrap_natives.cc
FILE: ../../../third_party/dart/runtime/vm/bootstrap_natives.h
FILE: ../../../third_party/dart/runtime/vm/class_finalizer.h
FILE: ../../../third_party/dart/runtime/vm/class_table.cc
FILE: ../../../third_party/dart/runtime/vm/class_table.h
FILE: ../../../third_party/dart/runtime/vm/code_descriptors.cc
FILE: ../../../third_party/dart/runtime/vm/code_descriptors.h
FILE: ../../../third_party/dart/runtime/vm/code_observers.cc
FILE: ../../../third_party/dart/runtime/vm/code_observers.h
FILE: ../../../third_party/dart/runtime/vm/code_patcher.cc
FILE: ../../../third_party/dart/runtime/vm/code_patcher.h
FILE: ../../../third_party/dart/runtime/vm/code_patcher_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/code_patcher_x64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/aot/aot_call_specializer.h
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler.h
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_base.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_x86.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/object_pool_builder.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_printer.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_printer.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/inliner.h
FILE: ../../../third_party/dart/runtime/vm/compiler/cha.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/cha.h
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder.h
FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier.h
FILE: ../../../third_party/dart/runtime/vm/compiler/jit/compiler.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/jit/compiler.h
FILE: ../../../third_party/dart/runtime/vm/cpu.h
FILE: ../../../third_party/dart/runtime/vm/cpu_arm.cc
FILE: ../../../third_party/dart/runtime/vm/cpu_x64.cc
FILE: ../../../third_party/dart/runtime/vm/cpuinfo_linux.cc
FILE: ../../../third_party/dart/runtime/vm/cpuinfo_macos.cc
FILE: ../../../third_party/dart/runtime/vm/dart_api_message.h
FILE: ../../../third_party/dart/runtime/vm/dart_api_state.h
FILE: ../../../third_party/dart/runtime/vm/datastream.h
FILE: ../../../third_party/dart/runtime/vm/debugger.cc
FILE: ../../../third_party/dart/runtime/vm/debugger.h
FILE: ../../../third_party/dart/runtime/vm/double_internals.h
FILE: ../../../third_party/dart/runtime/vm/flag_list.h
FILE: ../../../third_party/dart/runtime/vm/flags.cc
FILE: ../../../third_party/dart/runtime/vm/flags.h
FILE: ../../../third_party/dart/runtime/vm/globals.h
FILE: ../../../third_party/dart/runtime/vm/growable_array.h
FILE: ../../../third_party/dart/runtime/vm/handles.cc
FILE: ../../../third_party/dart/runtime/vm/handles_impl.h
FILE: ../../../third_party/dart/runtime/vm/hash_map.h
FILE: ../../../third_party/dart/runtime/vm/heap/freelist.h
FILE: ../../../third_party/dart/runtime/vm/heap/heap.cc
FILE: ../../../third_party/dart/runtime/vm/heap/heap.h
FILE: ../../../third_party/dart/runtime/vm/heap/pages.cc
FILE: ../../../third_party/dart/runtime/vm/heap/pointer_block.cc
FILE: ../../../third_party/dart/runtime/vm/heap/pointer_block.h
FILE: ../../../third_party/dart/runtime/vm/heap/scavenger.h
FILE: ../../../third_party/dart/runtime/vm/heap/verifier.cc
FILE: ../../../third_party/dart/runtime/vm/instructions_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/instructions_ia32.h
FILE: ../../../third_party/dart/runtime/vm/instructions_x64.cc
FILE: ../../../third_party/dart/runtime/vm/instructions_x64.h
FILE: ../../../third_party/dart/runtime/vm/lockers.h
FILE: ../../../third_party/dart/runtime/vm/megamorphic_cache_table.cc
FILE: ../../../third_party/dart/runtime/vm/megamorphic_cache_table.h
FILE: ../../../third_party/dart/runtime/vm/memory_region.h
FILE: ../../../third_party/dart/runtime/vm/native_arguments.h
FILE: ../../../third_party/dart/runtime/vm/native_message_handler.cc
FILE: ../../../third_party/dart/runtime/vm/native_message_handler.h
FILE: ../../../third_party/dart/runtime/vm/object.cc
FILE: ../../../third_party/dart/runtime/vm/object.h
FILE: ../../../third_party/dart/runtime/vm/object_set.h
FILE: ../../../third_party/dart/runtime/vm/object_store.h
FILE: ../../../third_party/dart/runtime/vm/os_android.cc
FILE: ../../../third_party/dart/runtime/vm/os_linux.cc
FILE: ../../../third_party/dart/runtime/vm/os_macos.cc
FILE: ../../../third_party/dart/runtime/vm/os_thread.h
FILE: ../../../third_party/dart/runtime/vm/os_thread_android.cc
FILE: ../../../third_party/dart/runtime/vm/os_thread_android.h
FILE: ../../../third_party/dart/runtime/vm/os_thread_linux.cc
FILE: ../../../third_party/dart/runtime/vm/os_thread_linux.h
FILE: ../../../third_party/dart/runtime/vm/os_thread_macos.cc
FILE: ../../../third_party/dart/runtime/vm/os_thread_macos.h
FILE: ../../../third_party/dart/runtime/vm/os_thread_win.cc
FILE: ../../../third_party/dart/runtime/vm/os_thread_win.h
FILE: ../../../third_party/dart/runtime/vm/os_win.cc
FILE: ../../../third_party/dart/runtime/vm/parser.cc
FILE: ../../../third_party/dart/runtime/vm/parser.h
FILE: ../../../third_party/dart/runtime/vm/port.cc
FILE: ../../../third_party/dart/runtime/vm/proccpuinfo.cc
FILE: ../../../third_party/dart/runtime/vm/proccpuinfo.h
FILE: ../../../third_party/dart/runtime/vm/raw_object.cc
FILE: ../../../third_party/dart/runtime/vm/raw_object.h
FILE: ../../../third_party/dart/runtime/vm/scopes.cc
FILE: ../../../third_party/dart/runtime/vm/scopes.h
FILE: ../../../third_party/dart/runtime/vm/snapshot.cc
FILE: ../../../third_party/dart/runtime/vm/snapshot.h
FILE: ../../../third_party/dart/runtime/vm/stack_frame.cc
FILE: ../../../third_party/dart/runtime/vm/stub_code.cc
FILE: ../../../third_party/dart/runtime/vm/symbols.cc
FILE: ../../../third_party/dart/runtime/vm/symbols.h
FILE: ../../../third_party/dart/runtime/vm/thread_pool.cc
FILE: ../../../third_party/dart/runtime/vm/thread_pool.h
FILE: ../../../third_party/dart/runtime/vm/token.h
FILE: ../../../third_party/dart/runtime/vm/unicode.cc
FILE: ../../../third_party/dart/runtime/vm/version.h
FILE: ../../../third_party/dart/runtime/vm/version_in.cc
FILE: ../../../third_party/dart/runtime/vm/virtual_memory.cc
FILE: ../../../third_party/dart/runtime/vm/virtual_memory.h
FILE: ../../../third_party/dart/runtime/vm/virtual_memory_posix.cc
FILE: ../../../third_party/dart/runtime/vm/virtual_memory_win.cc
FILE: ../../../third_party/dart/runtime/vm/zone.cc
FILE: ../../../third_party/dart/runtime/vm/zone.h
FILE: ../../../third_party/dart/sdk/lib/_http/crypto.dart
FILE: ../../../third_party/dart/sdk/lib/_http/http_date.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/foreign_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/interceptors.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_array.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_number.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_string.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/native_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/string_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/async_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/bigint_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/constant_map.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/core_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/foreign_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/interceptors.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_array.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_number.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_string.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/math_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/string_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/builtin.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/common_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/directory_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/eventhandler_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/file_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/platform_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/secure_socket_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/array.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/double.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/double_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/empty_source.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/errors_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/expando_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/function_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/growable_array.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/identical_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/immutable_map.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/integers.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/invocation_mirror_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/isolate_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/math_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/mirrors_impl.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/mirrors_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/object_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/print_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/regexp_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/stopwatch_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/string_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/timer_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/type_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/weak_property.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/array_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/bool_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/date_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/integers_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/map_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/string_buffer_patch.dart
FILE: ../../../third_party/dart/sdk/lib/async/async.dart
FILE: ../../../third_party/dart/sdk/lib/async/async_error.dart
FILE: ../../../third_party/dart/sdk/lib/async/broadcast_stream_controller.dart
FILE: ../../../third_party/dart/sdk/lib/async/future.dart
FILE: ../../../third_party/dart/sdk/lib/async/future_impl.dart
FILE: ../../../third_party/dart/sdk/lib/async/stream_controller.dart
FILE: ../../../third_party/dart/sdk/lib/async/stream_impl.dart
FILE: ../../../third_party/dart/sdk/lib/async/stream_pipe.dart
FILE: ../../../third_party/dart/sdk/lib/async/timer.dart
FILE: ../../../third_party/dart/sdk/lib/collection/collection.dart
FILE: ../../../third_party/dart/sdk/lib/collection/iterable.dart
FILE: ../../../third_party/dart/sdk/lib/collection/iterator.dart
FILE: ../../../third_party/dart/sdk/lib/collection/maps.dart
FILE: ../../../third_party/dart/sdk/lib/collection/splay_tree.dart
FILE: ../../../third_party/dart/sdk/lib/core/bool.dart
FILE: ../../../third_party/dart/sdk/lib/core/core.dart
FILE: ../../../third_party/dart/sdk/lib/core/double.dart
FILE: ../../../third_party/dart/sdk/lib/core/errors.dart
FILE: ../../../third_party/dart/sdk/lib/core/exceptions.dart
FILE: ../../../third_party/dart/sdk/lib/core/identical.dart
FILE: ../../../third_party/dart/sdk/lib/core/int.dart
FILE: ../../../third_party/dart/sdk/lib/core/invocation.dart
FILE: ../../../third_party/dart/sdk/lib/core/iterator.dart
FILE: ../../../third_party/dart/sdk/lib/core/list.dart
FILE: ../../../third_party/dart/sdk/lib/core/num.dart
FILE: ../../../third_party/dart/sdk/lib/core/object.dart
FILE: ../../../third_party/dart/sdk/lib/core/print.dart
FILE: ../../../third_party/dart/sdk/lib/core/regexp.dart
FILE: ../../../third_party/dart/sdk/lib/core/string.dart
FILE: ../../../third_party/dart/sdk/lib/core/type.dart
FILE: ../../../third_party/dart/sdk/lib/core/uri.dart
FILE: ../../../third_party/dart/sdk/lib/core/weak.dart
FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart
FILE: ../../../third_party/dart/sdk/lib/html/dartium/nativewrappers.dart
FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions.dart
FILE: ../../../third_party/dart/sdk/lib/html/html_common/css_class_set.dart
FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common_dart2js.dart
FILE: ../../../third_party/dart/sdk/lib/html/html_common/metadata.dart
FILE: ../../../third_party/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
FILE: ../../../third_party/dart/sdk/lib/internal/async_cast.dart
FILE: ../../../third_party/dart/sdk/lib/internal/cast.dart
FILE: ../../../third_party/dart/sdk/lib/internal/internal.dart
FILE: ../../../third_party/dart/sdk/lib/io/common.dart
FILE: ../../../third_party/dart/sdk/lib/io/directory.dart
FILE: ../../../third_party/dart/sdk/lib/io/directory_impl.dart
FILE: ../../../third_party/dart/sdk/lib/io/eventhandler.dart
FILE: ../../../third_party/dart/sdk/lib/io/io.dart
FILE: ../../../third_party/dart/sdk/lib/io/platform.dart
FILE: ../../../third_party/dart/sdk/lib/io/platform_impl.dart
FILE: ../../../third_party/dart/sdk/lib/io/secure_server_socket.dart
FILE: ../../../third_party/dart/sdk/lib/isolate/isolate.dart
FILE: ../../../third_party/dart/sdk/lib/math/math.dart
FILE: ../../../third_party/dart/sdk/lib/math/random.dart
FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/eventhandler_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_system_watcher.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_system_watcher.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_system_watcher_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_system_watcher_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_system_watcher_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/filter.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/filter.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/gen_snapshot.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/io_natives.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/io_service.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/io_service.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/io_service_no_ssl.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/io_service_no_ssl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/process.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/stdio.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/stdio.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/stdio_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/stdio_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/stdio_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/vmservice_impl.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/vmservice_impl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/include/dart_native_api.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/invocation_mirror.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/libgen_in.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/simd128.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/stacktrace.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/typed_data.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/uri.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/app/application.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/app/location_manager.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_instances.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile_table.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/curly_block.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/error_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/eval_box.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/flag_list.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/any_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/json_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/local_var_descriptors_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/native_memory_profiler.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_common.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectstore_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/observatory_application.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/pc_descriptors_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/sample_buffer_control.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_inset.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_value.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/source_inset.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/stack_trace_tree_config.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/type_arguments_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/unknown_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/tracer.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/atomic.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/signal_blocker.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/allocation.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/class_finalizer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_patcher_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/aot/aot_call_specializer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/inliner.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/locations.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/locations.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/jit/jit_call_specializer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_arm.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_ia32.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_x64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dart.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dart_api_impl.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/deferred_objects.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/deferred_objects.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/deopt_instructions.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/deopt_instructions.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/weak_table.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/weak_table.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions_arm.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/isolate.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/isolate.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/json_stream.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/json_stream.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/native_api_impl.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/native_symbol.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/native_symbol_posix.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/native_symbol_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_id_ring.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_id_ring.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_store.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/profiler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/profiler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/random.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/random.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/reusable_handles.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/service.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/service.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/service_isolate.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/signal_handler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/signal_handler_android.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/signal_handler_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/signal_handler_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/signal_handler_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/simulator.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/simulator_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/simulator_arm.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stack_frame_arm.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stack_frame_ia32.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stack_frame_x64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/tags.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_interrupter.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_interrupter.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_interrupter_android.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_interrupter_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_interrupter_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_interrupter_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/http.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/http_headers.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/http_impl.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/http_parser.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/http_session.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/websocket.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/websocket_impl.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/internal_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/annotations.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_primitives.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_rti.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/mirror_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/annotations.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/collection_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/convert_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/internal_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/io_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_names.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_primitives.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/file_system_entity_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/filter_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/io_service_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/process_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/socket_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/stdio_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/vmservice_io.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/vmservice_server.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/core_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/function.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/internal_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/mirror_reference.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/schedule_microtask_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/stacktrace.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/symbol_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/timer_impl.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/typed_data_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/uri_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/collection_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/null_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/io_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/deferred_load.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/schedule_microtask.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/stream.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/stream_transformers.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/zone.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/collections.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/hash_map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/hash_set.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/linked_hash_map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/linked_hash_set.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/linked_list.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/list.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/ascii.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/byte_conversion.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/chunked_conversion.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/codec.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/convert.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/converter.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/encoding.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/html_escape.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/json.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/latin1.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/line_splitter.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/string_conversion.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/utf.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/annotations.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/null.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/stacktrace.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/string_sink.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/symbol.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/bytes_builder.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/list.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/print.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/symbol.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/data_transformer.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/file.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/file_impl.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/file_system_entity.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/io_service.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/io_sink.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/link.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/secure_socket.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/socket.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/stdio.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/string_transformer.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/js/js.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/math/point.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/math/rectangle.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/mirrors/mirrors.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/typed_data/typed_data.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/vmservice/client.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/vmservice/constants.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/vmservice/message.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/vmservice/message_router.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/vmservice/running_isolate.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/vmservice/running_isolates.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/utils/compiler/create_snapshot_entry.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/eventhandler_win.cc
FILE: ../../../third_party/dart/runtime/bin/file.cc
FILE: ../../../third_party/dart/runtime/bin/file.h
FILE: ../../../third_party/dart/runtime/bin/file_system_watcher.cc
FILE: ../../../third_party/dart/runtime/bin/file_system_watcher.h
FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_linux.cc
FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_macos.cc
FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_win.cc
FILE: ../../../third_party/dart/runtime/bin/filter.cc
FILE: ../../../third_party/dart/runtime/bin/filter.h
FILE: ../../../third_party/dart/runtime/bin/gen_snapshot.cc
FILE: ../../../third_party/dart/runtime/bin/io_natives.cc
FILE: ../../../third_party/dart/runtime/bin/io_service.cc
FILE: ../../../third_party/dart/runtime/bin/io_service.h
FILE: ../../../third_party/dart/runtime/bin/io_service_no_ssl.cc
FILE: ../../../third_party/dart/runtime/bin/io_service_no_ssl.h
FILE: ../../../third_party/dart/runtime/bin/process.cc
FILE: ../../../third_party/dart/runtime/bin/socket.cc
FILE: ../../../third_party/dart/runtime/bin/socket.h
FILE: ../../../third_party/dart/runtime/bin/socket_base_linux.cc
FILE: ../../../third_party/dart/runtime/bin/socket_base_macos.cc
FILE: ../../../third_party/dart/runtime/bin/socket_base_win.cc
FILE: ../../../third_party/dart/runtime/bin/socket_linux.cc
FILE: ../../../third_party/dart/runtime/bin/socket_macos.cc
FILE: ../../../third_party/dart/runtime/bin/socket_win.cc
FILE: ../../../third_party/dart/runtime/bin/stdio.cc
FILE: ../../../third_party/dart/runtime/bin/stdio.h
FILE: ../../../third_party/dart/runtime/bin/stdio_linux.cc
FILE: ../../../third_party/dart/runtime/bin/stdio_macos.cc
FILE: ../../../third_party/dart/runtime/bin/stdio_win.cc
FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.cc
FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.h
FILE: ../../../third_party/dart/runtime/include/dart_native_api.h
FILE: ../../../third_party/dart/runtime/lib/invocation_mirror.h
FILE: ../../../third_party/dart/runtime/lib/libgen_in.cc
FILE: ../../../third_party/dart/runtime/lib/simd128.cc
FILE: ../../../third_party/dart/runtime/lib/stacktrace.cc
FILE: ../../../third_party/dart/runtime/lib/typed_data.cc
FILE: ../../../third_party/dart/runtime/lib/uri.cc
FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/application.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/location_manager.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_instances.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile_table.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/curly_block.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/error_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/eval_box.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/flag_list.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/any_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/json_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/local_var_descriptors_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/native_memory_profiler.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_common.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectstore_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/observatory_application.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/pc_descriptors_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sample_buffer_control.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_inset.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_value.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/source_inset.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/stack_trace_tree_config.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/type_arguments_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unknown_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/tracer.dart
FILE: ../../../third_party/dart/runtime/platform/atomic.h
FILE: ../../../third_party/dart/runtime/platform/signal_blocker.h
FILE: ../../../third_party/dart/runtime/vm/allocation.h
FILE: ../../../third_party/dart/runtime/vm/class_finalizer.cc
FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/aot/aot_call_specializer.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.h
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.h
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.h
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_x64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/inliner.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.h
FILE: ../../../third_party/dart/runtime/vm/compiler/jit/jit_call_specializer.cc
FILE: ../../../third_party/dart/runtime/vm/constants_arm.h
FILE: ../../../third_party/dart/runtime/vm/constants_ia32.h
FILE: ../../../third_party/dart/runtime/vm/constants_x64.h
FILE: ../../../third_party/dart/runtime/vm/dart.cc
FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.cc
FILE: ../../../third_party/dart/runtime/vm/deferred_objects.cc
FILE: ../../../third_party/dart/runtime/vm/deferred_objects.h
FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.cc
FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.h
FILE: ../../../third_party/dart/runtime/vm/heap/weak_table.cc
FILE: ../../../third_party/dart/runtime/vm/heap/weak_table.h
FILE: ../../../third_party/dart/runtime/vm/instructions.h
FILE: ../../../third_party/dart/runtime/vm/instructions_arm.cc
FILE: ../../../third_party/dart/runtime/vm/instructions_arm.h
FILE: ../../../third_party/dart/runtime/vm/isolate.cc
FILE: ../../../third_party/dart/runtime/vm/isolate.h
FILE: ../../../third_party/dart/runtime/vm/json_stream.cc
FILE: ../../../third_party/dart/runtime/vm/json_stream.h
FILE: ../../../third_party/dart/runtime/vm/native_api_impl.cc
FILE: ../../../third_party/dart/runtime/vm/native_symbol.h
FILE: ../../../third_party/dart/runtime/vm/native_symbol_posix.cc
FILE: ../../../third_party/dart/runtime/vm/native_symbol_win.cc
FILE: ../../../third_party/dart/runtime/vm/object_id_ring.cc
FILE: ../../../third_party/dart/runtime/vm/object_id_ring.h
FILE: ../../../third_party/dart/runtime/vm/object_store.cc
FILE: ../../../third_party/dart/runtime/vm/profiler.cc
FILE: ../../../third_party/dart/runtime/vm/profiler.h
FILE: ../../../third_party/dart/runtime/vm/random.cc
FILE: ../../../third_party/dart/runtime/vm/random.h
FILE: ../../../third_party/dart/runtime/vm/reusable_handles.h
FILE: ../../../third_party/dart/runtime/vm/service.cc
FILE: ../../../third_party/dart/runtime/vm/service.h
FILE: ../../../third_party/dart/runtime/vm/service_isolate.h
FILE: ../../../third_party/dart/runtime/vm/signal_handler.h
FILE: ../../../third_party/dart/runtime/vm/signal_handler_android.cc
FILE: ../../../third_party/dart/runtime/vm/signal_handler_linux.cc
FILE: ../../../third_party/dart/runtime/vm/signal_handler_macos.cc
FILE: ../../../third_party/dart/runtime/vm/signal_handler_win.cc
FILE: ../../../third_party/dart/runtime/vm/simulator.h
FILE: ../../../third_party/dart/runtime/vm/simulator_arm.cc
FILE: ../../../third_party/dart/runtime/vm/simulator_arm.h
FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm.h
FILE: ../../../third_party/dart/runtime/vm/stack_frame_ia32.h
FILE: ../../../third_party/dart/runtime/vm/stack_frame_x64.h
FILE: ../../../third_party/dart/runtime/vm/tags.h
FILE: ../../../third_party/dart/runtime/vm/thread_interrupter.cc
FILE: ../../../third_party/dart/runtime/vm/thread_interrupter.h
FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_android.cc
FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_linux.cc
FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_macos.cc
FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_win.cc
FILE: ../../../third_party/dart/sdk/lib/_http/http.dart
FILE: ../../../third_party/dart/sdk/lib/_http/http_headers.dart
FILE: ../../../third_party/dart/sdk/lib/_http/http_impl.dart
FILE: ../../../third_party/dart/sdk/lib/_http/http_parser.dart
FILE: ../../../third_party/dart/sdk/lib/_http/http_session.dart
FILE: ../../../third_party/dart/sdk/lib/_http/websocket.dart
FILE: ../../../third_party/dart/sdk/lib/_http/websocket_impl.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/internal_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/annotations.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_primitives.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_rti.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/mirror_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/annotations.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/collection_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/convert_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/internal_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/io_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_names.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_primitives.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/file_system_entity_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/filter_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/io_service_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/process_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/socket_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/stdio_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/vmservice_io.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/vmservice_server.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/core_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/function.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/internal_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/mirror_reference.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/schedule_microtask_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/stacktrace.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/symbol_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/timer_impl.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/typed_data_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/uri_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/collection_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/null_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/io_patch.dart
FILE: ../../../third_party/dart/sdk/lib/async/deferred_load.dart
FILE: ../../../third_party/dart/sdk/lib/async/schedule_microtask.dart
FILE: ../../../third_party/dart/sdk/lib/async/stream.dart
FILE: ../../../third_party/dart/sdk/lib/async/stream_transformers.dart
FILE: ../../../third_party/dart/sdk/lib/async/zone.dart
FILE: ../../../third_party/dart/sdk/lib/collection/collections.dart
FILE: ../../../third_party/dart/sdk/lib/collection/hash_map.dart
FILE: ../../../third_party/dart/sdk/lib/collection/hash_set.dart
FILE: ../../../third_party/dart/sdk/lib/collection/linked_hash_map.dart
FILE: ../../../third_party/dart/sdk/lib/collection/linked_hash_set.dart
FILE: ../../../third_party/dart/sdk/lib/collection/linked_list.dart
FILE: ../../../third_party/dart/sdk/lib/collection/list.dart
FILE: ../../../third_party/dart/sdk/lib/convert/ascii.dart
FILE: ../../../third_party/dart/sdk/lib/convert/byte_conversion.dart
FILE: ../../../third_party/dart/sdk/lib/convert/chunked_conversion.dart
FILE: ../../../third_party/dart/sdk/lib/convert/codec.dart
FILE: ../../../third_party/dart/sdk/lib/convert/convert.dart
FILE: ../../../third_party/dart/sdk/lib/convert/converter.dart
FILE: ../../../third_party/dart/sdk/lib/convert/encoding.dart
FILE: ../../../third_party/dart/sdk/lib/convert/html_escape.dart
FILE: ../../../third_party/dart/sdk/lib/convert/json.dart
FILE: ../../../third_party/dart/sdk/lib/convert/latin1.dart
FILE: ../../../third_party/dart/sdk/lib/convert/line_splitter.dart
FILE: ../../../third_party/dart/sdk/lib/convert/string_conversion.dart
FILE: ../../../third_party/dart/sdk/lib/convert/utf.dart
FILE: ../../../third_party/dart/sdk/lib/core/annotations.dart
FILE: ../../../third_party/dart/sdk/lib/core/null.dart
FILE: ../../../third_party/dart/sdk/lib/core/stacktrace.dart
FILE: ../../../third_party/dart/sdk/lib/core/string_sink.dart
FILE: ../../../third_party/dart/sdk/lib/core/symbol.dart
FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart
FILE: ../../../third_party/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
FILE: ../../../third_party/dart/sdk/lib/internal/bytes_builder.dart
FILE: ../../../third_party/dart/sdk/lib/internal/list.dart
FILE: ../../../third_party/dart/sdk/lib/internal/print.dart
FILE: ../../../third_party/dart/sdk/lib/internal/symbol.dart
FILE: ../../../third_party/dart/sdk/lib/io/data_transformer.dart
FILE: ../../../third_party/dart/sdk/lib/io/file.dart
FILE: ../../../third_party/dart/sdk/lib/io/file_impl.dart
FILE: ../../../third_party/dart/sdk/lib/io/file_system_entity.dart
FILE: ../../../third_party/dart/sdk/lib/io/io_service.dart
FILE: ../../../third_party/dart/sdk/lib/io/io_sink.dart
FILE: ../../../third_party/dart/sdk/lib/io/link.dart
FILE: ../../../third_party/dart/sdk/lib/io/secure_socket.dart
FILE: ../../../third_party/dart/sdk/lib/io/socket.dart
FILE: ../../../third_party/dart/sdk/lib/io/stdio.dart
FILE: ../../../third_party/dart/sdk/lib/io/string_transformer.dart
FILE: ../../../third_party/dart/sdk/lib/js/js.dart
FILE: ../../../third_party/dart/sdk/lib/math/point.dart
FILE: ../../../third_party/dart/sdk/lib/math/rectangle.dart
FILE: ../../../third_party/dart/sdk/lib/mirrors/mirrors.dart
FILE: ../../../third_party/dart/sdk/lib/typed_data/typed_data.dart
FILE: ../../../third_party/dart/sdk/lib/vmservice/client.dart
FILE: ../../../third_party/dart/sdk/lib/vmservice/constants.dart
FILE: ../../../third_party/dart/sdk/lib/vmservice/message.dart
FILE: ../../../third_party/dart/sdk/lib/vmservice/message_router.dart
FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolate.dart
FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolates.dart
FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
FILE: ../../../third_party/dart/utils/compiler/create_snapshot_entry.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/observatory/web/third_party/webcomponents.min.js + http://polymer.github.io/LICENSE.txt referenced by ../../../third_party/dart/runtime/observatory/web/third_party/webcomponents.min.js
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/observatory/web/third_party/webcomponents.min.js
----------------------------------------------------------------------------------------------------
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/lib/profiler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/bin/shell.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/app.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/object_graph.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/service.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/service_common.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/service_html.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/service_io.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/app/page.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/app/settings.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/app/view_model.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/allocation_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_tree.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/debugger.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_reconnect.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/metrics.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/service/object.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/utils.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/web/main.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/address_sanitizer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/memory_sanitizer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/safe_stack.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_arm64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu_arm.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu_arm64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu_ia32.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu_x64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpuid.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpuid.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpuinfo.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpuinfo_android.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpuinfo_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/debugger_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/hash_table.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/spaces.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/weak_code.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/weak_code.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions_arm64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/metrics.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/metrics.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_graph.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_graph.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_assembler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_assembler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_ast.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_ast.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_parser.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_parser.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/report.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/report.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/ring_buffer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/runtime_entry_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/simulator_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/simulator_arm64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stack_frame_arm64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/tags.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/unibrow-inl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/unibrow.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/unibrow.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/preambles/d8.js + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/preambles/jsshell.js + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/synced/embedded_names.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/convert_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/lib_prefix.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/profiler.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/collection/set.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/sink.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/developer/profiler.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/process.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/service_object.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/isolate/capability.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/lib/profiler.cc
FILE: ../../../third_party/dart/runtime/observatory/bin/shell.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/app.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/object_graph.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/service.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/service_common.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/service_html.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/service_io.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/page.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/settings.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/view_model.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/allocation_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_tree.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/debugger.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_map.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_reconnect.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metrics.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/service/object.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/utils.dart
FILE: ../../../third_party/dart/runtime/observatory/web/main.dart
FILE: ../../../third_party/dart/runtime/platform/address_sanitizer.h
FILE: ../../../third_party/dart/runtime/platform/memory_sanitizer.h
FILE: ../../../third_party/dart/runtime/platform/safe_stack.h
FILE: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart
FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.h
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.h
FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.h
FILE: ../../../third_party/dart/runtime/vm/constants_arm64.h
FILE: ../../../third_party/dart/runtime/vm/cpu_arm.h
FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.h
FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.h
FILE: ../../../third_party/dart/runtime/vm/cpu_x64.h
FILE: ../../../third_party/dart/runtime/vm/cpuid.cc
FILE: ../../../third_party/dart/runtime/vm/cpuid.h
FILE: ../../../third_party/dart/runtime/vm/cpuinfo.h
FILE: ../../../third_party/dart/runtime/vm/cpuinfo_android.cc
FILE: ../../../third_party/dart/runtime/vm/cpuinfo_win.cc
FILE: ../../../third_party/dart/runtime/vm/debugger_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/hash_table.h
FILE: ../../../third_party/dart/runtime/vm/heap/spaces.h
FILE: ../../../third_party/dart/runtime/vm/heap/weak_code.cc
FILE: ../../../third_party/dart/runtime/vm/heap/weak_code.h
FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.h
FILE: ../../../third_party/dart/runtime/vm/metrics.cc
FILE: ../../../third_party/dart/runtime/vm/metrics.h
FILE: ../../../third_party/dart/runtime/vm/object_graph.cc
FILE: ../../../third_party/dart/runtime/vm/object_graph.h
FILE: ../../../third_party/dart/runtime/vm/regexp.cc
FILE: ../../../third_party/dart/runtime/vm/regexp.h
FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.cc
FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.h
FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.cc
FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.h
FILE: ../../../third_party/dart/runtime/vm/regexp_ast.cc
FILE: ../../../third_party/dart/runtime/vm/regexp_ast.h
FILE: ../../../third_party/dart/runtime/vm/regexp_parser.cc
FILE: ../../../third_party/dart/runtime/vm/regexp_parser.h
FILE: ../../../third_party/dart/runtime/vm/report.cc
FILE: ../../../third_party/dart/runtime/vm/report.h
FILE: ../../../third_party/dart/runtime/vm/ring_buffer.h
FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.h
FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm64.h
FILE: ../../../third_party/dart/runtime/vm/tags.cc
FILE: ../../../third_party/dart/runtime/vm/unibrow-inl.h
FILE: ../../../third_party/dart/runtime/vm/unibrow.cc
FILE: ../../../third_party/dart/runtime/vm/unibrow.h
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/preambles/d8.js
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/preambles/jsshell.js
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/synced/embedded_names.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/convert_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/lib_prefix.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/profiler.dart
FILE: ../../../third_party/dart/sdk/lib/collection/set.dart
FILE: ../../../third_party/dart/sdk/lib/core/sink.dart
FILE: ../../../third_party/dart/sdk/lib/developer/profiler.dart
FILE: ../../../third_party/dart/sdk/lib/io/process.dart
FILE: ../../../third_party/dart/sdk/lib/io/service_object.dart
FILE: ../../../third_party/dart/sdk/lib/isolate/capability.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/address_sanitizer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/dart_io_api_impl.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/observatory_assets_empty.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/include/bin/dart_io_api.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/developer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/timeline.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/vmservice.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/allocation_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/cli.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/debugger.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/sample_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/allocation_profile/allocation_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/cli/command.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger_location.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging_list.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/persistent_handles.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/ports.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/timeline_page.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/sample_profile/sample_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/web/timeline.js + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/log.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/log.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/profiler_service.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/profiler_service.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/program_visitor.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/program_visitor.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode_inl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_bytecodes.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_interpreter.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/regexp_interpreter.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/scope_timer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/service_event.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/service_event.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/service_isolate.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/source_report.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/source_report.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_barrier.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_registry.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_registry.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/timeline.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/timeline.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/developer_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/utils.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/debugger.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/developer_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/d8.js + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/synced/async_status_codes.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/async_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/developer.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/timeline.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/compact_hash.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/convert/base64.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/developer/developer.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/developer/extension.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/developer/timeline.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/io_resource_info.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/security_context.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/js/_js_annotations.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/vmservice/asset.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/vmservice/vmservice.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/address_sanitizer.cc
FILE: ../../../third_party/dart/runtime/bin/dart_io_api_impl.cc
FILE: ../../../third_party/dart/runtime/bin/observatory_assets_empty.cc
FILE: ../../../third_party/dart/runtime/include/bin/dart_io_api.h
FILE: ../../../third_party/dart/runtime/lib/developer.cc
FILE: ../../../third_party/dart/runtime/lib/timeline.cc
FILE: ../../../third_party/dart/runtime/lib/vmservice.cc
FILE: ../../../third_party/dart/runtime/observatory/lib/allocation_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/cli.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/debugger.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/sample_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/allocation_profile/allocation_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/cli/command.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger_location.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging_list.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/persistent_handles.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/ports.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/timeline_page.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/sample_profile/sample_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/web/timeline.js
FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.h
FILE: ../../../third_party/dart/runtime/vm/log.cc
FILE: ../../../third_party/dart/runtime/vm/log.h
FILE: ../../../third_party/dart/runtime/vm/os_thread.cc
FILE: ../../../third_party/dart/runtime/vm/profiler_service.cc
FILE: ../../../third_party/dart/runtime/vm/profiler_service.h
FILE: ../../../third_party/dart/runtime/vm/program_visitor.cc
FILE: ../../../third_party/dart/runtime/vm/program_visitor.h
FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.cc
FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.h
FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode_inl.h
FILE: ../../../third_party/dart/runtime/vm/regexp_bytecodes.h
FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.cc
FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.h
FILE: ../../../third_party/dart/runtime/vm/scope_timer.h
FILE: ../../../third_party/dart/runtime/vm/service_event.cc
FILE: ../../../third_party/dart/runtime/vm/service_event.h
FILE: ../../../third_party/dart/runtime/vm/service_isolate.cc
FILE: ../../../third_party/dart/runtime/vm/source_report.cc
FILE: ../../../third_party/dart/runtime/vm/source_report.h
FILE: ../../../third_party/dart/runtime/vm/thread.cc
FILE: ../../../third_party/dart/runtime/vm/thread.h
FILE: ../../../third_party/dart/runtime/vm/thread_barrier.h
FILE: ../../../third_party/dart/runtime/vm/thread_registry.cc
FILE: ../../../third_party/dart/runtime/vm/thread_registry.h
FILE: ../../../third_party/dart/runtime/vm/timeline.cc
FILE: ../../../third_party/dart/runtime/vm/timeline.h
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/developer_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/utils.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/debugger.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/d8.js
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/synced/async_status_codes.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/async_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/developer.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/timeline.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/compact_hash.dart
FILE: ../../../third_party/dart/sdk/lib/convert/base64.dart
FILE: ../../../third_party/dart/sdk/lib/developer/developer.dart
FILE: ../../../third_party/dart/sdk/lib/developer/extension.dart
FILE: ../../../third_party/dart/sdk/lib/developer/timeline.dart
FILE: ../../../third_party/dart/sdk/lib/io/io_resource_info.dart
FILE: ../../../third_party/dart/sdk/lib/io/security_context.dart
FILE: ../../../third_party/dart/sdk/lib/js/_js_annotations.dart
FILE: ../../../third_party/dart/sdk/lib/vmservice/asset.dart
FILE: ../../../third_party/dart/sdk/lib/vmservice/vmservice.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/crypto_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/directory_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/eventhandler_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/eventhandler_fuchsia.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_support.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_system_watcher_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/loader.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/loader.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/platform_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/process_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/reference_counting.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/root_certificates_unsupported.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base_fuchsia.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/stdio_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread_fuchsia.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/utils_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/stacktrace.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/event.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/models.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/repositories.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/app/notification.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_allocation_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/virtual_collection.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/virtual_tree.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/error_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/general_error.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/custom_element.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/nav_bar.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/nav_menu.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/rendering_queue.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/rendering_scheduler.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/uris.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/inbound_references.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/counter_chart.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/location.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/run_state.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/shared_summary.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/summary.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/metric/details.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/metric/graph.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/class_menu.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/isolate_menu.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/library_menu.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/menu_item.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify_event.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify_exception.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/refresh.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/top_menu.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/vm_menu.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/retaining_path.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/source_link.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/strongly_reachable_instances.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect_target.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/exceptions.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/allocation_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/breakpoint.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/class.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/code.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/context.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/error.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/event.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/extension_data.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/field.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/flag.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/frame.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/function.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/guarded.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/heap_space.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/icdata.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/inbound_references.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/instance.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/isolate.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/library.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/local_var_descriptors.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/map_association.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/megamorphiccache.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/metric.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/notification.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/object.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/objectpool.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/objectstore.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/pc_descriptors.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/persistent_handles.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/ports.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/retaining_path.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/sample_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/script.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/sentinel.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/source_location.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/target.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/timeline_event.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/type_arguments.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/unknown.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/vm.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/allocation_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/breakpoint.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/class.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/context.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/editor.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/eval.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/event.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/field.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/flag.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/function.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/heap_snapshot.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/icdata.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/inbound_references.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/instance.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/isolate.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/library.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/megamorphiccache.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/metric.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/notification.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/object.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/objectpool.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/objectstore.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/persistent_handles.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/ports.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/reachable_size.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/retained_size.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/retaining_path.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/sample_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/script.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/strongly_reachable_instances.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/target.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/type_arguments.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/allocation_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/breakpoint.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/class.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/context.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/editor.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/eval.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/event.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/field.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/flag.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/function.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/heap_snapshot.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/icdata.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/inbound_references.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/instance.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/isolate.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/library.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/megamorphiccache.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/metric.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/notification.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/object.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/objectpool.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/objectstore.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/persistent_handles.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/ports.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/reachable_size.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/retained_size.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/retaining_path.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/sample_profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/script.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/settings.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/strongly_reachable_instances.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/target.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/type_arguments.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/web/timeline_message_handler.js + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/syslog_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/utils_fuchsia.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/app_snapshot.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/app_snapshot.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/canonical_tables.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/branch_optimizer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/branch_optimizer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpuinfo_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dart_api_state.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/become.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/become.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/safepoint.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/safepoint.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/isolate_reload.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/isolate_reload.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/kernel.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/kernel.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/kernel_binary.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/kernel_isolate.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/kernel_isolate.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/kernel_loader.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/kernel_loader.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/lockers.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_reload.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_service.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_fuchsia.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/signal_handler_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_interrupter_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/token_position.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/token_position.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/uri.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/uri.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/virtual_memory_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/developer/service.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/js_util/js_util.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/vmservice/devfs.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/crypto_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/directory_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/eventhandler_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/eventhandler_fuchsia.h
FILE: ../../../third_party/dart/runtime/bin/file_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/file_support.cc
FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/loader.cc
FILE: ../../../third_party/dart/runtime/bin/loader.h
FILE: ../../../third_party/dart/runtime/bin/platform_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/process_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/reference_counting.h
FILE: ../../../third_party/dart/runtime/bin/root_certificates_unsupported.cc
FILE: ../../../third_party/dart/runtime/bin/socket_base_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/socket_base_fuchsia.h
FILE: ../../../third_party/dart/runtime/bin/socket_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/stdio_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/thread_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/thread_fuchsia.h
FILE: ../../../third_party/dart/runtime/bin/utils_fuchsia.cc
FILE: ../../../third_party/dart/runtime/lib/stacktrace.h
FILE: ../../../third_party/dart/runtime/observatory/lib/event.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/models.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/repositories.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/notification.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_allocation_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/virtual_collection.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/virtual_tree.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/error_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/general_error.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/custom_element.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/nav_bar.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/nav_menu.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/rendering_queue.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/rendering_scheduler.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/uris.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/inbound_references.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/counter_chart.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/location.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/run_state.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/shared_summary.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/summary.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metric/details.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metric/graph.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/class_menu.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/isolate_menu.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/library_menu.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/menu_item.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify_event.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify_exception.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/refresh.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/top_menu.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/vm_menu.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/retaining_path.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/source_link.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/strongly_reachable_instances.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect_target.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/exceptions.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/allocation_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/breakpoint.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/class.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/code.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/context.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/error.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/event.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/extension_data.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/field.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/flag.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/frame.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/function.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/guarded.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/heap_space.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/icdata.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/inbound_references.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/instance.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/isolate.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/library.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/local_var_descriptors.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/map_association.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/megamorphiccache.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/metric.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/notification.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/object.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/objectpool.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/objectstore.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/pc_descriptors.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/persistent_handles.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/ports.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/retaining_path.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/sample_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/script.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/sentinel.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/source_location.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/target.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/timeline_event.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/type_arguments.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/unknown.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/vm.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/allocation_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/breakpoint.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/class.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/context.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/editor.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/eval.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/event.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/field.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/flag.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/function.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/heap_snapshot.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/icdata.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/inbound_references.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/instance.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/isolate.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/library.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/megamorphiccache.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/metric.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/notification.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/object.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/objectpool.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/objectstore.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/persistent_handles.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/ports.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/reachable_size.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/retained_size.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/retaining_path.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/sample_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/script.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/strongly_reachable_instances.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/target.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/type_arguments.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/allocation_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/breakpoint.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/class.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/context.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/editor.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/eval.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/event.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/field.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/flag.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/function.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/heap_snapshot.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/icdata.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/inbound_references.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/instance.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/isolate.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/library.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/megamorphiccache.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/metric.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/notification.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/object.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/objectpool.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/objectstore.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/persistent_handles.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/ports.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/reachable_size.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/retained_size.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/retaining_path.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/sample_profile.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/script.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/settings.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/strongly_reachable_instances.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/target.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/type_arguments.dart
FILE: ../../../third_party/dart/runtime/observatory/web/timeline_message_handler.js
FILE: ../../../third_party/dart/runtime/platform/syslog_fuchsia.cc
FILE: ../../../third_party/dart/runtime/platform/utils_fuchsia.cc
FILE: ../../../third_party/dart/runtime/platform/utils_fuchsia.h
FILE: ../../../third_party/dart/runtime/vm/app_snapshot.cc
FILE: ../../../third_party/dart/runtime/vm/app_snapshot.h
FILE: ../../../third_party/dart/runtime/vm/canonical_tables.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/branch_optimizer.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/branch_optimizer.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.h
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.h
FILE: ../../../third_party/dart/runtime/vm/cpuinfo_fuchsia.cc
FILE: ../../../third_party/dart/runtime/vm/dart_api_state.cc
FILE: ../../../third_party/dart/runtime/vm/heap/become.cc
FILE: ../../../third_party/dart/runtime/vm/heap/become.h
FILE: ../../../third_party/dart/runtime/vm/heap/safepoint.cc
FILE: ../../../third_party/dart/runtime/vm/heap/safepoint.h
FILE: ../../../third_party/dart/runtime/vm/isolate_reload.cc
FILE: ../../../third_party/dart/runtime/vm/isolate_reload.h
FILE: ../../../third_party/dart/runtime/vm/kernel.cc
FILE: ../../../third_party/dart/runtime/vm/kernel.h
FILE: ../../../third_party/dart/runtime/vm/kernel_binary.cc
FILE: ../../../third_party/dart/runtime/vm/kernel_isolate.cc
FILE: ../../../third_party/dart/runtime/vm/kernel_isolate.h
FILE: ../../../third_party/dart/runtime/vm/kernel_loader.cc
FILE: ../../../third_party/dart/runtime/vm/kernel_loader.h
FILE: ../../../third_party/dart/runtime/vm/lockers.cc
FILE: ../../../third_party/dart/runtime/vm/object_reload.cc
FILE: ../../../third_party/dart/runtime/vm/object_service.cc
FILE: ../../../third_party/dart/runtime/vm/os_fuchsia.cc
FILE: ../../../third_party/dart/runtime/vm/os_thread_fuchsia.cc
FILE: ../../../third_party/dart/runtime/vm/os_thread_fuchsia.h
FILE: ../../../third_party/dart/runtime/vm/signal_handler_fuchsia.cc
FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_fuchsia.cc
FILE: ../../../third_party/dart/runtime/vm/token_position.cc
FILE: ../../../third_party/dart/runtime/vm/token_position.h
FILE: ../../../third_party/dart/runtime/vm/uri.cc
FILE: ../../../third_party/dart/runtime/vm/uri.h
FILE: ../../../third_party/dart/runtime/vm/virtual_memory_fuchsia.cc
FILE: ../../../third_party/dart/sdk/lib/developer/service.dart
FILE: ../../../third_party/dart/sdk/lib/js_util/js_util.dart
FILE: ../../../third_party/dart/sdk/lib/vmservice/devfs.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/dfe.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/dfe.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/error_exit.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/error_exit.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/gzip.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/gzip.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/isolate_data.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/main_options.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/main_options.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/namespace.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/namespace.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/namespace_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/namespace_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/namespace_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/namespace_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/options.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/options.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/secure_socket_filter.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/secure_socket_filter.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/secure_socket_utils.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/secure_socket_utils.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/security_context.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/security_context.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/security_context_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/security_context_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/security_context_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/security_context_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/snapshot_utils.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/snapshot_utils.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/sync_socket.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/sync_socket.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/sync_socket_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/sync_socket_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/sync_socket_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/sync_socket_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/async.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/search_bar.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/reload.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/singletargetcache_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/singletargetcache_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/subtypetestcache_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/subtypetestcache_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/unlinkedcall_ref.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/unlinkedcall_view.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/service.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/single_target_cache.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/subtype_test_cache.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/timeline.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/unlinked_call.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/single_target_cache.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/subtype_test_cache.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/timeline.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/unlinked_call.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/vm.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/single_target_cache.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/subtype_test_cache.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/timeline.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/unlinked_call.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/vm.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/allocation.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/growable_array.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_riscv.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers_arm.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/call_specializer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/call_specializer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/prologue_builder.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/prologue_builder.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/jit/jit_call_specializer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_riscv.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_x86.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dwarf.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dwarf.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/fixed_cache.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/gdb_helpers.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/compactor.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/compactor.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/image_snapshot.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/image_snapshot.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/json_writer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/json_writer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/kernel_binary.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/simulator_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/simulator_riscv.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stack_trace.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stack_trace.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/timeline_android.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/timeline_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/timeline_linux.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/zone_text_buffer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/zone_text_buffer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/overrides.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/identity_hash_map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/profile.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/namespace_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/bin/sync_socket_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/class_id_fasta.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/bigint_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/cli/cli.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/bigint.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/linked_list.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/embedder_config.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/namespace_impl.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/overrides.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/io/sync_socket.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/vmservice/named_lookup.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/utils/bazel/kernel_worker.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/dfe.cc
FILE: ../../../third_party/dart/runtime/bin/dfe.h
FILE: ../../../third_party/dart/runtime/bin/error_exit.cc
FILE: ../../../third_party/dart/runtime/bin/error_exit.h
FILE: ../../../third_party/dart/runtime/bin/gzip.cc
FILE: ../../../third_party/dart/runtime/bin/gzip.h
FILE: ../../../third_party/dart/runtime/bin/isolate_data.cc
FILE: ../../../third_party/dart/runtime/bin/main_options.cc
FILE: ../../../third_party/dart/runtime/bin/main_options.h
FILE: ../../../third_party/dart/runtime/bin/namespace.cc
FILE: ../../../third_party/dart/runtime/bin/namespace.h
FILE: ../../../third_party/dart/runtime/bin/namespace_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/namespace_linux.cc
FILE: ../../../third_party/dart/runtime/bin/namespace_macos.cc
FILE: ../../../third_party/dart/runtime/bin/namespace_win.cc
FILE: ../../../third_party/dart/runtime/bin/options.cc
FILE: ../../../third_party/dart/runtime/bin/options.h
FILE: ../../../third_party/dart/runtime/bin/secure_socket_filter.cc
FILE: ../../../third_party/dart/runtime/bin/secure_socket_filter.h
FILE: ../../../third_party/dart/runtime/bin/secure_socket_utils.cc
FILE: ../../../third_party/dart/runtime/bin/secure_socket_utils.h
FILE: ../../../third_party/dart/runtime/bin/security_context.cc
FILE: ../../../third_party/dart/runtime/bin/security_context.h
FILE: ../../../third_party/dart/runtime/bin/security_context_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/security_context_linux.cc
FILE: ../../../third_party/dart/runtime/bin/security_context_macos.cc
FILE: ../../../third_party/dart/runtime/bin/security_context_win.cc
FILE: ../../../third_party/dart/runtime/bin/snapshot_utils.cc
FILE: ../../../third_party/dart/runtime/bin/snapshot_utils.h
FILE: ../../../third_party/dart/runtime/bin/socket_base.cc
FILE: ../../../third_party/dart/runtime/bin/socket_base.h
FILE: ../../../third_party/dart/runtime/bin/sync_socket.cc
FILE: ../../../third_party/dart/runtime/bin/sync_socket.h
FILE: ../../../third_party/dart/runtime/bin/sync_socket_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/sync_socket_linux.cc
FILE: ../../../third_party/dart/runtime/bin/sync_socket_macos.cc
FILE: ../../../third_party/dart/runtime/bin/sync_socket_win.cc
FILE: ../../../third_party/dart/runtime/lib/async.cc
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/search_bar.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/reload.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/singletargetcache_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/singletargetcache_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/subtypetestcache_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/subtypetestcache_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unlinkedcall_ref.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unlinkedcall_view.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/service.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/single_target_cache.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/subtype_test_cache.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/timeline.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/unlinked_call.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/single_target_cache.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/subtype_test_cache.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/timeline.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/unlinked_call.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/vm.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/single_target_cache.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/subtype_test_cache.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/timeline.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/unlinked_call.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/vm.dart
FILE: ../../../third_party/dart/runtime/platform/allocation.h
FILE: ../../../third_party/dart/runtime/platform/growable_array.h
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_riscv.h
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers_arm.h
FILE: ../../../third_party/dart/runtime/vm/compiler/call_specializer.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/call_specializer.h
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/prologue_builder.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/prologue_builder.h
FILE: ../../../third_party/dart/runtime/vm/compiler/jit/jit_call_specializer.h
FILE: ../../../third_party/dart/runtime/vm/constants_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/constants_riscv.h
FILE: ../../../third_party/dart/runtime/vm/constants_x86.h
FILE: ../../../third_party/dart/runtime/vm/dwarf.cc
FILE: ../../../third_party/dart/runtime/vm/dwarf.h
FILE: ../../../third_party/dart/runtime/vm/fixed_cache.h
FILE: ../../../third_party/dart/runtime/vm/gdb_helpers.cc
FILE: ../../../third_party/dart/runtime/vm/heap/compactor.cc
FILE: ../../../third_party/dart/runtime/vm/heap/compactor.h
FILE: ../../../third_party/dart/runtime/vm/image_snapshot.cc
FILE: ../../../third_party/dart/runtime/vm/image_snapshot.h
FILE: ../../../third_party/dart/runtime/vm/json_writer.cc
FILE: ../../../third_party/dart/runtime/vm/json_writer.h
FILE: ../../../third_party/dart/runtime/vm/kernel_binary.h
FILE: ../../../third_party/dart/runtime/vm/simulator_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/simulator_riscv.h
FILE: ../../../third_party/dart/runtime/vm/stack_trace.cc
FILE: ../../../third_party/dart/runtime/vm/stack_trace.h
FILE: ../../../third_party/dart/runtime/vm/timeline_android.cc
FILE: ../../../third_party/dart/runtime/vm/timeline_fuchsia.cc
FILE: ../../../third_party/dart/runtime/vm/timeline_linux.cc
FILE: ../../../third_party/dart/runtime/vm/zone_text_buffer.cc
FILE: ../../../third_party/dart/runtime/vm/zone_text_buffer.h
FILE: ../../../third_party/dart/sdk/lib/_http/overrides.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/identity_hash_map.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/profile.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/namespace_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/bin/sync_socket_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/class_id_fasta.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm_shared/lib/bigint_patch.dart
FILE: ../../../third_party/dart/sdk/lib/cli/cli.dart
FILE: ../../../third_party/dart/sdk/lib/core/bigint.dart
FILE: ../../../third_party/dart/sdk/lib/internal/linked_list.dart
FILE: ../../../third_party/dart/sdk/lib/internal/patch.dart
FILE: ../../../third_party/dart/sdk/lib/io/embedder_config.dart
FILE: ../../../third_party/dart/sdk/lib/io/namespace_impl.dart
FILE: ../../../third_party/dart/sdk/lib/io/overrides.dart
FILE: ../../../third_party/dart/sdk/lib/io/sync_socket.dart
FILE: ../../../third_party/dart/sdk/lib/vmservice/named_lookup.dart
FILE: ../../../third_party/dart/utils/bazel/kernel_worker.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/crashpad.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/dart_embedder_api_impl.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/typed_data_utils.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/typed_data_utils.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/include/dart_embedder_api.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/dartfuzz/dartfuzz.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/base64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/base64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/compile_type.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/loops.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/loops.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/slot.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/slot.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/compiler_state.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/compiler_state.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/base_flow_graph_builder.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/base_flow_graph_builder.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_reader.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_reader.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/relocation.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/datastream.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/finalizable_data.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/hash.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/raw_object_fields.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/raw_object_fields.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/reverse_pc_lookup_cache.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/reverse_pc_lookup_cache.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/type_testing_stubs.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/v8_snapshot_writer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/v8_snapshot_writer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/instantiation.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/js/_js.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/js/_js_client.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/js/_js_server.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/crashpad.h
FILE: ../../../third_party/dart/runtime/bin/dart_embedder_api_impl.cc
FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.cc
FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.h
FILE: ../../../third_party/dart/runtime/include/dart_embedder_api.h
FILE: ../../../third_party/dart/runtime/tools/dartfuzz/dartfuzz.dart
FILE: ../../../third_party/dart/runtime/vm/base64.cc
FILE: ../../../third_party/dart/runtime/vm/base64.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/compile_type.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/loops.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/loops.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/slot.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/slot.h
FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h
FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_state.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_state.h
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/base_flow_graph_builder.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/base_flow_graph_builder.h
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_reader.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_reader.h
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.h
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.h
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.h
FILE: ../../../third_party/dart/runtime/vm/compiler/relocation.h
FILE: ../../../third_party/dart/runtime/vm/constants.h
FILE: ../../../third_party/dart/runtime/vm/datastream.cc
FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h
FILE: ../../../third_party/dart/runtime/vm/hash.h
FILE: ../../../third_party/dart/runtime/vm/raw_object_fields.cc
FILE: ../../../third_party/dart/runtime/vm/raw_object_fields.h
FILE: ../../../third_party/dart/runtime/vm/reverse_pc_lookup_cache.cc
FILE: ../../../third_party/dart/runtime/vm/reverse_pc_lookup_cache.h
FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc
FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h
FILE: ../../../third_party/dart/runtime/vm/v8_snapshot_writer.cc
FILE: ../../../third_party/dart/runtime/vm/v8_snapshot_writer.h
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/instantiation.dart
FILE: ../../../third_party/dart/sdk/lib/js/_js.dart
FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart
FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart
FILE: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/console.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/console_posix.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/console_win.cc + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/console.h
FILE: ../../../third_party/dart/runtime/bin/console_posix.cc
FILE: ../../../third_party/dart/runtime/bin/console_win.cc
----------------------------------------------------------------------------------------------------
Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/elf_loader.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/elf_loader.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/namespace_fuchsia.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/ffi.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/ffi_dynamic_library.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/tree_map.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/isolate_group.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/isolate_group.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/isolate_group.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/repositories/timeline_base.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/elf.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/thread_sanitizer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/dartfuzz/dartfuzz_api_table.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/dartfuzz/dartfuzz_ffi_api.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/dartfuzz/dartfuzz_type_table.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/dartfuzz/gen_api_table.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/dartfuzz/gen_type_table.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/dartfuzz/gen_util.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/ffi/sdk_lib_ffi_generator.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/graphexplorer/graphexplorer.html + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/graphexplorer/graphexplorer.js + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/run_clang_tidy.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bss_relocs.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/bss_relocs.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/class_id.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_comments.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_comments.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_entry_kind.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/block_builder.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/evaluator.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/evaluator.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_checker.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_checker.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_test_helper.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_test_helper.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/graph_intrinsifier.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/graph_intrinsifier.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/offsets_extractor.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/recognized_methods_list.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/relocation.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/runtime_api.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/runtime_api.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/runtime_offsets_extracted.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/runtime_offsets_list.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_arm.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_arm64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_ia32.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/elf.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/elf.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/frame_layout.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/intrusive_dlist.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/libfuzzer/dart_libfuzzer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/longjump.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/pointer_tagging.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/splay-tree.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/static_type_exactness_state.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stub_code_list.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_stack_resource.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_stack_resource.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_state.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_state.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/rti.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/synced/recipe_syntax.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_dynamic_library_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_native_type_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/annotations.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/dynamic_library.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/ffi.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/native_type.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/struct.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/errors.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/elf_loader.cc
FILE: ../../../third_party/dart/runtime/bin/elf_loader.h
FILE: ../../../third_party/dart/runtime/bin/namespace_fuchsia.h
FILE: ../../../third_party/dart/runtime/lib/ffi.cc
FILE: ../../../third_party/dart/runtime/lib/ffi_dynamic_library.cc
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/tree_map.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/isolate_group.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/isolate_group.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/isolate_group.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/timeline_base.dart
FILE: ../../../third_party/dart/runtime/platform/elf.h
FILE: ../../../third_party/dart/runtime/platform/thread_sanitizer.h
FILE: ../../../third_party/dart/runtime/tools/dartfuzz/dartfuzz_api_table.dart
FILE: ../../../third_party/dart/runtime/tools/dartfuzz/dartfuzz_ffi_api.dart
FILE: ../../../third_party/dart/runtime/tools/dartfuzz/dartfuzz_type_table.dart
FILE: ../../../third_party/dart/runtime/tools/dartfuzz/gen_api_table.dart
FILE: ../../../third_party/dart/runtime/tools/dartfuzz/gen_type_table.dart
FILE: ../../../third_party/dart/runtime/tools/dartfuzz/gen_util.dart
FILE: ../../../third_party/dart/runtime/tools/ffi/sdk_lib_ffi_generator.dart
FILE: ../../../third_party/dart/runtime/tools/graphexplorer/graphexplorer.html
FILE: ../../../third_party/dart/runtime/tools/graphexplorer/graphexplorer.js
FILE: ../../../third_party/dart/runtime/tools/run_clang_tidy.dart
FILE: ../../../third_party/dart/runtime/vm/bss_relocs.cc
FILE: ../../../third_party/dart/runtime/vm/bss_relocs.h
FILE: ../../../third_party/dart/runtime/vm/class_id.h
FILE: ../../../third_party/dart/runtime/vm/code_comments.cc
FILE: ../../../third_party/dart/runtime/vm/code_comments.h
FILE: ../../../third_party/dart/runtime/vm/code_entry_kind.h
FILE: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier.h
FILE: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_arm.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_x64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_builder.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/evaluator.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/evaluator.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_checker.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_checker.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_test_helper.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_test_helper.h
FILE: ../../../third_party/dart/runtime/vm/compiler/graph_intrinsifier.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/graph_intrinsifier.h
FILE: ../../../third_party/dart/runtime/vm/compiler/offsets_extractor.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/recognized_methods_list.h
FILE: ../../../third_party/dart/runtime/vm/compiler/relocation.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/runtime_api.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/runtime_api.h
FILE: ../../../third_party/dart/runtime/vm/compiler/runtime_offsets_extracted.h
FILE: ../../../third_party/dart/runtime/vm/compiler/runtime_offsets_list.h
FILE: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler.h
FILE: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler_arm.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler_x64.cc
FILE: ../../../third_party/dart/runtime/vm/constants_arm.cc
FILE: ../../../third_party/dart/runtime/vm/constants_arm64.cc
FILE: ../../../third_party/dart/runtime/vm/constants_ia32.cc
FILE: ../../../third_party/dart/runtime/vm/constants_x64.cc
FILE: ../../../third_party/dart/runtime/vm/elf.cc
FILE: ../../../third_party/dart/runtime/vm/elf.h
FILE: ../../../third_party/dart/runtime/vm/frame_layout.h
FILE: ../../../third_party/dart/runtime/vm/intrusive_dlist.h
FILE: ../../../third_party/dart/runtime/vm/libfuzzer/dart_libfuzzer.cc
FILE: ../../../third_party/dart/runtime/vm/longjump.h
FILE: ../../../third_party/dart/runtime/vm/pointer_tagging.h
FILE: ../../../third_party/dart/runtime/vm/splay-tree.h
FILE: ../../../third_party/dart/runtime/vm/static_type_exactness_state.h
FILE: ../../../third_party/dart/runtime/vm/stub_code_list.h
FILE: ../../../third_party/dart/runtime/vm/thread_stack_resource.cc
FILE: ../../../third_party/dart/runtime/vm/thread_stack_resource.h
FILE: ../../../third_party/dart/runtime/vm/thread_state.cc
FILE: ../../../third_party/dart/runtime/vm/thread_state.h
FILE: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/rti.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/synced/recipe_syntax.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_dynamic_library_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_native_type_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_patch.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/annotations.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/dynamic_library.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/ffi.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/native_type.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/struct.dart
FILE: ../../../third_party/dart/sdk/lib/internal/errors.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/sdk/lib/io/network_profiling.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/sdk/lib/io/network_profiling.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/dartdev_isolate.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/dartdev_isolate.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/exe_utils.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/exe_utils.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/ffi_unit_test/run_ffi_unit_tests.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/file_win.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/platform_macos.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/include/dart_api_dl.c + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/include/dart_api_dl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/include/dart_version.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/include/internal/dart_api_dl_impl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/bin/heap_snapshot.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/observatory/lib/src/elements/process_snapshot.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/allocation.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/leak_sanitizer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/priority_queue.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/unaligned.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/undefined_behavior_sanitizer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/canonical_tables.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/closure_functions_cache.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/closure_functions_cache.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/aot/dispatch_table_generator.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/aot/dispatch_table_generator.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler_tracer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler_tracer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/api/deopt_id.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/api/print_filter.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/api/print_filter.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/api/type_check_mode.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_base.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/abi.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/abi.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/callback.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/callback.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/frame_rebase.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/frame_rebase.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/marshaller.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/marshaller.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/native_calling_convention.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/native_calling_convention.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/native_location.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/native_location.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/native_type.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/native_type.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/recognized_method.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/recognized_method.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/unit_test_custom_zone.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/unit_test_custom_zone.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/write_barrier_elimination.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/write_barrier_elimination.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/constants_base.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dispatch_table.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/dispatch_table.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/experimental_features.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/experimental_features.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/field_table.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/field_table.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/port_set.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/tagged_pointer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/timeline_macos.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/visitor.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/embedder_config.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_struct_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/internal/lowering.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/dartdev_isolate.cc
FILE: ../../../third_party/dart/runtime/bin/dartdev_isolate.h
FILE: ../../../third_party/dart/runtime/bin/exe_utils.cc
FILE: ../../../third_party/dart/runtime/bin/exe_utils.h
FILE: ../../../third_party/dart/runtime/bin/ffi_unit_test/run_ffi_unit_tests.cc
FILE: ../../../third_party/dart/runtime/bin/file_win.h
FILE: ../../../third_party/dart/runtime/bin/platform_macos.h
FILE: ../../../third_party/dart/runtime/include/dart_api_dl.c
FILE: ../../../third_party/dart/runtime/include/dart_api_dl.h
FILE: ../../../third_party/dart/runtime/include/dart_version.h
FILE: ../../../third_party/dart/runtime/include/internal/dart_api_dl_impl.h
FILE: ../../../third_party/dart/runtime/observatory/bin/heap_snapshot.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/process_snapshot.dart
FILE: ../../../third_party/dart/runtime/platform/allocation.cc
FILE: ../../../third_party/dart/runtime/platform/leak_sanitizer.h
FILE: ../../../third_party/dart/runtime/platform/priority_queue.h
FILE: ../../../third_party/dart/runtime/platform/unaligned.h
FILE: ../../../third_party/dart/runtime/platform/undefined_behavior_sanitizer.h
FILE: ../../../third_party/dart/runtime/vm/canonical_tables.cc
FILE: ../../../third_party/dart/runtime/vm/closure_functions_cache.cc
FILE: ../../../third_party/dart/runtime/vm/closure_functions_cache.h
FILE: ../../../third_party/dart/runtime/vm/compiler/aot/dispatch_table_generator.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/aot/dispatch_table_generator.h
FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler_tracer.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler_tracer.h
FILE: ../../../third_party/dart/runtime/vm/compiler/api/deopt_id.h
FILE: ../../../third_party/dart/runtime/vm/compiler/api/print_filter.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/api/print_filter.h
FILE: ../../../third_party/dart/runtime/vm/compiler/api/type_check_mode.h
FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_base.h
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/abi.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/abi.h
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/callback.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/callback.h
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/frame_rebase.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/frame_rebase.h
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/marshaller.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/marshaller.h
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/native_calling_convention.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/native_calling_convention.h
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/native_location.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/native_location.h
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/native_type.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/native_type.h
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/recognized_method.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/recognized_method.h
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/unit_test_custom_zone.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/unit_test_custom_zone.h
FILE: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/write_barrier_elimination.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/write_barrier_elimination.h
FILE: ../../../third_party/dart/runtime/vm/constants_base.h
FILE: ../../../third_party/dart/runtime/vm/dispatch_table.cc
FILE: ../../../third_party/dart/runtime/vm/dispatch_table.h
FILE: ../../../third_party/dart/runtime/vm/experimental_features.cc
FILE: ../../../third_party/dart/runtime/vm/experimental_features.h
FILE: ../../../third_party/dart/runtime/vm/field_table.cc
FILE: ../../../third_party/dart/runtime/vm/field_table.h
FILE: ../../../third_party/dart/runtime/vm/port_set.h
FILE: ../../../third_party/dart/runtime/vm/tagged_pointer.h
FILE: ../../../third_party/dart/runtime/vm/timeline_macos.cc
FILE: ../../../third_party/dart/runtime/vm/visitor.cc
FILE: ../../../third_party/dart/sdk/lib/_http/embedder_config.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_struct_patch.dart
FILE: ../../../third_party/dart/sdk/lib/internal/lowering.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/analyze_snapshot.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/platform_macos_cocoa.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/platform_macos_cocoa.mm + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/socket_base_posix.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/utils.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/virtual_memory.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/virtual_memory_fuchsia.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/virtual_memory_posix.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/virtual_memory_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/include/analyze_snapshot_api.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/analyze_snapshot_api_impl.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/code_patcher_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/compiler_timings.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/compiler_timings.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/ffi/range.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/cpu_riscv.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/debugger_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions_riscv.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/message_snapshot.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/message_snapshot.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_graph_copy.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/object_graph_copy.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/pending_deopts.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/pending_deopts.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/runtime_entry_riscv.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/stack_frame_riscv.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/thread_interrupter_android_arm.S + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/virtual_memory_compressed.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/virtual_memory_compressed.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/dart2js_runtime_metrics.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/late_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_allocation_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/enum.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/abi.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/abi_specific.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/allocation.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/union.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/analyze_snapshot.cc
FILE: ../../../third_party/dart/runtime/bin/platform_macos_cocoa.h
FILE: ../../../third_party/dart/runtime/bin/platform_macos_cocoa.mm
FILE: ../../../third_party/dart/runtime/bin/socket_base_posix.cc
FILE: ../../../third_party/dart/runtime/bin/utils.cc
FILE: ../../../third_party/dart/runtime/bin/virtual_memory.h
FILE: ../../../third_party/dart/runtime/bin/virtual_memory_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/virtual_memory_posix.cc
FILE: ../../../third_party/dart/runtime/bin/virtual_memory_win.cc
FILE: ../../../third_party/dart/runtime/include/analyze_snapshot_api.h
FILE: ../../../third_party/dart/runtime/vm/analyze_snapshot_api_impl.cc
FILE: ../../../third_party/dart/runtime/vm/code_patcher_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_timings.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_timings.h
FILE: ../../../third_party/dart/runtime/vm/compiler/ffi/range.h
FILE: ../../../third_party/dart/runtime/vm/compiler/stub_code_compiler_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/cpu_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/cpu_riscv.h
FILE: ../../../third_party/dart/runtime/vm/debugger_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/instructions_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/instructions_riscv.h
FILE: ../../../third_party/dart/runtime/vm/message_snapshot.cc
FILE: ../../../third_party/dart/runtime/vm/message_snapshot.h
FILE: ../../../third_party/dart/runtime/vm/object_graph_copy.cc
FILE: ../../../third_party/dart/runtime/vm/object_graph_copy.h
FILE: ../../../third_party/dart/runtime/vm/pending_deopts.cc
FILE: ../../../third_party/dart/runtime/vm/pending_deopts.h
FILE: ../../../third_party/dart/runtime/vm/runtime_entry_riscv.cc
FILE: ../../../third_party/dart/runtime/vm/stack_frame_riscv.h
FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_android_arm.S
FILE: ../../../third_party/dart/runtime/vm/virtual_memory_compressed.cc
FILE: ../../../third_party/dart/runtime/vm/virtual_memory_compressed.h
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/dart2js_runtime_metrics.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/late_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_allocation_patch.dart
FILE: ../../../third_party/dart/sdk/lib/core/enum.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/abi.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/abi_specific.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/allocation.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/union.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/test_utils.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/test_utils.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread_absl.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/thread_absl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/integers.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/mach_o.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/pe.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/heapsnapshot/bin/download.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/heapsnapshot/bin/explore.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/heapsnapshot/lib/src/cli.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/heapsnapshot/lib/src/completion.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/heapsnapshot/lib/src/console.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/heapsnapshot/lib/src/expression.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/tools/heapsnapshot/lib/src/load.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_serializer.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/il_serializer.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/gc_shared.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/gc_shared.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/page.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/page.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/sampler.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/heap/sampler.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/instructions.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_absl.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/os_thread_absl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/simulator_x64.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/simulator_x64.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_http/http_testing.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_names.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/synced/load_library_priority.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/js_util_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/synced/embedded_names.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_native_finalizer_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/finalizer_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/hash_factories.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/vm/lib/record_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/bool.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/class_id.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/convert_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/core_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/deferred.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/double_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/errors_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/growable_list.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/hash_factories.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/identical_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/internal_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/isolate_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_util_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/list.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/math_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/named_parameters.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/object_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/print_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/regexp_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/regexp_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/simd_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/stack_trace_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/stopwatch_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/string_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/symbol_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/timer_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/type.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/typed_data_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/uri_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/convert_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_wasm/wasm_types.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/core/record.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/c_type.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/ffi/native_finalizer.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/js/js_wasm.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/js_util/js_util_wasm.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/test_utils.cc
FILE: ../../../third_party/dart/runtime/bin/test_utils.h
FILE: ../../../third_party/dart/runtime/bin/thread_absl.cc
FILE: ../../../third_party/dart/runtime/bin/thread_absl.h
FILE: ../../../third_party/dart/runtime/lib/integers.h
FILE: ../../../third_party/dart/runtime/platform/mach_o.h
FILE: ../../../third_party/dart/runtime/platform/pe.h
FILE: ../../../third_party/dart/runtime/tools/heapsnapshot/bin/download.dart
FILE: ../../../third_party/dart/runtime/tools/heapsnapshot/bin/explore.dart
FILE: ../../../third_party/dart/runtime/tools/heapsnapshot/lib/src/cli.dart
FILE: ../../../third_party/dart/runtime/tools/heapsnapshot/lib/src/completion.dart
FILE: ../../../third_party/dart/runtime/tools/heapsnapshot/lib/src/console.dart
FILE: ../../../third_party/dart/runtime/tools/heapsnapshot/lib/src/expression.dart
FILE: ../../../third_party/dart/runtime/tools/heapsnapshot/lib/src/load.dart
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_serializer.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_serializer.h
FILE: ../../../third_party/dart/runtime/vm/heap/gc_shared.cc
FILE: ../../../third_party/dart/runtime/vm/heap/gc_shared.h
FILE: ../../../third_party/dart/runtime/vm/heap/page.cc
FILE: ../../../third_party/dart/runtime/vm/heap/page.h
FILE: ../../../third_party/dart/runtime/vm/heap/sampler.cc
FILE: ../../../third_party/dart/runtime/vm/heap/sampler.h
FILE: ../../../third_party/dart/runtime/vm/instructions.cc
FILE: ../../../third_party/dart/runtime/vm/os_thread_absl.cc
FILE: ../../../third_party/dart/runtime/vm/os_thread_absl.h
FILE: ../../../third_party/dart/runtime/vm/simulator_x64.cc
FILE: ../../../third_party/dart/runtime/vm/simulator_x64.h
FILE: ../../../third_party/dart/sdk/lib/_http/http_testing.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/js_names.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/synced/load_library_priority.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/js_util_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/synced/embedded_names.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/ffi_native_finalizer_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/finalizer_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/hash_factories.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/vm/lib/record_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/bool.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/class_id.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/convert_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/core_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/deferred.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/double_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/errors_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/growable_list.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/hash_factories.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/identical_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/internal_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/isolate_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_util_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/list.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/math_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/named_parameters.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/object_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/print_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/regexp_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/regexp_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/simd_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/stack_trace_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/stopwatch_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/string_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/symbol_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/timer_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/type.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/typed_data_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/uri_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/convert_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_wasm/wasm_types.dart
FILE: ../../../third_party/dart/sdk/lib/core/record.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/c_type.dart
FILE: ../../../third_party/dart/sdk/lib/ffi/native_finalizer.dart
FILE: ../../../third_party/dart/sdk/lib/js/js_wasm.dart
FILE: ../../../third_party/dart/sdk/lib/js_util/js_util_wasm.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/dart_precompiled_runtime_test_component.cml + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/dart_test_component.cml + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/main_impl.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/run_vm_tests_test_component.cml + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/lib/ffi_dynamic_library.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/unwinding_records.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/unwinding_records.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/platform/unwinding_records_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm-jit.shard.cml + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm.shard.cml + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/parallel_move_resolver.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/parallel_move_resolver.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/ffi/native_assets.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/ffi/native_assets.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/ffi_callback_metadata.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/ffi_callback_metadata.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/unwinding_records.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/unwinding_records.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/unwinding_records_win.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/debugger.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/records.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_allow_interop_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/seal_native_object.js + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/records.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/js_interop_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/js_interop_unsafe_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/js_types.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/boxed_double.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/boxed_int.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/boxed_int_to_string.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/closure.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/date_patch_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/error_utils.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/int_common_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/int_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_array.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_interop_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_interop_unsafe_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_string.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_string_convert.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_typed_array.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_types.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/object_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/record_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/simd.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/string.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/string_buffer_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/string_helper.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/sync_star_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/typed_data.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/wasm_types_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/weak_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/boxed_int_to_string.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/int_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/string_buffer_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/string_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/typed_data.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/typed_data_patch.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/async/future_extensions.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/js_interop/js_interop.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/js_interop_unsafe/js_interop_unsafe.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/dart_precompiled_runtime_test_component.cml
FILE: ../../../third_party/dart/runtime/bin/dart_test_component.cml
FILE: ../../../third_party/dart/runtime/bin/main_impl.h
FILE: ../../../third_party/dart/runtime/bin/run_vm_tests_test_component.cml
FILE: ../../../third_party/dart/runtime/lib/ffi_dynamic_library.h
FILE: ../../../third_party/dart/runtime/platform/unwinding_records.cc
FILE: ../../../third_party/dart/runtime/platform/unwinding_records.h
FILE: ../../../third_party/dart/runtime/platform/unwinding_records_win.cc
FILE: ../../../third_party/dart/runtime/vm-jit.shard.cml
FILE: ../../../third_party/dart/runtime/vm.shard.cml
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/parallel_move_resolver.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/parallel_move_resolver.h
FILE: ../../../third_party/dart/runtime/vm/ffi/native_assets.cc
FILE: ../../../third_party/dart/runtime/vm/ffi/native_assets.h
FILE: ../../../third_party/dart/runtime/vm/ffi_callback_metadata.cc
FILE: ../../../third_party/dart/runtime/vm/ffi_callback_metadata.h
FILE: ../../../third_party/dart/runtime/vm/unwinding_records.cc
FILE: ../../../third_party/dart/runtime/vm/unwinding_records.h
FILE: ../../../third_party/dart/runtime/vm/unwinding_records_win.cc
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/debugger.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/records.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_allow_interop_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/seal_native_object.js
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/records.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/js_interop_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/js_interop_unsafe_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_shared/lib/js_types.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/boxed_double.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/boxed_int.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/boxed_int_to_string.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/closure.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/date_patch_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/error_utils.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/int_common_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/int_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_array.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_interop_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_interop_unsafe_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_string.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_string_convert.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_typed_array.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_types.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/object_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/record_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/simd.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/string.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/string_buffer_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/string_helper.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/sync_star_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/typed_data.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/wasm_types_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/weak_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/boxed_int_to_string.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/int_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/string_buffer_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/string_patch.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/typed_data.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm_js_compatibility/lib/typed_data_patch.dart
FILE: ../../../third_party/dart/sdk/lib/async/future_extensions.dart
FILE: ../../../third_party/dart/sdk/lib/js_interop/js_interop.dart
FILE: ../../../third_party/dart/sdk/lib/js_interop_unsafe/js_interop_unsafe.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/vm/perfetto_utils.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/common/builtin_clock.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/clock_snapshot.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/interned_data/interned_data.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/profiling/profile_common.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/profiling/profile_packet.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/trace.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/trace_packet.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/debug_annotation.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/process_descriptor.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/thread_descriptor.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/track_descriptor.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/track_event.pbzero.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/protos/tools/compile_perfetto_protos.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/vm/perfetto_utils.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/common/builtin_clock.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/clock_snapshot.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/interned_data/interned_data.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/profiling/profile_common.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/profiling/profile_packet.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/trace.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/trace_packet.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/debug_annotation.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/process_descriptor.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/thread_descriptor.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/track_descriptor.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/perfetto/trace/track_event/track_event.pbzero.h
FILE: ../../../third_party/dart/runtime/vm/protos/tools/compile_perfetto_protos.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/ifaddrs.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/bin/ifaddrs.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/dart_calling_conventions.cc + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/dart_calling_conventions.h + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_only.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/dart2js_only.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/synced/invocation_mirror_constants.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/compact_hash.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/bin/ifaddrs.cc
FILE: ../../../third_party/dart/runtime/bin/ifaddrs.h
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/dart_calling_conventions.cc
FILE: ../../../third_party/dart/runtime/vm/compiler/backend/dart_calling_conventions.h
FILE: ../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_only.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/dart2js_only.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/synced/invocation_mirror_constants.dart
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/compact_hash.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/sdk/lib/_macros/builders.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_macros/code.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_macros/diagnostic.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_macros/exceptions.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_macros/introspection.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_macros/macro.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/_macros/macros.dart + ../../../third_party/dart/LICENSE
ORIGIN: ../../../third_party/dart/sdk/lib/developer/http_profiling.dart + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/sdk/lib/_macros/builders.dart
FILE: ../../../third_party/dart/sdk/lib/_macros/code.dart
FILE: ../../../third_party/dart/sdk/lib/_macros/diagnostic.dart
FILE: ../../../third_party/dart/sdk/lib/_macros/exceptions.dart
FILE: ../../../third_party/dart/sdk/lib/_macros/introspection.dart
FILE: ../../../third_party/dart/sdk/lib/_macros/macro.dart
FILE: ../../../third_party/dart/sdk/lib/_macros/macros.dart
FILE: ../../../third_party/dart/sdk/lib/developer/http_profiling.dart
----------------------------------------------------------------------------------------------------
Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: double-conversion
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/cached-powers.cc
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/third_party/double-conversion/src/cached-powers.cc
----------------------------------------------------------------------------------------------------
Copyright 2006-2008 the V8 project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: double-conversion
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/bignum-dtoa.cc
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/bignum-dtoa.h
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/bignum.cc
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/bignum.h
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/cached-powers.h
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/diy-fp.h
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/double-to-string.cc
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/fast-dtoa.h
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/fixed-dtoa.cc
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/fixed-dtoa.h
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/string-to-double.cc
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/strtod.cc
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/strtod.h
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/utils.h
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/third_party/double-conversion/src/bignum-dtoa.cc
FILE: ../../../third_party/dart/third_party/double-conversion/src/bignum-dtoa.h
FILE: ../../../third_party/dart/third_party/double-conversion/src/bignum.cc
FILE: ../../../third_party/dart/third_party/double-conversion/src/bignum.h
FILE: ../../../third_party/dart/third_party/double-conversion/src/cached-powers.h
FILE: ../../../third_party/dart/third_party/double-conversion/src/diy-fp.h
FILE: ../../../third_party/dart/third_party/double-conversion/src/double-to-string.cc
FILE: ../../../third_party/dart/third_party/double-conversion/src/fast-dtoa.h
FILE: ../../../third_party/dart/third_party/double-conversion/src/fixed-dtoa.cc
FILE: ../../../third_party/dart/third_party/double-conversion/src/fixed-dtoa.h
FILE: ../../../third_party/dart/third_party/double-conversion/src/string-to-double.cc
FILE: ../../../third_party/dart/third_party/double-conversion/src/strtod.cc
FILE: ../../../third_party/dart/third_party/double-conversion/src/strtod.h
FILE: ../../../third_party/dart/third_party/double-conversion/src/utils.h
----------------------------------------------------------------------------------------------------
Copyright 2010 the V8 project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: double-conversion
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/double-conversion.h
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/double-to-string.h
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/fast-dtoa.cc
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/ieee.h
ORIGIN: ../../../third_party/dart/third_party/double-conversion/src/string-to-double.h
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/third_party/double-conversion/src/double-conversion.h
FILE: ../../../third_party/dart/third_party/double-conversion/src/double-to-string.h
FILE: ../../../third_party/dart/third_party/double-conversion/src/fast-dtoa.cc
FILE: ../../../third_party/dart/third_party/double-conversion/src/ieee.h
FILE: ../../../third_party/dart/third_party/double-conversion/src/string-to-double.h
----------------------------------------------------------------------------------------------------
Copyright 2012 the V8 project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: dart
ORIGIN: ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/isolate_icon.png
FILE: ../../../third_party/dart/runtime/observatory/web/favicon.ico
FILE: ../../../third_party/dart/runtime/observatory/web/index.html
FILE: ../../../third_party/dart/runtime/observatory/web/third_party/trace_viewer_full.html
FILE: ../../../third_party/dart/runtime/observatory/web/timeline.html
FILE: ../../../third_party/dart/runtime/tools/entitlements/dart.plist
FILE: ../../../third_party/dart/runtime/tools/entitlements/dart_precompiled_runtime.plist
FILE: ../../../third_party/dart/runtime/tools/entitlements/dart_precompiled_runtime_product.plist
FILE: ../../../third_party/dart/runtime/tools/entitlements/gen_snapshot.plist
FILE: ../../../third_party/dart/runtime/tools/entitlements/gen_snapshot_product.plist
FILE: ../../../third_party/dart/runtime/tools/entitlements/run_vm_tests.plist
FILE: ../../../third_party/dart/runtime/tools/wiki/styles/style.scss
FILE: ../../../third_party/dart/runtime/tools/wiki/templates/includes/auto-refresh.html
FILE: ../../../third_party/dart/runtime/tools/wiki/templates/page.html
FILE: ../../../third_party/dart/sdk.code-workspace
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/async_patch.dart
FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions_dart2js.dart
FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common.dart
----------------------------------------------------------------------------------------------------
Copyright 2012, the Dart project authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: fallback_root_certificates
ORIGIN: ../../../third_party/dart/third_party/fallback_root_certificates/LICENSE
TYPE: LicenseType.mpl
FILE: ../../../third_party/dart/third_party/fallback_root_certificates/root_certificates.cc
----------------------------------------------------------------------------------------------------
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/7c64e31f4c3eaa0bcfd29ce40459b74cf20a806d
/third_party/fallback_root_certificates/
====================================================================================================
Total license count: 27
| engine/ci/licenses_golden/licenses_dart/0 | {
"file_path": "engine/ci/licenses_golden/licenses_dart",
"repo_id": "engine",
"token_count": 142199
} | 201 |
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//flutter/common/config.gni")
import("//flutter/impeller/tools/impeller.gni")
import("//flutter/testing/testing.gni")
if (is_fuchsia) {
import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni")
}
config("display_list_config") {
defines = []
if (impeller_enable_3d) {
defines += [ "IMPELLER_ENABLE_3D" ]
}
}
source_set("display_list") {
sources = [
"benchmarking/dl_complexity.cc",
"benchmarking/dl_complexity.h",
"benchmarking/dl_complexity_gl.cc",
"benchmarking/dl_complexity_gl.h",
"benchmarking/dl_complexity_metal.cc",
"benchmarking/dl_complexity_metal.h",
"display_list.cc",
"display_list.h",
"dl_attributes.h",
"dl_blend_mode.cc",
"dl_blend_mode.h",
"dl_builder.cc",
"dl_builder.h",
"dl_canvas.cc",
"dl_canvas.h",
"dl_color.h",
"dl_op_flags.cc",
"dl_op_flags.h",
"dl_op_receiver.cc",
"dl_op_receiver.h",
"dl_op_records.cc",
"dl_op_records.h",
"dl_paint.cc",
"dl_paint.h",
"dl_sampling_options.h",
"dl_tile_mode.h",
"dl_vertices.cc",
"dl_vertices.h",
"effects/dl_color_filter.cc",
"effects/dl_color_filter.h",
"effects/dl_color_source.cc",
"effects/dl_color_source.h",
"effects/dl_image_filter.cc",
"effects/dl_image_filter.h",
"effects/dl_mask_filter.cc",
"effects/dl_mask_filter.h",
"effects/dl_path_effect.cc",
"effects/dl_path_effect.h",
"effects/dl_runtime_effect.cc",
"effects/dl_runtime_effect.h",
"geometry/dl_region.cc",
"geometry/dl_region.h",
"geometry/dl_rtree.cc",
"geometry/dl_rtree.h",
"image/dl_image.cc",
"image/dl_image.h",
"image/dl_image_skia.cc",
"image/dl_image_skia.h",
"skia/dl_sk_canvas.cc",
"skia/dl_sk_canvas.h",
"skia/dl_sk_conversions.cc",
"skia/dl_sk_conversions.h",
"skia/dl_sk_dispatcher.cc",
"skia/dl_sk_dispatcher.h",
"skia/dl_sk_paint_dispatcher.cc",
"skia/dl_sk_paint_dispatcher.h",
"skia/dl_sk_types.h",
"utils/dl_bounds_accumulator.cc",
"utils/dl_bounds_accumulator.h",
"utils/dl_matrix_clip_tracker.cc",
"utils/dl_matrix_clip_tracker.h",
"utils/dl_receiver_utils.cc",
"utils/dl_receiver_utils.h",
]
public_configs = [ ":display_list_config" ]
public_deps = [
"//flutter/fml",
"//flutter/impeller/runtime_stage",
"//flutter/impeller/typographer",
"//flutter/skia",
]
if (!defined(defines)) {
defines = []
}
}
test_fixtures("display_list_fixtures") {
fixtures =
[ "//flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf" ]
}
if (enable_unittests) {
executable("display_list_unittests") {
testonly = true
sources = [
"benchmarking/dl_complexity_unittests.cc",
"display_list_unittests.cc",
"dl_color_unittests.cc",
"dl_paint_unittests.cc",
"dl_vertices_unittests.cc",
"effects/dl_color_filter_unittests.cc",
"effects/dl_color_source_unittests.cc",
"effects/dl_image_filter_unittests.cc",
"effects/dl_mask_filter_unittests.cc",
"effects/dl_path_effect_unittests.cc",
"geometry/dl_region_unittests.cc",
"geometry/dl_rtree_unittests.cc",
"skia/dl_sk_conversions_unittests.cc",
"skia/dl_sk_paint_dispatcher_unittests.cc",
"utils/dl_matrix_clip_tracker_unittests.cc",
]
deps = [
":display_list",
":display_list_fixtures",
"//flutter/display_list/testing:display_list_testing",
"//flutter/testing",
"//flutter/testing:skia",
]
if (!defined(defines)) {
defines = []
}
if (is_win) {
# Required for M_PI and others.
defines += [ "_USE_MATH_DEFINES" ]
}
# This is needed for //flutter/third_party/googletest for linking zircon
# symbols.
if (is_fuchsia) {
libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ]
}
}
executable("display_list_rendertests") {
testonly = true
sources = [ "testing/dl_rendering_unittests.cc" ]
deps = [
":display_list",
":display_list_fixtures",
"//flutter/common/graphics",
"//flutter/display_list/testing:display_list_surface_provider",
"//flutter/display_list/testing:display_list_testing",
"//flutter/impeller/typographer/backends/skia:typographer_skia_backend",
"//flutter/testing",
"//flutter/third_party/txt",
]
if (!defined(defines)) {
defines = []
}
if (is_win) {
# Required for M_PI and others.
defines += [ "_USE_MATH_DEFINES" ]
}
# This is needed for //flutter/third_party/googletest for linking zircon
# symbols.
if (is_fuchsia) {
libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ]
}
}
executable("display_list_builder_benchmarks") {
testonly = true
sources = [ "benchmarking/dl_builder_benchmarks.cc" ]
deps = [
":display_list",
":display_list_fixtures",
"//flutter/benchmarking",
"//flutter/display_list/testing:display_list_testing",
"//flutter/testing:testing_lib",
]
}
executable("display_list_region_benchmarks") {
testonly = true
sources = [ "benchmarking/dl_region_benchmarks.cc" ]
deps = [
":display_list_fixtures",
"//flutter/benchmarking",
"//flutter/testing:testing_lib",
]
}
executable("display_list_transform_benchmarks") {
testonly = true
sources = [ "benchmarking/dl_transform_benchmarks.cc" ]
deps = [
":display_list_fixtures",
"//flutter/benchmarking",
"//flutter/testing:testing_lib",
]
}
}
source_set("display_list_benchmarks_source") {
testonly = true
sources = [
"benchmarking/dl_benchmarks.cc",
"benchmarking/dl_benchmarks.h",
]
deps = [
":display_list",
":display_list_fixtures",
"$dart_src/runtime:libdart_jit", # for tracing
"//flutter/benchmarking",
"//flutter/common/graphics",
"//flutter/display_list/testing:display_list_surface_provider",
"//flutter/display_list/testing:display_list_testing",
"//flutter/fml",
"//flutter/skia",
"//flutter/testing:skia",
"//flutter/testing:testing_lib",
]
}
executable("display_list_benchmarks") {
testonly = true
deps = [ ":display_list_benchmarks_source" ]
}
if (is_ios) {
shared_library("ios_display_list_benchmarks") {
testonly = true
visibility = [ ":*" ]
configs -= [
"//build/config/gcc:symbol_visibility_hidden",
"//build/config:symbol_visibility_hidden",
]
configs += [ "//flutter/benchmarking:benchmark_library_config" ]
cflags = [
"-fobjc-arc",
"-mios-simulator-version-min=$ios_testing_deployment_target",
]
ldflags =
[ "-Wl,-install_name,@rpath/libios_display_list_benchmarks.dylib" ]
deps = [
":display_list_benchmarks_source",
"//flutter/benchmarking:benchmarking_library",
]
}
}
| engine/display_list/BUILD.gn/0 | {
"file_path": "engine/display_list/BUILD.gn",
"repo_id": "engine",
"token_count": 3216
} | 202 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
#include "flutter/display_list/display_list.h"
#include "flutter/display_list/dl_blend_mode.h"
#include "flutter/display_list/dl_builder.h"
#include "flutter/display_list/dl_paint.h"
#include "flutter/display_list/geometry/dl_rtree.h"
#include "flutter/display_list/skia/dl_sk_dispatcher.h"
#include "flutter/display_list/testing/dl_test_snippets.h"
#include "flutter/display_list/utils/dl_receiver_utils.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/math.h"
#include "flutter/testing/assertions_skia.h"
#include "flutter/testing/display_list_testing.h"
#include "flutter/testing/testing.h"
#include "third_party/skia/include/core/SkBBHFactory.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "third_party/skia/include/core/SkRSXform.h"
#include "third_party/skia/include/core/SkSurface.h"
namespace flutter {
DlOpReceiver& DisplayListBuilderTestingAccessor(DisplayListBuilder& builder) {
return builder.asReceiver();
}
DlPaint DisplayListBuilderTestingAttributes(DisplayListBuilder& builder) {
return builder.CurrentAttributes();
}
namespace testing {
static std::vector<testing::DisplayListInvocationGroup> allGroups =
CreateAllGroups();
using ClipOp = DlCanvas::ClipOp;
using PointMode = DlCanvas::PointMode;
template <typename BaseT>
class DisplayListTestBase : public BaseT {
public:
DisplayListTestBase() = default;
static DlOpReceiver& ToReceiver(DisplayListBuilder& builder) {
return DisplayListBuilderTestingAccessor(builder);
}
static sk_sp<DisplayList> Build(DisplayListInvocation& invocation) {
DisplayListBuilder builder;
invocation.Invoke(ToReceiver(builder));
return builder.Build();
}
static sk_sp<DisplayList> Build(size_t g_index, size_t v_index) {
DisplayListBuilder builder;
DlOpReceiver& receiver =
DisplayListTestBase<::testing::Test>::ToReceiver(builder);
unsigned int op_count = 0;
size_t byte_count = 0;
for (size_t i = 0; i < allGroups.size(); i++) {
DisplayListInvocationGroup& group = allGroups[i];
size_t j = (i == g_index ? v_index : 0);
if (j >= group.variants.size()) {
continue;
}
DisplayListInvocation& invocation = group.variants[j];
op_count += invocation.op_count();
byte_count += invocation.raw_byte_count();
invocation.invoker(receiver);
}
sk_sp<DisplayList> dl = builder.Build();
std::string name;
if (g_index >= allGroups.size()) {
name = "Default";
} else {
name = allGroups[g_index].op_name;
if (v_index >= allGroups[g_index].variants.size()) {
name += " skipped";
} else {
name += " variant " + std::to_string(v_index + 1);
}
}
EXPECT_EQ(dl->op_count(false), op_count) << name;
EXPECT_EQ(dl->bytes(false), byte_count + sizeof(DisplayList)) << name;
return dl;
}
static void check_defaults(
DisplayListBuilder& builder,
const SkRect& cull_rect = DisplayListBuilder::kMaxCullRect) {
DlPaint builder_paint = DisplayListBuilderTestingAttributes(builder);
DlPaint defaults;
EXPECT_EQ(builder_paint.isAntiAlias(), defaults.isAntiAlias());
EXPECT_EQ(builder_paint.isInvertColors(), defaults.isInvertColors());
EXPECT_EQ(builder_paint.getColor(), defaults.getColor());
EXPECT_EQ(builder_paint.getBlendMode(), defaults.getBlendMode());
EXPECT_EQ(builder_paint.getDrawStyle(), defaults.getDrawStyle());
EXPECT_EQ(builder_paint.getStrokeWidth(), defaults.getStrokeWidth());
EXPECT_EQ(builder_paint.getStrokeMiter(), defaults.getStrokeMiter());
EXPECT_EQ(builder_paint.getStrokeCap(), defaults.getStrokeCap());
EXPECT_EQ(builder_paint.getStrokeJoin(), defaults.getStrokeJoin());
EXPECT_EQ(builder_paint.getColorSource(), defaults.getColorSource());
EXPECT_EQ(builder_paint.getColorFilter(), defaults.getColorFilter());
EXPECT_EQ(builder_paint.getImageFilter(), defaults.getImageFilter());
EXPECT_EQ(builder_paint.getMaskFilter(), defaults.getMaskFilter());
EXPECT_EQ(builder_paint.getPathEffect(), defaults.getPathEffect());
EXPECT_EQ(builder_paint, defaults);
EXPECT_TRUE(builder_paint.isDefault());
EXPECT_EQ(builder.GetTransform(), SkMatrix());
EXPECT_EQ(builder.GetTransformFullPerspective(), SkM44());
EXPECT_EQ(builder.GetLocalClipBounds(), cull_rect);
EXPECT_EQ(builder.GetDestinationClipBounds(), cull_rect);
EXPECT_EQ(builder.GetSaveCount(), 1);
}
typedef const std::function<void(DlCanvas&)> DlSetup;
typedef const std::function<void(DlCanvas&, DlPaint&, SkRect& rect)>
DlRenderer;
static void verify_inverted_bounds(DlSetup& setup,
DlRenderer& renderer,
DlPaint paint,
SkRect render_rect,
SkRect expected_bounds,
const std::string& desc) {
DisplayListBuilder builder;
setup(builder);
renderer(builder, paint, render_rect);
auto dl = builder.Build();
EXPECT_EQ(dl->op_count(), 1u) << desc;
EXPECT_EQ(dl->bounds(), expected_bounds) << desc;
}
static void check_inverted_bounds(DlRenderer& renderer,
const std::string& desc) {
SkRect rect = SkRect::MakeLTRB(0.0f, 0.0f, 10.0f, 10.0f);
SkRect invertedLR = SkRect::MakeLTRB(rect.fRight, rect.fTop, //
rect.fLeft, rect.fBottom);
SkRect invertedTB = SkRect::MakeLTRB(rect.fLeft, rect.fBottom, //
rect.fRight, rect.fTop);
SkRect invertedLTRB = SkRect::MakeLTRB(rect.fRight, rect.fBottom, //
rect.fLeft, rect.fTop);
auto empty_setup = [](DlCanvas&) {};
ASSERT_TRUE(rect.fLeft < rect.fRight);
ASSERT_TRUE(rect.fTop < rect.fBottom);
ASSERT_FALSE(rect.isEmpty());
ASSERT_TRUE(invertedLR.fLeft > invertedLR.fRight);
ASSERT_TRUE(invertedLR.isEmpty());
ASSERT_TRUE(invertedTB.fTop > invertedTB.fBottom);
ASSERT_TRUE(invertedTB.isEmpty());
ASSERT_TRUE(invertedLTRB.fLeft > invertedLTRB.fRight);
ASSERT_TRUE(invertedLTRB.fTop > invertedLTRB.fBottom);
ASSERT_TRUE(invertedLTRB.isEmpty());
DlPaint ref_paint = DlPaint();
SkRect ref_bounds = rect;
verify_inverted_bounds(empty_setup, renderer, ref_paint, invertedLR,
ref_bounds, desc + " LR swapped");
verify_inverted_bounds(empty_setup, renderer, ref_paint, invertedTB,
ref_bounds, desc + " TB swapped");
verify_inverted_bounds(empty_setup, renderer, ref_paint, invertedLTRB,
ref_bounds, desc + " LR&TB swapped");
// Round joins are used because miter joins greatly pad the bounds,
// but only on paths. So we use round joins for consistency there.
// We aren't fully testing all stroke-related bounds computations here,
// those are more fully tested in the render tests. We are simply
// checking that they are applied to the ordered bounds.
DlPaint stroke_paint = DlPaint() //
.setDrawStyle(DlDrawStyle::kStroke) //
.setStrokeJoin(DlStrokeJoin::kRound) //
.setStrokeWidth(2.0f);
SkRect stroke_bounds = rect.makeOutset(1.0f, 1.0f);
verify_inverted_bounds(empty_setup, renderer, stroke_paint, invertedLR,
stroke_bounds, desc + " LR swapped, sw 2");
verify_inverted_bounds(empty_setup, renderer, stroke_paint, invertedTB,
stroke_bounds, desc + " TB swapped, sw 2");
verify_inverted_bounds(empty_setup, renderer, stroke_paint, invertedLTRB,
stroke_bounds, desc + " LR&TB swapped, sw 2");
DlBlurMaskFilter mask_filter(DlBlurStyle::kNormal, 2.0f);
DlPaint maskblur_paint = DlPaint() //
.setMaskFilter(&mask_filter);
SkRect maskblur_bounds = rect.makeOutset(6.0f, 6.0f);
verify_inverted_bounds(empty_setup, renderer, maskblur_paint, invertedLR,
maskblur_bounds, desc + " LR swapped, mask 2");
verify_inverted_bounds(empty_setup, renderer, maskblur_paint, invertedTB,
maskblur_bounds, desc + " TB swapped, mask 2");
verify_inverted_bounds(empty_setup, renderer, maskblur_paint, invertedLTRB,
maskblur_bounds, desc + " LR&TB swapped, mask 2");
DlErodeImageFilter erode_filter(2.0f, 2.0f);
DlPaint erode_paint = DlPaint() //
.setImageFilter(&erode_filter);
SkRect erode_bounds = rect.makeInset(2.0f, 2.0f);
verify_inverted_bounds(empty_setup, renderer, erode_paint, invertedLR,
erode_bounds, desc + " LR swapped, erode 2");
verify_inverted_bounds(empty_setup, renderer, erode_paint, invertedTB,
erode_bounds, desc + " TB swapped, erode 2");
verify_inverted_bounds(empty_setup, renderer, erode_paint, invertedLTRB,
erode_bounds, desc + " LR&TB swapped, erode 2");
}
private:
FML_DISALLOW_COPY_AND_ASSIGN(DisplayListTestBase);
};
using DisplayListTest = DisplayListTestBase<::testing::Test>;
TEST_F(DisplayListTest, Defaults) {
DisplayListBuilder builder;
check_defaults(builder);
}
TEST_F(DisplayListTest, EmptyBuild) {
DisplayListBuilder builder;
auto dl = builder.Build();
EXPECT_EQ(dl->op_count(), 0u);
EXPECT_EQ(dl->bytes(), sizeof(DisplayList));
}
TEST_F(DisplayListTest, EmptyRebuild) {
DisplayListBuilder builder;
auto dl1 = builder.Build();
auto dl2 = builder.Build();
auto dl3 = builder.Build();
ASSERT_TRUE(dl1->Equals(dl2));
ASSERT_TRUE(dl2->Equals(dl3));
}
TEST_F(DisplayListTest, BuilderCanBeReused) {
DisplayListBuilder builder(kTestBounds);
builder.DrawRect(kTestBounds, DlPaint());
auto dl = builder.Build();
builder.DrawRect(kTestBounds, DlPaint());
auto dl2 = builder.Build();
ASSERT_TRUE(dl->Equals(dl2));
}
TEST_F(DisplayListTest, SaveRestoreRestoresTransform) {
SkRect cull_rect = SkRect::MakeLTRB(-10.0f, -10.0f, 500.0f, 500.0f);
DisplayListBuilder builder(cull_rect);
builder.Save();
builder.Translate(10.0f, 10.0f);
builder.Restore();
check_defaults(builder, cull_rect);
builder.Save();
builder.Scale(10.0f, 10.0f);
builder.Restore();
check_defaults(builder, cull_rect);
builder.Save();
builder.Skew(0.1f, 0.1f);
builder.Restore();
check_defaults(builder, cull_rect);
builder.Save();
builder.Rotate(45.0f);
builder.Restore();
check_defaults(builder, cull_rect);
builder.Save();
builder.Transform(SkMatrix::Scale(10.0f, 10.0f));
builder.Restore();
check_defaults(builder, cull_rect);
builder.Save();
builder.Transform2DAffine(1.0f, 0.0f, 12.0f, //
0.0f, 1.0f, 35.0f);
builder.Restore();
check_defaults(builder, cull_rect);
builder.Save();
builder.Transform(SkM44(SkMatrix::Scale(10.0f, 10.0f)));
builder.Restore();
check_defaults(builder, cull_rect);
builder.Save();
builder.TransformFullPerspective(1.0f, 0.0f, 0.0f, 12.0f, //
0.0f, 1.0f, 0.0f, 35.0f, //
0.0f, 0.0f, 1.0f, 5.0f, //
0.0f, 0.0f, 0.0f, 1.0f);
builder.Restore();
check_defaults(builder, cull_rect);
}
TEST_F(DisplayListTest, BuildRestoresTransform) {
SkRect cull_rect = SkRect::MakeLTRB(-10.0f, -10.0f, 500.0f, 500.0f);
DisplayListBuilder builder(cull_rect);
builder.Translate(10.0f, 10.0f);
builder.Build();
check_defaults(builder, cull_rect);
builder.Scale(10.0f, 10.0f);
builder.Build();
check_defaults(builder, cull_rect);
builder.Skew(0.1f, 0.1f);
builder.Build();
check_defaults(builder, cull_rect);
builder.Rotate(45.0f);
builder.Build();
check_defaults(builder, cull_rect);
builder.Transform(SkMatrix::Scale(10.0f, 10.0f));
builder.Build();
check_defaults(builder, cull_rect);
builder.Transform2DAffine(1.0f, 0.0f, 12.0f, //
0.0f, 1.0f, 35.0f);
builder.Build();
check_defaults(builder, cull_rect);
builder.Transform(SkM44(SkMatrix::Scale(10.0f, 10.0f)));
builder.Build();
check_defaults(builder, cull_rect);
builder.TransformFullPerspective(1.0f, 0.0f, 0.0f, 12.0f, //
0.0f, 1.0f, 0.0f, 35.0f, //
0.0f, 0.0f, 1.0f, 5.0f, //
0.0f, 0.0f, 0.0f, 1.0f);
builder.Build();
check_defaults(builder, cull_rect);
}
TEST_F(DisplayListTest, SaveRestoreRestoresClip) {
SkRect cull_rect = SkRect::MakeLTRB(-10.0f, -10.0f, 500.0f, 500.0f);
DisplayListBuilder builder(cull_rect);
builder.Save();
builder.ClipRect({0.0f, 0.0f, 10.0f, 10.0f});
builder.Restore();
check_defaults(builder, cull_rect);
builder.Save();
builder.ClipRRect(SkRRect::MakeRectXY({0.0f, 0.0f, 5.0f, 5.0f}, 2.0f, 2.0f));
builder.Restore();
check_defaults(builder, cull_rect);
builder.Save();
builder.ClipPath(SkPath().addOval({0.0f, 0.0f, 10.0f, 10.0f}));
builder.Restore();
check_defaults(builder, cull_rect);
}
TEST_F(DisplayListTest, BuildRestoresClip) {
SkRect cull_rect = SkRect::MakeLTRB(-10.0f, -10.0f, 500.0f, 500.0f);
DisplayListBuilder builder(cull_rect);
builder.ClipRect({0.0f, 0.0f, 10.0f, 10.0f});
builder.Build();
check_defaults(builder, cull_rect);
builder.ClipRRect(SkRRect::MakeRectXY({0.0f, 0.0f, 5.0f, 5.0f}, 2.0f, 2.0f));
builder.Build();
check_defaults(builder, cull_rect);
builder.ClipPath(SkPath().addOval({0.0f, 0.0f, 10.0f, 10.0f}));
builder.Build();
check_defaults(builder, cull_rect);
}
TEST_F(DisplayListTest, BuildRestoresAttributes) {
SkRect cull_rect = SkRect::MakeLTRB(-10.0f, -10.0f, 500.0f, 500.0f);
DisplayListBuilder builder(cull_rect);
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setAntiAlias(true);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setInvertColors(true);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setColor(DlColor::kRed());
builder.Build();
check_defaults(builder, cull_rect);
receiver.setBlendMode(DlBlendMode::kColorBurn);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setDrawStyle(DlDrawStyle::kStrokeAndFill);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setStrokeWidth(300.0f);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setStrokeMiter(300.0f);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setStrokeCap(DlStrokeCap::kRound);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setStrokeJoin(DlStrokeJoin::kRound);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setColorSource(&kTestSource1);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setColorFilter(&kTestMatrixColorFilter1);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setImageFilter(&kTestBlurImageFilter1);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setMaskFilter(&kTestMaskFilter1);
builder.Build();
check_defaults(builder, cull_rect);
receiver.setPathEffect(kTestPathEffect1.get());
builder.Build();
check_defaults(builder, cull_rect);
}
TEST_F(DisplayListTest, BuilderBoundsTransformComparedToSkia) {
const SkRect frame_rect = SkRect::MakeLTRB(10, 10, 100, 100);
DisplayListBuilder builder(frame_rect);
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(frame_rect);
ASSERT_EQ(builder.GetDestinationClipBounds(),
SkRect::Make(canvas->getDeviceClipBounds()));
ASSERT_EQ(builder.GetLocalClipBounds().makeOutset(1, 1),
canvas->getLocalClipBounds());
ASSERT_EQ(builder.GetTransform(), canvas->getTotalMatrix());
}
TEST_F(DisplayListTest, BuilderInitialClipBounds) {
SkRect cull_rect = SkRect::MakeWH(100, 100);
SkRect clip_bounds = SkRect::MakeWH(100, 100);
DisplayListBuilder builder(cull_rect);
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
}
TEST_F(DisplayListTest, BuilderInitialClipBoundsNaN) {
SkRect cull_rect = SkRect::MakeWH(SK_ScalarNaN, SK_ScalarNaN);
SkRect clip_bounds = SkRect::MakeEmpty();
DisplayListBuilder builder(cull_rect);
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
}
TEST_F(DisplayListTest, BuilderClipBoundsAfterClipRect) {
SkRect cull_rect = SkRect::MakeWH(100, 100);
SkRect clip_rect = SkRect::MakeLTRB(10, 10, 20, 20);
SkRect clip_bounds = SkRect::MakeLTRB(10, 10, 20, 20);
DisplayListBuilder builder(cull_rect);
builder.ClipRect(clip_rect, ClipOp::kIntersect, false);
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
}
TEST_F(DisplayListTest, BuilderClipBoundsAfterClipRRect) {
SkRect cull_rect = SkRect::MakeWH(100, 100);
SkRect clip_rect = SkRect::MakeLTRB(10, 10, 20, 20);
SkRRect clip_rrect = SkRRect::MakeRectXY(clip_rect, 2, 2);
SkRect clip_bounds = SkRect::MakeLTRB(10, 10, 20, 20);
DisplayListBuilder builder(cull_rect);
builder.ClipRRect(clip_rrect, ClipOp::kIntersect, false);
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
}
TEST_F(DisplayListTest, BuilderClipBoundsAfterClipPath) {
SkRect cull_rect = SkRect::MakeWH(100, 100);
SkPath clip_path = SkPath().addRect(10, 10, 15, 15).addRect(15, 15, 20, 20);
SkRect clip_bounds = SkRect::MakeLTRB(10, 10, 20, 20);
DisplayListBuilder builder(cull_rect);
builder.ClipPath(clip_path, ClipOp::kIntersect, false);
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
}
TEST_F(DisplayListTest, BuilderInitialClipBoundsNonZero) {
SkRect cull_rect = SkRect::MakeLTRB(10, 10, 100, 100);
SkRect clip_bounds = SkRect::MakeLTRB(10, 10, 100, 100);
DisplayListBuilder builder(cull_rect);
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
}
TEST_F(DisplayListTest, UnclippedSaveLayerContentAccountsForFilter) {
SkRect cull_rect = SkRect::MakeLTRB(0.0f, 0.0f, 300.0f, 300.0f);
SkRect clip_rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
SkRect draw_rect = SkRect::MakeLTRB(50.0f, 140.0f, 101.0f, 160.0f);
auto filter = DlBlurImageFilter::Make(10.0f, 10.0f, DlTileMode::kDecal);
DlPaint layer_paint = DlPaint().setImageFilter(filter);
ASSERT_TRUE(clip_rect.intersects(draw_rect));
ASSERT_TRUE(cull_rect.contains(clip_rect));
ASSERT_TRUE(cull_rect.contains(draw_rect));
DisplayListBuilder builder;
builder.Save();
{
builder.ClipRect(clip_rect, ClipOp::kIntersect, false);
builder.SaveLayer(&cull_rect, &layer_paint);
{ //
builder.DrawRect(draw_rect, DlPaint());
}
builder.Restore();
}
builder.Restore();
auto display_list = builder.Build();
ASSERT_EQ(display_list->op_count(), 6u);
SkRect result_rect = draw_rect.makeOutset(30.0f, 30.0f);
ASSERT_TRUE(result_rect.intersect(clip_rect));
ASSERT_EQ(result_rect, SkRect::MakeLTRB(100.0f, 110.0f, 131.0f, 190.0f));
ASSERT_EQ(display_list->bounds(), result_rect);
}
TEST_F(DisplayListTest, ClippedSaveLayerContentAccountsForFilter) {
SkRect cull_rect = SkRect::MakeLTRB(0.0f, 0.0f, 300.0f, 300.0f);
SkRect clip_rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
SkRect draw_rect = SkRect::MakeLTRB(50.0f, 140.0f, 99.0f, 160.0f);
auto filter = DlBlurImageFilter::Make(10.0f, 10.0f, DlTileMode::kDecal);
DlPaint layer_paint = DlPaint().setImageFilter(filter);
ASSERT_FALSE(clip_rect.intersects(draw_rect));
ASSERT_TRUE(cull_rect.contains(clip_rect));
ASSERT_TRUE(cull_rect.contains(draw_rect));
DisplayListBuilder builder;
builder.Save();
{
builder.ClipRect(clip_rect, ClipOp::kIntersect, false);
builder.SaveLayer(&cull_rect, &layer_paint);
{ //
builder.DrawRect(draw_rect, DlPaint());
}
builder.Restore();
}
builder.Restore();
auto display_list = builder.Build();
ASSERT_EQ(display_list->op_count(), 6u);
SkRect result_rect = draw_rect.makeOutset(30.0f, 30.0f);
ASSERT_TRUE(result_rect.intersect(clip_rect));
ASSERT_EQ(result_rect, SkRect::MakeLTRB(100.0f, 110.0f, 129.0f, 190.0f));
ASSERT_EQ(display_list->bounds(), result_rect);
}
TEST_F(DisplayListTest, SingleOpSizes) {
for (auto& group : allGroups) {
for (size_t i = 0; i < group.variants.size(); i++) {
auto& invocation = group.variants[i];
sk_sp<DisplayList> dl = Build(invocation);
auto desc = group.op_name + "(variant " + std::to_string(i + 1) + ")";
ASSERT_EQ(dl->op_count(false), invocation.op_count()) << desc;
ASSERT_EQ(dl->bytes(false), invocation.byte_count()) << desc;
}
}
}
TEST_F(DisplayListTest, SingleOpDisplayListsNotEqualEmpty) {
sk_sp<DisplayList> empty = DisplayListBuilder().Build();
for (auto& group : allGroups) {
for (size_t i = 0; i < group.variants.size(); i++) {
sk_sp<DisplayList> dl = Build(group.variants[i]);
auto desc =
group.op_name + "(variant " + std::to_string(i + 1) + " != empty)";
if (group.variants[i].is_empty()) {
ASSERT_TRUE(DisplayListsEQ_Verbose(dl, empty));
ASSERT_TRUE(empty->Equals(*dl)) << desc;
} else {
ASSERT_TRUE(DisplayListsNE_Verbose(dl, empty));
ASSERT_FALSE(empty->Equals(*dl)) << desc;
}
}
}
}
TEST_F(DisplayListTest, SingleOpDisplayListsRecapturedAreEqual) {
for (auto& group : allGroups) {
for (size_t i = 0; i < group.variants.size(); i++) {
sk_sp<DisplayList> dl = Build(group.variants[i]);
// Verify recapturing the replay of the display list is Equals()
// when dispatching directly from the DL to another builder
DisplayListBuilder copy_builder;
DlOpReceiver& r = ToReceiver(copy_builder);
dl->Dispatch(r);
sk_sp<DisplayList> copy = copy_builder.Build();
auto desc =
group.op_name + "(variant " + std::to_string(i + 1) + " == copy)";
ASSERT_EQ(copy->op_count(false), dl->op_count(false)) << desc;
ASSERT_EQ(copy->bytes(false), dl->bytes(false)) << desc;
ASSERT_EQ(copy->op_count(true), dl->op_count(true)) << desc;
ASSERT_EQ(copy->bytes(true), dl->bytes(true)) << desc;
ASSERT_EQ(copy->bounds(), dl->bounds()) << desc;
ASSERT_TRUE(copy->Equals(*dl)) << desc;
ASSERT_TRUE(dl->Equals(*copy)) << desc;
}
}
}
TEST_F(DisplayListTest, SingleOpDisplayListsCompareToEachOther) {
for (auto& group : allGroups) {
std::vector<sk_sp<DisplayList>> lists_a;
std::vector<sk_sp<DisplayList>> lists_b;
for (size_t i = 0; i < group.variants.size(); i++) {
lists_a.push_back(Build(group.variants[i]));
lists_b.push_back(Build(group.variants[i]));
}
for (size_t i = 0; i < lists_a.size(); i++) {
sk_sp<DisplayList> listA = lists_a[i];
for (size_t j = 0; j < lists_b.size(); j++) {
sk_sp<DisplayList> listB = lists_b[j];
auto desc = group.op_name + "(variant " + std::to_string(i + 1) +
" ==? variant " + std::to_string(j + 1) + ")";
if (i == j ||
(group.variants[i].is_empty() && group.variants[j].is_empty())) {
// They are the same variant, or both variants are NOPs
ASSERT_EQ(listA->op_count(false), listB->op_count(false)) << desc;
ASSERT_EQ(listA->bytes(false), listB->bytes(false)) << desc;
ASSERT_EQ(listA->op_count(true), listB->op_count(true)) << desc;
ASSERT_EQ(listA->bytes(true), listB->bytes(true)) << desc;
ASSERT_EQ(listA->bounds(), listB->bounds()) << desc;
ASSERT_TRUE(listA->Equals(*listB)) << desc;
ASSERT_TRUE(listB->Equals(*listA)) << desc;
} else {
// No assertion on op/byte counts or bounds
// they may or may not be equal between variants
ASSERT_FALSE(listA->Equals(*listB)) << desc;
ASSERT_FALSE(listB->Equals(*listA)) << desc;
}
}
}
}
}
TEST_F(DisplayListTest, SingleOpDisplayListsAreEqualWithOrWithoutRtree) {
for (auto& group : allGroups) {
for (size_t i = 0; i < group.variants.size(); i++) {
DisplayListBuilder builder1(/*prepare_rtree=*/false);
DisplayListBuilder builder2(/*prepare_rtree=*/true);
group.variants[i].invoker(ToReceiver(builder1));
group.variants[i].invoker(ToReceiver(builder2));
sk_sp<DisplayList> dl1 = builder1.Build();
sk_sp<DisplayList> dl2 = builder2.Build();
auto desc = group.op_name + "(variant " + std::to_string(i + 1) + " )";
ASSERT_EQ(dl1->op_count(false), dl2->op_count(false)) << desc;
ASSERT_EQ(dl1->bytes(false), dl2->bytes(false)) << desc;
ASSERT_EQ(dl1->op_count(true), dl2->op_count(true)) << desc;
ASSERT_EQ(dl1->bytes(true), dl2->bytes(true)) << desc;
ASSERT_EQ(dl1->bounds(), dl2->bounds()) << desc;
ASSERT_TRUE(DisplayListsEQ_Verbose(dl1, dl2)) << desc;
ASSERT_TRUE(DisplayListsEQ_Verbose(dl2, dl2)) << desc;
ASSERT_EQ(dl1->rtree().get(), nullptr) << desc;
ASSERT_NE(dl2->rtree().get(), nullptr) << desc;
}
}
}
TEST_F(DisplayListTest, FullRotationsAreNop) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.rotate(0);
receiver.rotate(360);
receiver.rotate(720);
receiver.rotate(1080);
receiver.rotate(1440);
sk_sp<DisplayList> dl = builder.Build();
ASSERT_EQ(dl->bytes(false), sizeof(DisplayList));
ASSERT_EQ(dl->bytes(true), sizeof(DisplayList));
ASSERT_EQ(dl->op_count(false), 0u);
ASSERT_EQ(dl->op_count(true), 0u);
}
TEST_F(DisplayListTest, AllBlendModeNops) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setBlendMode(DlBlendMode::kSrcOver);
sk_sp<DisplayList> dl = builder.Build();
ASSERT_EQ(dl->bytes(false), sizeof(DisplayList));
ASSERT_EQ(dl->bytes(true), sizeof(DisplayList));
ASSERT_EQ(dl->op_count(false), 0u);
ASSERT_EQ(dl->op_count(true), 0u);
}
TEST_F(DisplayListTest, DisplayListsWithVaryingOpComparisons) {
sk_sp<DisplayList> default_dl = Build(allGroups.size(), 0);
ASSERT_TRUE(default_dl->Equals(*default_dl)) << "Default == itself";
for (size_t gi = 0; gi < allGroups.size(); gi++) {
DisplayListInvocationGroup& group = allGroups[gi];
sk_sp<DisplayList> missing_dl = Build(gi, group.variants.size());
auto desc = "[Group " + group.op_name + " omitted]";
ASSERT_TRUE(missing_dl->Equals(*missing_dl)) << desc << " == itself";
ASSERT_FALSE(missing_dl->Equals(*default_dl)) << desc << " != Default";
ASSERT_FALSE(default_dl->Equals(*missing_dl)) << "Default != " << desc;
for (size_t vi = 0; vi < group.variants.size(); vi++) {
auto desc = "[Group " + group.op_name + " variant " +
std::to_string(vi + 1) + "]";
sk_sp<DisplayList> variant_dl = Build(gi, vi);
ASSERT_TRUE(variant_dl->Equals(*variant_dl)) << desc << " == itself";
if (vi == 0) {
ASSERT_TRUE(variant_dl->Equals(*default_dl)) << desc << " == Default";
ASSERT_TRUE(default_dl->Equals(*variant_dl)) << "Default == " << desc;
} else {
ASSERT_FALSE(variant_dl->Equals(*default_dl)) << desc << " != Default";
ASSERT_FALSE(default_dl->Equals(*variant_dl)) << "Default != " << desc;
}
if (group.variants[vi].is_empty()) {
ASSERT_TRUE(variant_dl->Equals(*missing_dl)) << desc << " != omitted";
ASSERT_TRUE(missing_dl->Equals(*variant_dl)) << "omitted != " << desc;
} else {
ASSERT_FALSE(variant_dl->Equals(*missing_dl)) << desc << " != omitted";
ASSERT_FALSE(missing_dl->Equals(*variant_dl)) << "omitted != " << desc;
}
}
}
}
TEST_F(DisplayListTest, DisplayListSaveLayerBoundsWithAlphaFilter) {
SkRect build_bounds = SkRect::MakeLTRB(-100, -100, 200, 200);
SkRect save_bounds = SkRect::MakeWH(100, 100);
SkRect rect = SkRect::MakeLTRB(30, 30, 70, 70);
// clang-format off
const float color_matrix[] = {
0, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0,
};
// clang-format on
DlMatrixColorFilter base_color_filter(color_matrix);
// clang-format off
const float alpha_matrix[] = {
0, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 0, 1,
};
// clang-format on
DlMatrixColorFilter alpha_color_filter(alpha_matrix);
sk_sp<SkColorFilter> sk_alpha_color_filter =
SkColorFilters::Matrix(alpha_matrix);
{
// No tricky stuff, just verifying drawing a rect produces rect bounds
DisplayListBuilder builder(build_bounds);
DlOpReceiver& receiver = ToReceiver(builder);
receiver.saveLayer(&save_bounds, SaveLayerOptions::kWithAttributes);
receiver.drawRect(rect);
receiver.restore();
sk_sp<DisplayList> display_list = builder.Build();
ASSERT_EQ(display_list->bounds(), rect);
}
{
// Now checking that a normal color filter still produces rect bounds
DisplayListBuilder builder(build_bounds);
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColorFilter(&base_color_filter);
receiver.saveLayer(&save_bounds, SaveLayerOptions::kWithAttributes);
receiver.setColorFilter(nullptr);
receiver.drawRect(rect);
receiver.restore();
sk_sp<DisplayList> display_list = builder.Build();
ASSERT_EQ(display_list->bounds(), rect);
}
{
// Now checking how SkPictureRecorder deals with a color filter
// that modifies alpha channels (save layer bounds are meaningless
// under those circumstances)
SkPictureRecorder recorder;
SkRTreeFactory rtree_factory;
SkCanvas* canvas = recorder.beginRecording(build_bounds, &rtree_factory);
SkPaint p1;
p1.setColorFilter(sk_alpha_color_filter);
canvas->saveLayer(save_bounds, &p1);
SkPaint p2;
canvas->drawRect(rect, p2);
canvas->restore();
sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
ASSERT_EQ(picture->cullRect(), build_bounds);
}
{
// Now checking that DisplayList has the same behavior that we
// saw in the SkPictureRecorder example above - returning the
// cull rect of the DisplayListBuilder when it encounters a
// save layer that modifies an unbounded region
DisplayListBuilder builder(build_bounds);
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColorFilter(&alpha_color_filter);
receiver.saveLayer(&save_bounds, SaveLayerOptions::kWithAttributes);
receiver.setColorFilter(nullptr);
receiver.drawRect(rect);
receiver.restore();
sk_sp<DisplayList> display_list = builder.Build();
ASSERT_EQ(display_list->bounds(), build_bounds);
}
{
// Verifying that the save layer bounds are not relevant
// to the behavior in the previous example
DisplayListBuilder builder(build_bounds);
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColorFilter(&alpha_color_filter);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.setColorFilter(nullptr);
receiver.drawRect(rect);
receiver.restore();
sk_sp<DisplayList> display_list = builder.Build();
ASSERT_EQ(display_list->bounds(), build_bounds);
}
{
// Making sure hiding a ColorFilter as an ImageFilter will
// generate the same behavior as setting it as a ColorFilter
DisplayListBuilder builder(build_bounds);
DlOpReceiver& receiver = ToReceiver(builder);
DlColorFilterImageFilter color_filter_image_filter(base_color_filter);
receiver.setImageFilter(&color_filter_image_filter);
receiver.saveLayer(&save_bounds, SaveLayerOptions::kWithAttributes);
receiver.setImageFilter(nullptr);
receiver.drawRect(rect);
receiver.restore();
sk_sp<DisplayList> display_list = builder.Build();
ASSERT_EQ(display_list->bounds(), rect);
}
{
// Making sure hiding a problematic ColorFilter as an ImageFilter
// will generate the same behavior as setting it as a ColorFilter
DisplayListBuilder builder(build_bounds);
DlOpReceiver& receiver = ToReceiver(builder);
DlColorFilterImageFilter color_filter_image_filter(alpha_color_filter);
receiver.setImageFilter(&color_filter_image_filter);
receiver.saveLayer(&save_bounds, SaveLayerOptions::kWithAttributes);
receiver.setImageFilter(nullptr);
receiver.drawRect(rect);
receiver.restore();
sk_sp<DisplayList> display_list = builder.Build();
ASSERT_EQ(display_list->bounds(), build_bounds);
}
{
// Same as above (ImageFilter hiding ColorFilter) with no save bounds
DisplayListBuilder builder(build_bounds);
DlOpReceiver& receiver = ToReceiver(builder);
DlColorFilterImageFilter color_filter_image_filter(alpha_color_filter);
receiver.setImageFilter(&color_filter_image_filter);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.setImageFilter(nullptr);
receiver.drawRect(rect);
receiver.restore();
sk_sp<DisplayList> display_list = builder.Build();
ASSERT_EQ(display_list->bounds(), build_bounds);
}
{
// Testing behavior with an unboundable blend mode
DisplayListBuilder builder(build_bounds);
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setBlendMode(DlBlendMode::kClear);
receiver.saveLayer(&save_bounds, SaveLayerOptions::kWithAttributes);
receiver.setBlendMode(DlBlendMode::kSrcOver);
receiver.drawRect(rect);
receiver.restore();
sk_sp<DisplayList> display_list = builder.Build();
ASSERT_EQ(display_list->bounds(), build_bounds);
}
{
// Same as previous with no save bounds
DisplayListBuilder builder(build_bounds);
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setBlendMode(DlBlendMode::kClear);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.setBlendMode(DlBlendMode::kSrcOver);
receiver.drawRect(rect);
receiver.restore();
sk_sp<DisplayList> display_list = builder.Build();
ASSERT_EQ(display_list->bounds(), build_bounds);
}
}
TEST_F(DisplayListTest, NestedOpCountMetricsSameAsSkPicture) {
SkPictureRecorder recorder;
recorder.beginRecording(SkRect::MakeWH(150, 100));
SkCanvas* canvas = recorder.getRecordingCanvas();
SkPaint paint;
for (int y = 10; y <= 60; y += 10) {
for (int x = 10; x <= 60; x += 10) {
paint.setColor(((x + y) % 20) == 10 ? SK_ColorRED : SK_ColorBLUE);
canvas->drawRect(SkRect::MakeXYWH(x, y, 80, 80), paint);
}
}
SkPictureRecorder outer_recorder;
outer_recorder.beginRecording(SkRect::MakeWH(150, 100));
canvas = outer_recorder.getRecordingCanvas();
canvas->drawPicture(recorder.finishRecordingAsPicture());
auto picture = outer_recorder.finishRecordingAsPicture();
ASSERT_EQ(picture->approximateOpCount(), 1);
ASSERT_EQ(picture->approximateOpCount(true), 36);
DisplayListBuilder builder(SkRect::MakeWH(150, 100));
DlOpReceiver& receiver = ToReceiver(builder);
for (int y = 10; y <= 60; y += 10) {
for (int x = 10; x <= 60; x += 10) {
receiver.setColor(((x + y) % 20) == 10 ? DlColor(SK_ColorRED)
: DlColor(SK_ColorBLUE));
receiver.drawRect(SkRect::MakeXYWH(x, y, 80, 80));
}
}
DisplayListBuilder outer_builder(SkRect::MakeWH(150, 100));
DlOpReceiver& outer_receiver = ToReceiver(outer_builder);
outer_receiver.drawDisplayList(builder.Build());
auto display_list = outer_builder.Build();
ASSERT_EQ(display_list->op_count(), 1u);
ASSERT_EQ(display_list->op_count(true), 36u);
ASSERT_EQ(picture->approximateOpCount(),
static_cast<int>(display_list->op_count()));
ASSERT_EQ(picture->approximateOpCount(true),
static_cast<int>(display_list->op_count(true)));
}
TEST_F(DisplayListTest, DisplayListFullPerspectiveTransformHandling) {
// SkM44 constructor takes row-major order
SkM44 sk_matrix = SkM44(
// clang-format off
1, 2, 3, 4,
5, 6, 7, 8,
9, 10, 11, 12,
13, 14, 15, 16
// clang-format on
);
{ // First test ==
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
// receiver.transformFullPerspective takes row-major order
receiver.transformFullPerspective(
// clang-format off
1, 2, 3, 4,
5, 6, 7, 8,
9, 10, 11, 12,
13, 14, 15, 16
// clang-format on
);
sk_sp<DisplayList> display_list = builder.Build();
sk_sp<SkSurface> surface =
SkSurfaces::Raster(SkImageInfo::MakeN32Premul(10, 10));
SkCanvas* canvas = surface->getCanvas();
// We can't use DlSkCanvas.DrawDisplayList as that method protects
// the canvas against mutations from the display list being drawn.
auto dispatcher = DlSkCanvasDispatcher(surface->getCanvas());
display_list->Dispatch(dispatcher);
SkM44 dl_matrix = canvas->getLocalToDevice();
ASSERT_EQ(sk_matrix, dl_matrix);
}
{ // Next test !=
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
// receiver.transformFullPerspective takes row-major order
receiver.transformFullPerspective(
// clang-format off
1, 5, 9, 13,
2, 6, 7, 11,
3, 7, 11, 15,
4, 8, 12, 16
// clang-format on
);
sk_sp<DisplayList> display_list = builder.Build();
sk_sp<SkSurface> surface =
SkSurfaces::Raster(SkImageInfo::MakeN32Premul(10, 10));
SkCanvas* canvas = surface->getCanvas();
// We can't use DlSkCanvas.DrawDisplayList as that method protects
// the canvas against mutations from the display list being drawn.
auto dispatcher = DlSkCanvasDispatcher(surface->getCanvas());
display_list->Dispatch(dispatcher);
SkM44 dl_matrix = canvas->getLocalToDevice();
ASSERT_NE(sk_matrix, dl_matrix);
}
}
TEST_F(DisplayListTest, DisplayListTransformResetHandling) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.scale(20.0, 20.0);
receiver.transformReset();
auto display_list = builder.Build();
ASSERT_NE(display_list, nullptr);
sk_sp<SkSurface> surface =
SkSurfaces::Raster(SkImageInfo::MakeN32Premul(10, 10));
SkCanvas* canvas = surface->getCanvas();
// We can't use DlSkCanvas.DrawDisplayList as that method protects
// the canvas against mutations from the display list being drawn.
auto dispatcher = DlSkCanvasDispatcher(surface->getCanvas());
display_list->Dispatch(dispatcher);
ASSERT_TRUE(canvas->getTotalMatrix().isIdentity());
}
TEST_F(DisplayListTest, SingleOpsMightSupportGroupOpacityBlendMode) {
auto run_tests = [](const std::string& name,
void build(DlOpReceiver & receiver), bool expect_for_op,
bool expect_with_kSrc) {
{
// First test is the draw op, by itself
// (usually supports group opacity)
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
build(receiver);
auto display_list = builder.Build();
EXPECT_EQ(display_list->can_apply_group_opacity(), expect_for_op)
<< "{" << std::endl
<< " " << name << std::endl
<< "}";
}
{
// Second test i the draw op with kSrc,
// (usually fails group opacity)
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setBlendMode(DlBlendMode::kSrc);
build(receiver);
auto display_list = builder.Build();
EXPECT_EQ(display_list->can_apply_group_opacity(), expect_with_kSrc)
<< "{" << std::endl
<< " receiver.setBlendMode(kSrc);" << std::endl
<< " " << name << std::endl
<< "}";
}
};
#define RUN_TESTS(body) \
run_tests(#body, [](DlOpReceiver& receiver) { body }, true, false)
#define RUN_TESTS2(body, expect) \
run_tests(#body, [](DlOpReceiver& receiver) { body }, expect, expect)
RUN_TESTS(receiver.drawPaint(););
RUN_TESTS2(receiver.drawColor(DlColor(SK_ColorRED), DlBlendMode::kSrcOver);
, true);
RUN_TESTS2(receiver.drawColor(DlColor(SK_ColorRED), DlBlendMode::kSrc);
, false);
RUN_TESTS(receiver.drawLine({0, 0}, {10, 10}););
RUN_TESTS(receiver.drawRect({0, 0, 10, 10}););
RUN_TESTS(receiver.drawOval({0, 0, 10, 10}););
RUN_TESTS(receiver.drawCircle({10, 10}, 5););
RUN_TESTS(receiver.drawRRect(SkRRect::MakeRectXY({0, 0, 10, 10}, 2, 2)););
RUN_TESTS(receiver.drawDRRect(SkRRect::MakeRectXY({0, 0, 10, 10}, 2, 2),
SkRRect::MakeRectXY({2, 2, 8, 8}, 2, 2)););
RUN_TESTS(receiver.drawPath(
SkPath().addOval({0, 0, 10, 10}).addOval({5, 5, 15, 15})););
RUN_TESTS(receiver.drawArc({0, 0, 10, 10}, 0, math::kPi, true););
RUN_TESTS2(
receiver.drawPoints(PointMode::kPoints, TestPointCount, kTestPoints);
, false);
RUN_TESTS2(receiver.drawVertices(TestVertices1.get(), DlBlendMode::kSrc);
, false);
RUN_TESTS(receiver.drawImage(TestImage1, {0, 0}, kLinearSampling, true););
RUN_TESTS2(receiver.drawImage(TestImage1, {0, 0}, kLinearSampling, false);
, true);
RUN_TESTS(receiver.drawImageRect(TestImage1, {10, 10, 20, 20}, {0, 0, 10, 10},
kNearestSampling, true,
DlCanvas::SrcRectConstraint::kFast););
RUN_TESTS2(receiver.drawImageRect(TestImage1, {10, 10, 20, 20},
{0, 0, 10, 10}, kNearestSampling, false,
DlCanvas::SrcRectConstraint::kFast);
, true);
RUN_TESTS(receiver.drawImageNine(TestImage2, {20, 20, 30, 30}, {0, 0, 20, 20},
DlFilterMode::kLinear, true););
RUN_TESTS2(
receiver.drawImageNine(TestImage2, {20, 20, 30, 30}, {0, 0, 20, 20},
DlFilterMode::kLinear, false);
, true);
static SkRSXform xforms[] = {{1, 0, 0, 0}, {0, 1, 0, 0}};
static SkRect texs[] = {{10, 10, 20, 20}, {20, 20, 30, 30}};
RUN_TESTS2(
receiver.drawAtlas(TestImage1, xforms, texs, nullptr, 2,
DlBlendMode::kSrcIn, kNearestSampling, nullptr, true);
, false);
RUN_TESTS2(
receiver.drawAtlas(TestImage1, xforms, texs, nullptr, 2,
DlBlendMode::kSrcIn, kNearestSampling, nullptr, false);
, false);
EXPECT_TRUE(TestDisplayList1->can_apply_group_opacity());
RUN_TESTS2(receiver.drawDisplayList(TestDisplayList1);, true);
{
static DisplayListBuilder builder;
builder.DrawRect({0, 0, 10, 10}, DlPaint());
builder.DrawRect({5, 5, 15, 15}, DlPaint());
static auto display_list = builder.Build();
RUN_TESTS2(receiver.drawDisplayList(display_list);, false);
}
RUN_TESTS2(receiver.drawTextBlob(GetTestTextBlob(1), 0, 0);, false);
RUN_TESTS2(
receiver.drawShadow(kTestPath1, DlColor(SK_ColorBLACK), 1.0, false, 1.0);
, false);
#undef RUN_TESTS2
#undef RUN_TESTS
}
TEST_F(DisplayListTest, OverlappingOpsDoNotSupportGroupOpacity) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
for (int i = 0; i < 10; i++) {
receiver.drawRect(SkRect::MakeXYWH(i * 10, 0, 30, 30));
}
auto display_list = builder.Build();
EXPECT_FALSE(display_list->can_apply_group_opacity());
}
TEST_F(DisplayListTest, SaveLayerFalseSupportsGroupOpacityOverlappingChidren) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.saveLayer(nullptr, SaveLayerOptions::kNoAttributes);
for (int i = 0; i < 10; i++) {
receiver.drawRect(SkRect::MakeXYWH(i * 10, 0, 30, 30));
}
receiver.restore();
auto display_list = builder.Build();
EXPECT_TRUE(display_list->can_apply_group_opacity());
}
TEST_F(DisplayListTest, SaveLayerTrueSupportsGroupOpacityOverlappingChidren) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
for (int i = 0; i < 10; i++) {
receiver.drawRect(SkRect::MakeXYWH(i * 10, 0, 30, 30));
}
receiver.restore();
auto display_list = builder.Build();
EXPECT_TRUE(display_list->can_apply_group_opacity());
}
TEST_F(DisplayListTest, SaveLayerFalseWithSrcBlendSupportsGroupOpacity) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setBlendMode(DlBlendMode::kSrc);
receiver.saveLayer(nullptr, SaveLayerOptions::kNoAttributes);
receiver.drawRect({0, 0, 10, 10});
receiver.restore();
auto display_list = builder.Build();
EXPECT_TRUE(display_list->can_apply_group_opacity());
}
TEST_F(DisplayListTest, SaveLayerTrueWithSrcBlendDoesNotSupportGroupOpacity) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setBlendMode(DlBlendMode::kSrc);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.drawRect({0, 0, 10, 10});
receiver.restore();
auto display_list = builder.Build();
EXPECT_FALSE(display_list->can_apply_group_opacity());
}
TEST_F(DisplayListTest, SaveLayerFalseSupportsGroupOpacityWithChildSrcBlend) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.saveLayer(nullptr, SaveLayerOptions::kNoAttributes);
receiver.setBlendMode(DlBlendMode::kSrc);
receiver.drawRect({0, 0, 10, 10});
receiver.restore();
auto display_list = builder.Build();
EXPECT_TRUE(display_list->can_apply_group_opacity());
}
TEST_F(DisplayListTest, SaveLayerTrueSupportsGroupOpacityWithChildSrcBlend) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.setBlendMode(DlBlendMode::kSrc);
receiver.drawRect({0, 0, 10, 10});
receiver.restore();
auto display_list = builder.Build();
EXPECT_TRUE(display_list->can_apply_group_opacity());
}
TEST_F(DisplayListTest, SaveLayerBoundsSnapshotsImageFilter) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.drawRect({50, 50, 100, 100});
// This image filter should be ignored since it was not set before saveLayer
receiver.setImageFilter(&kTestBlurImageFilter1);
receiver.restore();
SkRect bounds = builder.Build()->bounds();
EXPECT_EQ(bounds, SkRect::MakeLTRB(50, 50, 100, 100));
}
class SaveLayerOptionsExpector : public virtual DlOpReceiver,
public IgnoreAttributeDispatchHelper,
public IgnoreClipDispatchHelper,
public IgnoreTransformDispatchHelper,
public IgnoreDrawDispatchHelper {
public:
explicit SaveLayerOptionsExpector(const SaveLayerOptions& expected) {
expected_.push_back(expected);
}
explicit SaveLayerOptionsExpector(std::vector<SaveLayerOptions> expected)
: expected_(std::move(expected)) {}
void saveLayer(const SkRect& bounds,
const SaveLayerOptions options,
const DlImageFilter* backdrop) override {
EXPECT_EQ(options, expected_[save_layer_count_]);
save_layer_count_++;
}
int save_layer_count() { return save_layer_count_; }
private:
std::vector<SaveLayerOptions> expected_;
int save_layer_count_ = 0;
};
TEST_F(DisplayListTest, SaveLayerOneSimpleOpInheritsOpacity) {
SaveLayerOptions expected =
SaveLayerOptions::kWithAttributes.with_can_distribute_opacity();
SaveLayerOptionsExpector expector(expected);
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColor(DlColor(SkColorSetARGB(127, 255, 255, 255)));
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.drawRect({10, 10, 20, 20});
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 1);
}
TEST_F(DisplayListTest, SaveLayerNoAttributesInheritsOpacity) {
SaveLayerOptions expected =
SaveLayerOptions::kNoAttributes.with_can_distribute_opacity();
SaveLayerOptionsExpector expector(expected);
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.saveLayer(nullptr, SaveLayerOptions::kNoAttributes);
receiver.drawRect({10, 10, 20, 20});
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 1);
}
TEST_F(DisplayListTest, SaveLayerTwoOverlappingOpsDoesNotInheritOpacity) {
SaveLayerOptions expected = SaveLayerOptions::kWithAttributes;
SaveLayerOptionsExpector expector(expected);
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColor(DlColor(SkColorSetARGB(127, 255, 255, 255)));
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.drawRect({10, 10, 20, 20});
receiver.drawRect({15, 15, 25, 25});
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 1);
}
TEST_F(DisplayListTest, NestedSaveLayersMightInheritOpacity) {
SaveLayerOptions expected1 =
SaveLayerOptions::kWithAttributes.with_can_distribute_opacity();
SaveLayerOptions expected2 = SaveLayerOptions::kWithAttributes;
SaveLayerOptions expected3 =
SaveLayerOptions::kWithAttributes.with_can_distribute_opacity();
SaveLayerOptionsExpector expector({expected1, expected2, expected3});
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColor(DlColor(SkColorSetARGB(127, 255, 255, 255)));
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.drawRect({10, 10, 20, 20});
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.drawRect({15, 15, 25, 25});
receiver.restore();
receiver.restore();
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 3);
}
TEST_F(DisplayListTest, NestedSaveLayersCanBothSupportOpacityOptimization) {
SaveLayerOptions expected1 =
SaveLayerOptions::kWithAttributes.with_can_distribute_opacity();
SaveLayerOptions expected2 =
SaveLayerOptions::kNoAttributes.with_can_distribute_opacity();
SaveLayerOptionsExpector expector({expected1, expected2});
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColor(DlColor(SkColorSetARGB(127, 255, 255, 255)));
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.saveLayer(nullptr, SaveLayerOptions::kNoAttributes);
receiver.drawRect({10, 10, 20, 20});
receiver.restore();
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 2);
}
TEST_F(DisplayListTest, SaveLayerImageFilterDoesNotInheritOpacity) {
SaveLayerOptions expected = SaveLayerOptions::kWithAttributes;
SaveLayerOptionsExpector expector(expected);
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColor(DlColor(SkColorSetARGB(127, 255, 255, 255)));
receiver.setImageFilter(&kTestBlurImageFilter1);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.setImageFilter(nullptr);
receiver.drawRect({10, 10, 20, 20});
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 1);
}
TEST_F(DisplayListTest, SaveLayerColorFilterDoesNotInheritOpacity) {
SaveLayerOptions expected = SaveLayerOptions::kWithAttributes;
SaveLayerOptionsExpector expector(expected);
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColor(DlColor(SkColorSetARGB(127, 255, 255, 255)));
receiver.setColorFilter(&kTestMatrixColorFilter1);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.setColorFilter(nullptr);
receiver.drawRect({10, 10, 20, 20});
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 1);
}
TEST_F(DisplayListTest, SaveLayerSrcBlendDoesNotInheritOpacity) {
SaveLayerOptions expected = SaveLayerOptions::kWithAttributes;
SaveLayerOptionsExpector expector(expected);
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColor(DlColor(SkColorSetARGB(127, 255, 255, 255)));
receiver.setBlendMode(DlBlendMode::kSrc);
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.setBlendMode(DlBlendMode::kSrcOver);
receiver.drawRect({10, 10, 20, 20});
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 1);
}
TEST_F(DisplayListTest, SaveLayerImageFilterOnChildInheritsOpacity) {
SaveLayerOptions expected =
SaveLayerOptions::kWithAttributes.with_can_distribute_opacity();
SaveLayerOptionsExpector expector(expected);
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColor(DlColor(SkColorSetARGB(127, 255, 255, 255)));
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.setImageFilter(&kTestBlurImageFilter1);
receiver.drawRect({10, 10, 20, 20});
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 1);
}
TEST_F(DisplayListTest, SaveLayerColorFilterOnChildDoesNotInheritOpacity) {
SaveLayerOptions expected = SaveLayerOptions::kWithAttributes;
SaveLayerOptionsExpector expector(expected);
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColor(DlColor(SkColorSetARGB(127, 255, 255, 255)));
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.setColorFilter(&kTestMatrixColorFilter1);
receiver.drawRect({10, 10, 20, 20});
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 1);
}
TEST_F(DisplayListTest, SaveLayerSrcBlendOnChildDoesNotInheritOpacity) {
SaveLayerOptions expected = SaveLayerOptions::kWithAttributes;
SaveLayerOptionsExpector expector(expected);
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setColor(DlColor(SkColorSetARGB(127, 255, 255, 255)));
receiver.saveLayer(nullptr, SaveLayerOptions::kWithAttributes);
receiver.setBlendMode(DlBlendMode::kSrc);
receiver.drawRect({10, 10, 20, 20});
receiver.restore();
builder.Build()->Dispatch(expector);
EXPECT_EQ(expector.save_layer_count(), 1);
}
TEST_F(DisplayListTest, FlutterSvgIssue661BoundsWereEmpty) {
// See https://github.com/dnfield/flutter_svg/issues/661
SkPath path1;
path1.setFillType(SkPathFillType::kWinding);
path1.moveTo(25.54f, 37.52f);
path1.cubicTo(20.91f, 37.52f, 16.54f, 33.39f, 13.62f, 30.58f);
path1.lineTo(13, 30);
path1.lineTo(12.45f, 29.42f);
path1.cubicTo(8.39f, 25.15f, 1.61f, 18, 8.37f, 11.27f);
path1.cubicTo(10.18f, 9.46f, 12.37f, 9.58f, 14.49f, 11.58f);
path1.cubicTo(15.67f, 12.71f, 17.05f, 14.69f, 17.07f, 16.58f);
path1.cubicTo(17.0968f, 17.458f, 16.7603f, 18.3081f, 16.14f, 18.93f);
path1.cubicTo(15.8168f, 19.239f, 15.4653f, 19.5169f, 15.09f, 19.76f);
path1.cubicTo(14.27f, 20.33f, 14.21f, 20.44f, 14.27f, 20.62f);
path1.cubicTo(15.1672f, 22.3493f, 16.3239f, 23.9309f, 17.7f, 25.31f);
path1.cubicTo(19.0791f, 26.6861f, 20.6607f, 27.8428f, 22.39f, 28.74f);
path1.cubicTo(22.57f, 28.8f, 22.69f, 28.74f, 23.25f, 27.92f);
path1.cubicTo(23.5f, 27.566f, 23.778f, 27.231f, 24.08f, 26.92f);
path1.cubicTo(24.7045f, 26.3048f, 25.5538f, 25.9723f, 26.43f, 26);
path1.cubicTo(28.29f, 26, 30.27f, 27.4f, 31.43f, 28.58f);
path1.cubicTo(33.43f, 30.67f, 33.55f, 32.9f, 31.74f, 34.7f);
path1.cubicTo(30.1477f, 36.4508f, 27.906f, 37.4704f, 25.54f, 37.52f);
path1.close();
path1.moveTo(11.17f, 12.23f);
path1.cubicTo(10.6946f, 12.2571f, 10.2522f, 12.4819f, 9.95f, 12.85f);
path1.cubicTo(5.12f, 17.67f, 8.95f, 22.5f, 14.05f, 27.85f);
path1.lineTo(14.62f, 28.45f);
path1.lineTo(15.16f, 28.96f);
path1.cubicTo(20.52f, 34.06f, 25.35f, 37.89f, 30.16f, 33.06f);
path1.cubicTo(30.83f, 32.39f, 31.25f, 31.56f, 29.81f, 30.06f);
path1.cubicTo(28.9247f, 29.07f, 27.7359f, 28.4018f, 26.43f, 28.16f);
path1.cubicTo(26.1476f, 28.1284f, 25.8676f, 28.2367f, 25.68f, 28.45f);
path1.cubicTo(25.4633f, 28.6774f, 25.269f, 28.9252f, 25.1f, 29.19f);
path1.cubicTo(24.53f, 30.01f, 23.47f, 31.54f, 21.54f, 30.79f);
path1.lineTo(21.41f, 30.72f);
path1.cubicTo(19.4601f, 29.7156f, 17.6787f, 28.4133f, 16.13f, 26.86f);
path1.cubicTo(14.5748f, 25.3106f, 13.2693f, 23.5295f, 12.26f, 21.58f);
path1.lineTo(12.2f, 21.44f);
path1.cubicTo(11.45f, 19.51f, 12.97f, 18.44f, 13.8f, 17.88f);
path1.cubicTo(14.061f, 17.706f, 14.308f, 17.512f, 14.54f, 17.3f);
path1.cubicTo(14.7379f, 17.1067f, 14.8404f, 16.8359f, 14.82f, 16.56f);
path1.cubicTo(14.5978f, 15.268f, 13.9585f, 14.0843f, 13, 13.19f);
path1.cubicTo(12.5398f, 12.642f, 11.8824f, 12.2971f, 11.17f, 12.23f);
path1.lineTo(11.17f, 12.23f);
path1.close();
path1.moveTo(27, 19.34f);
path1.lineTo(24.74f, 19.34f);
path1.cubicTo(24.7319f, 18.758f, 24.262f, 18.2881f, 23.68f, 18.28f);
path1.lineTo(23.68f, 16.05f);
path1.lineTo(23.7f, 16.05f);
path1.cubicTo(25.5153f, 16.0582f, 26.9863f, 17.5248f, 27, 19.34f);
path1.lineTo(27, 19.34f);
path1.close();
path1.moveTo(32.3f, 19.34f);
path1.lineTo(30.07f, 19.34f);
path1.cubicTo(30.037f, 15.859f, 27.171f, 13.011f, 23.69f, 13);
path1.lineTo(23.69f, 10.72f);
path1.cubicTo(28.415f, 10.725f, 32.3f, 14.615f, 32.3f, 19.34f);
path1.close();
SkPath path2;
path2.setFillType(SkPathFillType::kWinding);
path2.moveTo(37.5f, 19.33f);
path2.lineTo(35.27f, 19.33f);
path2.cubicTo(35.265f, 12.979f, 30.041f, 7.755f, 23.69f, 7.75f);
path2.lineTo(23.69f, 5.52f);
path2.cubicTo(31.264f, 5.525f, 37.495f, 11.756f, 37.5f, 19.33f);
path2.close();
DisplayListBuilder builder;
DlPaint paint = DlPaint(DlColor::kWhite()).setAntiAlias(true);
{
builder.Save();
builder.ClipRect({0, 0, 100, 100}, ClipOp::kIntersect, true);
{
builder.Save();
builder.Transform2DAffine(2.17391, 0, -2547.83, //
0, 2.04082, -500);
{
builder.Save();
builder.ClipRect({1172, 245, 1218, 294}, ClipOp::kIntersect, true);
{
builder.SaveLayer(nullptr, nullptr, nullptr);
{
builder.Save();
builder.Transform2DAffine(1.4375, 0, 1164.09, //
0, 1.53125, 236.548);
builder.DrawPath(path1, paint);
builder.Restore();
}
{
builder.Save();
builder.Transform2DAffine(1.4375, 0, 1164.09, //
0, 1.53125, 236.548);
builder.DrawPath(path2, paint);
builder.Restore();
}
builder.Restore();
}
builder.Restore();
}
builder.Restore();
}
builder.Restore();
}
sk_sp<DisplayList> display_list = builder.Build();
// Prior to the fix, the bounds were empty.
EXPECT_FALSE(display_list->bounds().isEmpty());
// These are just inside and outside of the expected bounds, but
// testing float values can be flaky wrt minor changes in the bounds
// calculations. If these lines have to be revised too often as the DL
// implementation is improved and maintained, then we can eliminate
// this test and just rely on the "rounded out" bounds test that follows.
SkRect min_bounds = SkRect::MakeLTRB(0, 0.00191, 99.983, 100);
SkRect max_bounds = SkRect::MakeLTRB(0, 0.00189, 99.985, 100);
ASSERT_TRUE(max_bounds.contains(min_bounds));
EXPECT_TRUE(max_bounds.contains(display_list->bounds()));
EXPECT_TRUE(display_list->bounds().contains(min_bounds));
// This is the more practical result. The bounds are "almost" 0,0,100x100
EXPECT_EQ(display_list->bounds().roundOut(), SkIRect::MakeWH(100, 100));
EXPECT_EQ(display_list->op_count(), 19u);
EXPECT_EQ(display_list->bytes(), sizeof(DisplayList) + 400u);
}
TEST_F(DisplayListTest, TranslateAffectsCurrentTransform) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.translate(12.3, 14.5);
SkMatrix matrix = SkMatrix::Translate(12.3, 14.5);
SkM44 m44 = SkM44(matrix);
SkM44 cur_m44 = builder.GetTransformFullPerspective();
SkMatrix cur_matrix = builder.GetTransform();
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
receiver.translate(10, 10);
// CurrentTransform has changed
ASSERT_NE(builder.GetTransformFullPerspective(), m44);
ASSERT_NE(builder.GetTransform(), cur_matrix);
// Previous return values have not
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
}
TEST_F(DisplayListTest, ScaleAffectsCurrentTransform) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.scale(12.3, 14.5);
SkMatrix matrix = SkMatrix::Scale(12.3, 14.5);
SkM44 m44 = SkM44(matrix);
SkM44 cur_m44 = builder.GetTransformFullPerspective();
SkMatrix cur_matrix = builder.GetTransform();
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
receiver.translate(10, 10);
// CurrentTransform has changed
ASSERT_NE(builder.GetTransformFullPerspective(), m44);
ASSERT_NE(builder.GetTransform(), cur_matrix);
// Previous return values have not
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
}
TEST_F(DisplayListTest, RotateAffectsCurrentTransform) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.rotate(12.3);
SkMatrix matrix = SkMatrix::RotateDeg(12.3);
SkM44 m44 = SkM44(matrix);
SkM44 cur_m44 = builder.GetTransformFullPerspective();
SkMatrix cur_matrix = builder.GetTransform();
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
receiver.translate(10, 10);
// CurrentTransform has changed
ASSERT_NE(builder.GetTransformFullPerspective(), m44);
ASSERT_NE(builder.GetTransform(), cur_matrix);
// Previous return values have not
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
}
TEST_F(DisplayListTest, SkewAffectsCurrentTransform) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.skew(12.3, 14.5);
SkMatrix matrix = SkMatrix::Skew(12.3, 14.5);
SkM44 m44 = SkM44(matrix);
SkM44 cur_m44 = builder.GetTransformFullPerspective();
SkMatrix cur_matrix = builder.GetTransform();
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
receiver.translate(10, 10);
// CurrentTransform has changed
ASSERT_NE(builder.GetTransformFullPerspective(), m44);
ASSERT_NE(builder.GetTransform(), cur_matrix);
// Previous return values have not
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
}
TEST_F(DisplayListTest, TransformAffectsCurrentTransform) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.transform2DAffine(3, 0, 12.3, //
1, 5, 14.5);
SkMatrix matrix = SkMatrix::MakeAll(3, 0, 12.3, //
1, 5, 14.5, //
0, 0, 1);
SkM44 m44 = SkM44(matrix);
SkM44 cur_m44 = builder.GetTransformFullPerspective();
SkMatrix cur_matrix = builder.GetTransform();
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
receiver.translate(10, 10);
// CurrentTransform has changed
ASSERT_NE(builder.GetTransformFullPerspective(), m44);
ASSERT_NE(builder.GetTransform(), cur_matrix);
// Previous return values have not
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
}
TEST_F(DisplayListTest, FullTransformAffectsCurrentTransform) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.transformFullPerspective(3, 0, 4, 12.3, //
1, 5, 3, 14.5, //
0, 0, 7, 16.2, //
0, 0, 0, 1);
SkMatrix matrix = SkMatrix::MakeAll(3, 0, 12.3, //
1, 5, 14.5, //
0, 0, 1);
SkM44 m44 = SkM44(3, 0, 4, 12.3, //
1, 5, 3, 14.5, //
0, 0, 7, 16.2, //
0, 0, 0, 1);
SkM44 cur_m44 = builder.GetTransformFullPerspective();
SkMatrix cur_matrix = builder.GetTransform();
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
receiver.translate(10, 10);
// CurrentTransform has changed
ASSERT_NE(builder.GetTransformFullPerspective(), m44);
ASSERT_NE(builder.GetTransform(), cur_matrix);
// Previous return values have not
ASSERT_EQ(cur_m44, m44);
ASSERT_EQ(cur_matrix, matrix);
}
TEST_F(DisplayListTest, ClipRectAffectsClipBounds) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkRect clip_bounds = SkRect::MakeLTRB(10.2, 11.3, 20.4, 25.7);
receiver.clipRect(clip_bounds, ClipOp::kIntersect, false);
// Save initial return values for testing restored values
SkRect initial_local_bounds = builder.GetLocalClipBounds();
SkRect initial_destination_bounds = builder.GetDestinationClipBounds();
ASSERT_EQ(initial_local_bounds, clip_bounds);
ASSERT_EQ(initial_destination_bounds, clip_bounds);
receiver.save();
receiver.clipRect({0, 0, 15, 15}, ClipOp::kIntersect, false);
// Both clip bounds have changed
ASSERT_NE(builder.GetLocalClipBounds(), clip_bounds);
ASSERT_NE(builder.GetDestinationClipBounds(), clip_bounds);
// Previous return values have not changed
ASSERT_EQ(initial_local_bounds, clip_bounds);
ASSERT_EQ(initial_destination_bounds, clip_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
receiver.save();
receiver.scale(2, 2);
SkRect scaled_clip_bounds = SkRect::MakeLTRB(5.1, 5.65, 10.2, 12.85);
ASSERT_EQ(builder.GetLocalClipBounds(), scaled_clip_bounds);
// Destination bounds are unaffected by transform
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
}
TEST_F(DisplayListTest, ClipRectDoAAAffectsClipBounds) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkRect clip_bounds = SkRect::MakeLTRB(10.2, 11.3, 20.4, 25.7);
SkRect clip_expanded_bounds = SkRect::MakeLTRB(10, 11, 21, 26);
receiver.clipRect(clip_bounds, ClipOp::kIntersect, true);
// Save initial return values for testing restored values
SkRect initial_local_bounds = builder.GetLocalClipBounds();
SkRect initial_destination_bounds = builder.GetDestinationClipBounds();
ASSERT_EQ(initial_local_bounds, clip_expanded_bounds);
ASSERT_EQ(initial_destination_bounds, clip_expanded_bounds);
receiver.save();
receiver.clipRect({0, 0, 15, 15}, ClipOp::kIntersect, true);
// Both clip bounds have changed
ASSERT_NE(builder.GetLocalClipBounds(), clip_expanded_bounds);
ASSERT_NE(builder.GetDestinationClipBounds(), clip_expanded_bounds);
// Previous return values have not changed
ASSERT_EQ(initial_local_bounds, clip_expanded_bounds);
ASSERT_EQ(initial_destination_bounds, clip_expanded_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
receiver.save();
receiver.scale(2, 2);
SkRect scaled_expanded_bounds = SkRect::MakeLTRB(5, 5.5, 10.5, 13);
ASSERT_EQ(builder.GetLocalClipBounds(), scaled_expanded_bounds);
// Destination bounds are unaffected by transform
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_expanded_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
}
TEST_F(DisplayListTest, ClipRectAffectsClipBoundsWithMatrix) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkRect clip_bounds_1 = SkRect::MakeLTRB(0, 0, 10, 10);
SkRect clip_bounds_2 = SkRect::MakeLTRB(10, 10, 20, 20);
receiver.save();
receiver.clipRect(clip_bounds_1, ClipOp::kIntersect, false);
receiver.translate(10, 0);
receiver.clipRect(clip_bounds_1, ClipOp::kIntersect, false);
ASSERT_TRUE(builder.GetDestinationClipBounds().isEmpty());
receiver.restore();
receiver.save();
receiver.clipRect(clip_bounds_1, ClipOp::kIntersect, false);
receiver.translate(-10, -10);
receiver.clipRect(clip_bounds_2, ClipOp::kIntersect, false);
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds_1);
receiver.restore();
}
TEST_F(DisplayListTest, ClipRRectAffectsClipBounds) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkRect clip_bounds = SkRect::MakeLTRB(10.2, 11.3, 20.4, 25.7);
SkRRect clip = SkRRect::MakeRectXY(clip_bounds, 3, 2);
receiver.clipRRect(clip, ClipOp::kIntersect, false);
// Save initial return values for testing restored values
SkRect initial_local_bounds = builder.GetLocalClipBounds();
SkRect initial_destination_bounds = builder.GetDestinationClipBounds();
ASSERT_EQ(initial_local_bounds, clip_bounds);
ASSERT_EQ(initial_destination_bounds, clip_bounds);
receiver.save();
receiver.clipRect({0, 0, 15, 15}, ClipOp::kIntersect, false);
// Both clip bounds have changed
ASSERT_NE(builder.GetLocalClipBounds(), clip_bounds);
ASSERT_NE(builder.GetDestinationClipBounds(), clip_bounds);
// Previous return values have not changed
ASSERT_EQ(initial_local_bounds, clip_bounds);
ASSERT_EQ(initial_destination_bounds, clip_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
receiver.save();
receiver.scale(2, 2);
SkRect scaled_clip_bounds = SkRect::MakeLTRB(5.1, 5.65, 10.2, 12.85);
ASSERT_EQ(builder.GetLocalClipBounds(), scaled_clip_bounds);
// Destination bounds are unaffected by transform
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
}
TEST_F(DisplayListTest, ClipRRectDoAAAffectsClipBounds) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkRect clip_bounds = SkRect::MakeLTRB(10.2, 11.3, 20.4, 25.7);
SkRect clip_expanded_bounds = SkRect::MakeLTRB(10, 11, 21, 26);
SkRRect clip = SkRRect::MakeRectXY(clip_bounds, 3, 2);
receiver.clipRRect(clip, ClipOp::kIntersect, true);
// Save initial return values for testing restored values
SkRect initial_local_bounds = builder.GetLocalClipBounds();
SkRect initial_destination_bounds = builder.GetDestinationClipBounds();
ASSERT_EQ(initial_local_bounds, clip_expanded_bounds);
ASSERT_EQ(initial_destination_bounds, clip_expanded_bounds);
receiver.save();
receiver.clipRect({0, 0, 15, 15}, ClipOp::kIntersect, true);
// Both clip bounds have changed
ASSERT_NE(builder.GetLocalClipBounds(), clip_expanded_bounds);
ASSERT_NE(builder.GetDestinationClipBounds(), clip_expanded_bounds);
// Previous return values have not changed
ASSERT_EQ(initial_local_bounds, clip_expanded_bounds);
ASSERT_EQ(initial_destination_bounds, clip_expanded_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
receiver.save();
receiver.scale(2, 2);
SkRect scaled_expanded_bounds = SkRect::MakeLTRB(5, 5.5, 10.5, 13);
ASSERT_EQ(builder.GetLocalClipBounds(), scaled_expanded_bounds);
// Destination bounds are unaffected by transform
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_expanded_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
}
TEST_F(DisplayListTest, ClipRRectAffectsClipBoundsWithMatrix) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkRect clip_bounds_1 = SkRect::MakeLTRB(0, 0, 10, 10);
SkRect clip_bounds_2 = SkRect::MakeLTRB(10, 10, 20, 20);
SkRRect clip1 = SkRRect::MakeRectXY(clip_bounds_1, 3, 2);
SkRRect clip2 = SkRRect::MakeRectXY(clip_bounds_2, 3, 2);
receiver.save();
receiver.clipRRect(clip1, ClipOp::kIntersect, false);
receiver.translate(10, 0);
receiver.clipRRect(clip1, ClipOp::kIntersect, false);
ASSERT_TRUE(builder.GetDestinationClipBounds().isEmpty());
receiver.restore();
receiver.save();
receiver.clipRRect(clip1, ClipOp::kIntersect, false);
receiver.translate(-10, -10);
receiver.clipRRect(clip2, ClipOp::kIntersect, false);
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds_1);
receiver.restore();
}
TEST_F(DisplayListTest, ClipPathAffectsClipBounds) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkPath clip = SkPath().addCircle(10.2, 11.3, 2).addCircle(20.4, 25.7, 2);
SkRect clip_bounds = SkRect::MakeLTRB(8.2, 9.3, 22.4, 27.7);
receiver.clipPath(clip, ClipOp::kIntersect, false);
// Save initial return values for testing restored values
SkRect initial_local_bounds = builder.GetLocalClipBounds();
SkRect initial_destination_bounds = builder.GetDestinationClipBounds();
ASSERT_EQ(initial_local_bounds, clip_bounds);
ASSERT_EQ(initial_destination_bounds, clip_bounds);
receiver.save();
receiver.clipRect({0, 0, 15, 15}, ClipOp::kIntersect, false);
// Both clip bounds have changed
ASSERT_NE(builder.GetLocalClipBounds(), clip_bounds);
ASSERT_NE(builder.GetDestinationClipBounds(), clip_bounds);
// Previous return values have not changed
ASSERT_EQ(initial_local_bounds, clip_bounds);
ASSERT_EQ(initial_destination_bounds, clip_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
receiver.save();
receiver.scale(2, 2);
SkRect scaled_clip_bounds = SkRect::MakeLTRB(4.1, 4.65, 11.2, 13.85);
ASSERT_EQ(builder.GetLocalClipBounds(), scaled_clip_bounds);
// Destination bounds are unaffected by transform
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
}
TEST_F(DisplayListTest, ClipPathDoAAAffectsClipBounds) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkPath clip = SkPath().addCircle(10.2, 11.3, 2).addCircle(20.4, 25.7, 2);
SkRect clip_expanded_bounds = SkRect::MakeLTRB(8, 9, 23, 28);
receiver.clipPath(clip, ClipOp::kIntersect, true);
// Save initial return values for testing restored values
SkRect initial_local_bounds = builder.GetLocalClipBounds();
SkRect initial_destination_bounds = builder.GetDestinationClipBounds();
ASSERT_EQ(initial_local_bounds, clip_expanded_bounds);
ASSERT_EQ(initial_destination_bounds, clip_expanded_bounds);
receiver.save();
receiver.clipRect({0, 0, 15, 15}, ClipOp::kIntersect, true);
// Both clip bounds have changed
ASSERT_NE(builder.GetLocalClipBounds(), clip_expanded_bounds);
ASSERT_NE(builder.GetDestinationClipBounds(), clip_expanded_bounds);
// Previous return values have not changed
ASSERT_EQ(initial_local_bounds, clip_expanded_bounds);
ASSERT_EQ(initial_destination_bounds, clip_expanded_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
receiver.save();
receiver.scale(2, 2);
SkRect scaled_expanded_bounds = SkRect::MakeLTRB(4, 4.5, 11.5, 14);
ASSERT_EQ(builder.GetLocalClipBounds(), scaled_expanded_bounds);
// Destination bounds are unaffected by transform
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_expanded_bounds);
receiver.restore();
// save/restore returned the values to their original values
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
}
TEST_F(DisplayListTest, ClipPathAffectsClipBoundsWithMatrix) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkRect clip_bounds = SkRect::MakeLTRB(0, 0, 10, 10);
SkPath clip1 = SkPath().addCircle(2.5, 2.5, 2.5).addCircle(7.5, 7.5, 2.5);
SkPath clip2 = SkPath().addCircle(12.5, 12.5, 2.5).addCircle(17.5, 17.5, 2.5);
receiver.save();
receiver.clipPath(clip1, ClipOp::kIntersect, false);
receiver.translate(10, 0);
receiver.clipPath(clip1, ClipOp::kIntersect, false);
ASSERT_TRUE(builder.GetDestinationClipBounds().isEmpty());
receiver.restore();
receiver.save();
receiver.clipPath(clip1, ClipOp::kIntersect, false);
receiver.translate(-10, -10);
receiver.clipPath(clip2, ClipOp::kIntersect, false);
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
receiver.restore();
}
TEST_F(DisplayListTest, DiffClipRectDoesNotAffectClipBounds) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkRect diff_clip = SkRect::MakeLTRB(0, 0, 15, 15);
SkRect clip_bounds = SkRect::MakeLTRB(10.2, 11.3, 20.4, 25.7);
receiver.clipRect(clip_bounds, ClipOp::kIntersect, false);
// Save initial return values for testing after kDifference clip
SkRect initial_local_bounds = builder.GetLocalClipBounds();
SkRect initial_destination_bounds = builder.GetDestinationClipBounds();
ASSERT_EQ(initial_local_bounds, clip_bounds);
ASSERT_EQ(initial_destination_bounds, clip_bounds);
receiver.clipRect(diff_clip, ClipOp::kDifference, false);
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
}
TEST_F(DisplayListTest, DiffClipRRectDoesNotAffectClipBounds) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkRRect diff_clip = SkRRect::MakeRectXY({0, 0, 15, 15}, 1, 1);
SkRect clip_bounds = SkRect::MakeLTRB(10.2, 11.3, 20.4, 25.7);
SkRRect clip = SkRRect::MakeRectXY({10.2, 11.3, 20.4, 25.7}, 3, 2);
receiver.clipRRect(clip, ClipOp::kIntersect, false);
// Save initial return values for testing after kDifference clip
SkRect initial_local_bounds = builder.GetLocalClipBounds();
SkRect initial_destination_bounds = builder.GetDestinationClipBounds();
ASSERT_EQ(initial_local_bounds, clip_bounds);
ASSERT_EQ(initial_destination_bounds, clip_bounds);
receiver.clipRRect(diff_clip, ClipOp::kDifference, false);
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
}
TEST_F(DisplayListTest, DiffClipPathDoesNotAffectClipBounds) {
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
SkPath diff_clip = SkPath().addRect({0, 0, 15, 15});
SkPath clip = SkPath().addCircle(10.2, 11.3, 2).addCircle(20.4, 25.7, 2);
SkRect clip_bounds = SkRect::MakeLTRB(8.2, 9.3, 22.4, 27.7);
receiver.clipPath(clip, ClipOp::kIntersect, false);
// Save initial return values for testing after kDifference clip
SkRect initial_local_bounds = builder.GetLocalClipBounds();
SkRect initial_destination_bounds = builder.GetDestinationClipBounds();
ASSERT_EQ(initial_local_bounds, clip_bounds);
ASSERT_EQ(initial_destination_bounds, clip_bounds);
receiver.clipPath(diff_clip, ClipOp::kDifference, false);
ASSERT_EQ(builder.GetLocalClipBounds(), initial_local_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), initial_destination_bounds);
}
TEST_F(DisplayListTest, ClipPathWithInvertFillTypeDoesNotAffectClipBounds) {
SkRect cull_rect = SkRect::MakeLTRB(0, 0, 100.0, 100.0);
DisplayListBuilder builder(cull_rect);
DlOpReceiver& receiver = ToReceiver(builder);
SkPath clip = SkPath().addCircle(10.2, 11.3, 2).addCircle(20.4, 25.7, 2);
clip.setFillType(SkPathFillType::kInverseWinding);
receiver.clipPath(clip, ClipOp::kIntersect, false);
ASSERT_EQ(builder.GetLocalClipBounds(), cull_rect);
ASSERT_EQ(builder.GetDestinationClipBounds(), cull_rect);
}
TEST_F(DisplayListTest, DiffClipPathWithInvertFillTypeAffectsClipBounds) {
SkRect cull_rect = SkRect::MakeLTRB(0, 0, 100.0, 100.0);
DisplayListBuilder builder(cull_rect);
DlOpReceiver& receiver = ToReceiver(builder);
SkPath clip = SkPath().addCircle(10.2, 11.3, 2).addCircle(20.4, 25.7, 2);
clip.setFillType(SkPathFillType::kInverseWinding);
SkRect clip_bounds = SkRect::MakeLTRB(8.2, 9.3, 22.4, 27.7);
receiver.clipPath(clip, ClipOp::kDifference, false);
ASSERT_EQ(builder.GetLocalClipBounds(), clip_bounds);
ASSERT_EQ(builder.GetDestinationClipBounds(), clip_bounds);
}
TEST_F(DisplayListTest, FlatDrawPointsProducesBounds) {
SkPoint horizontal_points[2] = {{10, 10}, {20, 10}};
SkPoint vertical_points[2] = {{10, 10}, {10, 20}};
{
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.drawPoints(PointMode::kPolygon, 2, horizontal_points);
SkRect bounds = builder.Build()->bounds();
EXPECT_TRUE(bounds.contains(10, 10));
EXPECT_TRUE(bounds.contains(20, 10));
EXPECT_GE(bounds.width(), 10);
}
{
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.drawPoints(PointMode::kPolygon, 2, vertical_points);
SkRect bounds = builder.Build()->bounds();
EXPECT_TRUE(bounds.contains(10, 10));
EXPECT_TRUE(bounds.contains(10, 20));
EXPECT_GE(bounds.height(), 10);
}
{
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.drawPoints(PointMode::kPoints, 1, horizontal_points);
SkRect bounds = builder.Build()->bounds();
EXPECT_TRUE(bounds.contains(10, 10));
}
{
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setStrokeWidth(2);
receiver.drawPoints(PointMode::kPolygon, 2, horizontal_points);
SkRect bounds = builder.Build()->bounds();
EXPECT_TRUE(bounds.contains(10, 10));
EXPECT_TRUE(bounds.contains(20, 10));
EXPECT_EQ(bounds, SkRect::MakeLTRB(9, 9, 21, 11));
}
{
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setStrokeWidth(2);
receiver.drawPoints(PointMode::kPolygon, 2, vertical_points);
SkRect bounds = builder.Build()->bounds();
EXPECT_TRUE(bounds.contains(10, 10));
EXPECT_TRUE(bounds.contains(10, 20));
EXPECT_EQ(bounds, SkRect::MakeLTRB(9, 9, 11, 21));
}
{
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.setStrokeWidth(2);
receiver.drawPoints(PointMode::kPoints, 1, horizontal_points);
SkRect bounds = builder.Build()->bounds();
EXPECT_TRUE(bounds.contains(10, 10));
EXPECT_EQ(bounds, SkRect::MakeLTRB(9, 9, 11, 11));
}
}
static void test_rtree(const sk_sp<const DlRTree>& rtree,
const SkRect& query,
std::vector<SkRect> expected_rects,
const std::vector<int>& expected_indices) {
std::vector<int> indices;
rtree->search(query, &indices);
EXPECT_EQ(indices, expected_indices);
EXPECT_EQ(indices.size(), expected_indices.size());
std::list<SkRect> rects = rtree->searchAndConsolidateRects(query);
// ASSERT_EQ(rects.size(), expected_indices.size());
auto iterator = rects.cbegin();
for (int i : expected_indices) {
EXPECT_TRUE(iterator != rects.cend());
EXPECT_EQ(*iterator++, expected_rects[i]);
}
}
TEST_F(DisplayListTest, RTreeOfSimpleScene) {
DisplayListBuilder builder(/*prepare_rtree=*/true);
DlOpReceiver& receiver = ToReceiver(builder);
receiver.drawRect({10, 10, 20, 20});
receiver.drawRect({50, 50, 60, 60});
auto display_list = builder.Build();
auto rtree = display_list->rtree();
std::vector<SkRect> rects = {
{10, 10, 20, 20},
{50, 50, 60, 60},
};
// Missing all drawRect calls
test_rtree(rtree, {5, 5, 10, 10}, rects, {});
test_rtree(rtree, {20, 20, 25, 25}, rects, {});
test_rtree(rtree, {45, 45, 50, 50}, rects, {});
test_rtree(rtree, {60, 60, 65, 65}, rects, {});
// Hitting just 1 of the drawRects
test_rtree(rtree, {5, 5, 11, 11}, rects, {0});
test_rtree(rtree, {19, 19, 25, 25}, rects, {0});
test_rtree(rtree, {45, 45, 51, 51}, rects, {1});
test_rtree(rtree, {59, 59, 65, 65}, rects, {1});
// Hitting both drawRect calls
test_rtree(rtree, {19, 19, 51, 51}, rects, {0, 1});
}
TEST_F(DisplayListTest, RTreeOfSaveRestoreScene) {
DisplayListBuilder builder(/*prepare_rtree=*/true);
DlOpReceiver& receiver = ToReceiver(builder);
receiver.drawRect({10, 10, 20, 20});
receiver.save();
receiver.drawRect({50, 50, 60, 60});
receiver.restore();
auto display_list = builder.Build();
auto rtree = display_list->rtree();
std::vector<SkRect> rects = {
{10, 10, 20, 20},
{50, 50, 60, 60},
};
// Missing all drawRect calls
test_rtree(rtree, {5, 5, 10, 10}, rects, {});
test_rtree(rtree, {20, 20, 25, 25}, rects, {});
test_rtree(rtree, {45, 45, 50, 50}, rects, {});
test_rtree(rtree, {60, 60, 65, 65}, rects, {});
// Hitting just 1 of the drawRects
test_rtree(rtree, {5, 5, 11, 11}, rects, {0});
test_rtree(rtree, {19, 19, 25, 25}, rects, {0});
test_rtree(rtree, {45, 45, 51, 51}, rects, {1});
test_rtree(rtree, {59, 59, 65, 65}, rects, {1});
// Hitting both drawRect calls
test_rtree(rtree, {19, 19, 51, 51}, rects, {0, 1});
}
TEST_F(DisplayListTest, RTreeOfSaveLayerFilterScene) {
DisplayListBuilder builder(/*prepare_rtree=*/true);
// blur filter with sigma=1 expands by 3 on all sides
auto filter = DlBlurImageFilter(1.0, 1.0, DlTileMode::kClamp);
DlPaint default_paint = DlPaint();
DlPaint filter_paint = DlPaint().setImageFilter(&filter);
builder.DrawRect({10, 10, 20, 20}, default_paint);
builder.SaveLayer(nullptr, &filter_paint);
// the following rectangle will be expanded to 50,50,60,60
// by the saveLayer filter during the restore operation
builder.DrawRect({53, 53, 57, 57}, default_paint);
builder.Restore();
auto display_list = builder.Build();
auto rtree = display_list->rtree();
std::vector<SkRect> rects = {
{10, 10, 20, 20},
{50, 50, 60, 60},
};
// Missing all drawRect calls
test_rtree(rtree, {5, 5, 10, 10}, rects, {});
test_rtree(rtree, {20, 20, 25, 25}, rects, {});
test_rtree(rtree, {45, 45, 50, 50}, rects, {});
test_rtree(rtree, {60, 60, 65, 65}, rects, {});
// Hitting just 1 of the drawRects
test_rtree(rtree, {5, 5, 11, 11}, rects, {0});
test_rtree(rtree, {19, 19, 25, 25}, rects, {0});
test_rtree(rtree, {45, 45, 51, 51}, rects, {1});
test_rtree(rtree, {59, 59, 65, 65}, rects, {1});
// Hitting both drawRect calls
test_rtree(rtree, {19, 19, 51, 51}, rects, {0, 1});
}
TEST_F(DisplayListTest, NestedDisplayListRTreesAreSparse) {
DisplayListBuilder nested_dl_builder(/**prepare_rtree=*/true);
DlOpReceiver& nested_dl_receiver = ToReceiver(nested_dl_builder);
nested_dl_receiver.drawRect({10, 10, 20, 20});
nested_dl_receiver.drawRect({50, 50, 60, 60});
auto nested_display_list = nested_dl_builder.Build();
DisplayListBuilder builder(/**prepare_rtree=*/true);
DlOpReceiver& receiver = ToReceiver(builder);
receiver.drawDisplayList(nested_display_list);
auto display_list = builder.Build();
auto rtree = display_list->rtree();
std::vector<SkRect> rects = {
{10, 10, 20, 20},
{50, 50, 60, 60},
};
// Hitting both sub-dl drawRect calls
test_rtree(rtree, {19, 19, 51, 51}, rects, {0, 1});
}
TEST_F(DisplayListTest, RemoveUnnecessarySaveRestorePairs) {
{
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.drawRect({10, 10, 20, 20});
receiver.save(); // This save op is unnecessary
receiver.drawRect({50, 50, 60, 60});
receiver.restore();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.drawRect({10, 10, 20, 20});
receiver2.drawRect({50, 50, 60, 60});
ASSERT_TRUE(DisplayListsEQ_Verbose(builder.Build(), builder2.Build()));
}
{
DisplayListBuilder builder;
DlOpReceiver& receiver = ToReceiver(builder);
receiver.drawRect({10, 10, 20, 20});
receiver.save();
receiver.translate(1.0, 1.0);
{
receiver.save(); // unnecessary
receiver.drawRect({50, 50, 60, 60});
receiver.restore();
}
receiver.restore();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.drawRect({10, 10, 20, 20});
receiver2.save();
receiver2.translate(1.0, 1.0);
{ receiver2.drawRect({50, 50, 60, 60}); }
receiver2.restore();
ASSERT_TRUE(DisplayListsEQ_Verbose(builder.Build(), builder2.Build()));
}
}
TEST_F(DisplayListTest, CollapseMultipleNestedSaveRestore) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.save();
receiver1.translate(10, 10);
receiver1.scale(2, 2);
receiver1.clipRect({10, 10, 20, 20}, ClipOp::kIntersect, false);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.restore();
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.translate(10, 10);
receiver2.scale(2, 2);
receiver2.clipRect({10, 10, 20, 20}, ClipOp::kIntersect, false);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, CollapseNestedSaveAndSaveLayerRestore) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.saveLayer(nullptr, SaveLayerOptions::kNoAttributes);
receiver1.drawRect({0, 0, 100, 100});
receiver1.scale(2, 2);
receiver1.restore();
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.saveLayer(nullptr, SaveLayerOptions::kNoAttributes);
receiver2.drawRect({0, 0, 100, 100});
receiver2.scale(2, 2);
receiver2.restore();
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, RemoveUnnecessarySaveRestorePairsInSetPaint) {
SkRect build_bounds = SkRect::MakeLTRB(-100, -100, 200, 200);
SkRect rect = SkRect::MakeLTRB(30, 30, 70, 70);
// clang-format off
const float alpha_matrix[] = {
0, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 0, 1,
};
// clang-format on
DlMatrixColorFilter alpha_color_filter(alpha_matrix);
// Making sure hiding a problematic ColorFilter as an ImageFilter
// will generate the same behavior as setting it as a ColorFilter
DlColorFilterImageFilter color_filter_image_filter(alpha_color_filter);
{
DisplayListBuilder builder(build_bounds);
builder.Save();
DlPaint paint;
paint.setImageFilter(&color_filter_image_filter);
builder.DrawRect(rect, paint);
builder.Restore();
sk_sp<DisplayList> display_list1 = builder.Build();
DisplayListBuilder builder2(build_bounds);
DlPaint paint2;
paint2.setImageFilter(&color_filter_image_filter);
builder2.DrawRect(rect, paint2);
sk_sp<DisplayList> display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
{
DisplayListBuilder builder(build_bounds);
builder.Save();
builder.SaveLayer(&build_bounds);
DlPaint paint;
paint.setImageFilter(&color_filter_image_filter);
builder.DrawRect(rect, paint);
builder.Restore();
builder.Restore();
sk_sp<DisplayList> display_list1 = builder.Build();
DisplayListBuilder builder2(build_bounds);
builder2.SaveLayer(&build_bounds);
DlPaint paint2;
paint2.setImageFilter(&color_filter_image_filter);
builder2.DrawRect(rect, paint2);
builder2.Restore();
sk_sp<DisplayList> display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
}
TEST_F(DisplayListTest, TransformTriggersDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.transformFullPerspective(1, 0, 0, 10, //
0, 1, 0, 100, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.transformFullPerspective(1, 0, 0, 10, //
0, 1, 0, 100, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.transformFullPerspective(1, 0, 0, 10, //
0, 1, 0, 100, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
receiver2.save();
receiver2.transformFullPerspective(1, 0, 0, 10, //
0, 1, 0, 100, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, Transform2DTriggersDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.transform2DAffine(0, 1, 12, 1, 0, 33);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.transform2DAffine(0, 1, 12, 1, 0, 33);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, TransformPerspectiveTriggersDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.transformFullPerspective(0, 1, 0, 12, //
1, 0, 0, 33, //
3, 2, 5, 29, //
0, 0, 0, 12);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.transformFullPerspective(0, 1, 0, 12, //
1, 0, 0, 33, //
3, 2, 5, 29, //
0, 0, 0, 12);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, ResetTransformTriggersDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.transformReset();
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.transformReset();
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, SkewTriggersDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.skew(10, 10);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.skew(10, 10);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, TranslateTriggersDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.translate(10, 10);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.translate(10, 10);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, ScaleTriggersDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.scale(0.5, 0.5);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.scale(0.5, 0.5);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, ClipRectTriggersDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.clipRect(SkRect::MakeLTRB(0, 0, 100, 100), ClipOp::kIntersect,
true);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.transformFullPerspective(1, 0, 0, 0, //
0, 1, 0, 0, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.clipRect(SkRect::MakeLTRB(0, 0, 100, 100), ClipOp::kIntersect,
true);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
receiver2.transformFullPerspective(1, 0, 0, 0, //
0, 1, 0, 0, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, ClipRRectTriggersDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.clipRRect(kTestRRect, ClipOp::kIntersect, true);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.transformFullPerspective(1, 0, 0, 0, //
0, 1, 0, 0, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.clipRRect(kTestRRect, ClipOp::kIntersect, true);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
receiver2.transformFullPerspective(1, 0, 0, 0, //
0, 1, 0, 0, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, ClipPathTriggersDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.clipPath(kTestPath1, ClipOp::kIntersect, true);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.transformFullPerspective(1, 0, 0, 0, //
0, 1, 0, 0, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.clipPath(kTestPath1, ClipOp::kIntersect, true);
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
receiver2.transformFullPerspective(1, 0, 0, 0, //
0, 1, 0, 0, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, NOPTranslateDoesNotTriggerDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.translate(0, 0);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.drawRect({0, 0, 100, 100});
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, NOPScaleDoesNotTriggerDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.scale(1.0, 1.0);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.drawRect({0, 0, 100, 100});
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, NOPRotationDoesNotTriggerDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.rotate(360);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.drawRect({0, 0, 100, 100});
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, NOPSkewDoesNotTriggerDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.skew(0, 0);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.drawRect({0, 0, 100, 100});
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, NOPTransformDoesNotTriggerDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.transformFullPerspective(1, 0, 0, 0, //
0, 1, 0, 0, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.transformFullPerspective(1, 0, 0, 0, //
0, 1, 0, 0, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.drawRect({0, 0, 100, 100});
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, NOPTransform2DDoesNotTriggerDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.transform2DAffine(1, 0, 0, 0, 1, 0);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.drawRect({0, 0, 100, 100});
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, NOPTransformFullPerspectiveDoesNotTriggerDeferredSave) {
{
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.transformFullPerspective(1, 0, 0, 0, //
0, 1, 0, 0, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.drawRect({0, 0, 100, 100});
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
{
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.transformFullPerspective(1, 0, 0, 0, //
0, 1, 0, 0, //
0, 0, 1, 0, //
0, 0, 0, 1);
receiver1.transformReset();
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.save();
receiver2.transformReset();
receiver2.drawRect({0, 0, 100, 100});
receiver2.restore();
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
}
TEST_F(DisplayListTest, NOPClipDoesNotTriggerDeferredSave) {
DisplayListBuilder builder1;
DlOpReceiver& receiver1 = ToReceiver(builder1);
receiver1.save();
receiver1.save();
receiver1.clipRect(SkRect::MakeLTRB(0, SK_ScalarNaN, SK_ScalarNaN, 0),
ClipOp::kIntersect, true);
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
receiver1.drawRect({0, 0, 100, 100});
receiver1.restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
DlOpReceiver& receiver2 = ToReceiver(builder2);
receiver2.drawRect({0, 0, 100, 100});
receiver2.drawRect({0, 0, 100, 100});
auto display_list2 = builder2.Build();
ASSERT_TRUE(DisplayListsEQ_Verbose(display_list1, display_list2));
}
TEST_F(DisplayListTest, RTreeOfClippedSaveLayerFilterScene) {
DisplayListBuilder builder(/*prepare_rtree=*/true);
// blur filter with sigma=1 expands by 30 on all sides
auto filter = DlBlurImageFilter(10.0, 10.0, DlTileMode::kClamp);
DlPaint default_paint = DlPaint();
DlPaint filter_paint = DlPaint().setImageFilter(&filter);
builder.DrawRect({10, 10, 20, 20}, default_paint);
builder.ClipRect({50, 50, 60, 60}, ClipOp::kIntersect, false);
builder.SaveLayer(nullptr, &filter_paint);
// the following rectangle will be expanded to 23,23,87,87
// by the saveLayer filter during the restore operation
// but it will then be clipped to 50,50,60,60
builder.DrawRect({53, 53, 57, 57}, default_paint);
builder.Restore();
auto display_list = builder.Build();
auto rtree = display_list->rtree();
std::vector<SkRect> rects = {
{10, 10, 20, 20},
{50, 50, 60, 60},
};
// Missing all drawRect calls
test_rtree(rtree, {5, 5, 10, 10}, rects, {});
test_rtree(rtree, {20, 20, 25, 25}, rects, {});
test_rtree(rtree, {45, 45, 50, 50}, rects, {});
test_rtree(rtree, {60, 60, 65, 65}, rects, {});
// Hitting just 1 of the drawRects
test_rtree(rtree, {5, 5, 11, 11}, rects, {0});
test_rtree(rtree, {19, 19, 25, 25}, rects, {0});
test_rtree(rtree, {45, 45, 51, 51}, rects, {1});
test_rtree(rtree, {59, 59, 65, 65}, rects, {1});
// Hitting both drawRect calls
test_rtree(rtree, {19, 19, 51, 51}, rects, {0, 1});
}
TEST_F(DisplayListTest, RTreeRenderCulling) {
DisplayListBuilder main_builder(true);
DlOpReceiver& main_receiver = ToReceiver(main_builder);
main_receiver.drawRect({0, 0, 10, 10});
main_receiver.drawRect({20, 0, 30, 10});
main_receiver.drawRect({0, 20, 10, 30});
main_receiver.drawRect({20, 20, 30, 30});
auto main = main_builder.Build();
auto test = [main](SkIRect cull_rect, const sk_sp<DisplayList>& expected) {
{ // Test SkIRect culling
DisplayListBuilder culling_builder;
main->Dispatch(ToReceiver(culling_builder), cull_rect);
EXPECT_TRUE(DisplayListsEQ_Verbose(culling_builder.Build(), expected));
}
{ // Test SkRect culling
DisplayListBuilder culling_builder;
main->Dispatch(ToReceiver(culling_builder), SkRect::Make(cull_rect));
EXPECT_TRUE(DisplayListsEQ_Verbose(culling_builder.Build(), expected));
}
};
{ // No rects
SkIRect cull_rect = {11, 11, 19, 19};
DisplayListBuilder expected_builder;
auto expected = expected_builder.Build();
test(cull_rect, expected);
}
{ // Rect 1
SkIRect cull_rect = {9, 9, 19, 19};
DisplayListBuilder expected_builder;
DlOpReceiver& expected_receiver = ToReceiver(expected_builder);
expected_receiver.drawRect({0, 0, 10, 10});
auto expected = expected_builder.Build();
test(cull_rect, expected);
}
{ // Rect 2
SkIRect cull_rect = {11, 9, 21, 19};
DisplayListBuilder expected_builder;
DlOpReceiver& expected_receiver = ToReceiver(expected_builder);
expected_receiver.drawRect({20, 0, 30, 10});
auto expected = expected_builder.Build();
test(cull_rect, expected);
}
{ // Rect 3
SkIRect cull_rect = {9, 11, 19, 21};
DisplayListBuilder expected_builder;
DlOpReceiver& expected_receiver = ToReceiver(expected_builder);
expected_receiver.drawRect({0, 20, 10, 30});
auto expected = expected_builder.Build();
test(cull_rect, expected);
}
{ // Rect 4
SkIRect cull_rect = {11, 11, 21, 21};
DisplayListBuilder expected_builder;
DlOpReceiver& expected_receiver = ToReceiver(expected_builder);
expected_receiver.drawRect({20, 20, 30, 30});
auto expected = expected_builder.Build();
test(cull_rect, expected);
}
{ // All 4 rects
SkIRect cull_rect = {9, 9, 21, 21};
test(cull_rect, main);
}
}
TEST_F(DisplayListTest, DrawSaveDrawCannotInheritOpacity) {
DisplayListBuilder builder;
builder.DrawCircle({10, 10}, 5, DlPaint());
builder.Save();
builder.ClipRect({0, 0, 20, 20}, DlCanvas::ClipOp::kIntersect, false);
builder.DrawRect({5, 5, 15, 15}, DlPaint());
builder.Restore();
auto display_list = builder.Build();
ASSERT_FALSE(display_list->can_apply_group_opacity());
}
TEST_F(DisplayListTest, DrawUnorderedRect) {
auto renderer = [](DlCanvas& canvas, DlPaint& paint, SkRect& rect) {
canvas.DrawRect(rect, paint);
};
check_inverted_bounds(renderer, "DrawRect");
}
TEST_F(DisplayListTest, DrawUnorderedRoundRect) {
auto renderer = [](DlCanvas& canvas, DlPaint& paint, SkRect& rect) {
canvas.DrawRRect(SkRRect::MakeRectXY(rect, 2.0f, 2.0f), paint);
};
check_inverted_bounds(renderer, "DrawRoundRect");
}
TEST_F(DisplayListTest, DrawUnorderedOval) {
auto renderer = [](DlCanvas& canvas, DlPaint& paint, SkRect& rect) {
canvas.DrawOval(rect, paint);
};
check_inverted_bounds(renderer, "DrawOval");
}
TEST_F(DisplayListTest, DrawUnorderedRectangularPath) {
auto renderer = [](DlCanvas& canvas, DlPaint& paint, SkRect& rect) {
canvas.DrawPath(SkPath().addRect(rect), paint);
};
check_inverted_bounds(renderer, "DrawRectangularPath");
}
TEST_F(DisplayListTest, DrawUnorderedOvalPath) {
auto renderer = [](DlCanvas& canvas, DlPaint& paint, SkRect& rect) {
canvas.DrawPath(SkPath().addOval(rect), paint);
};
check_inverted_bounds(renderer, "DrawOvalPath");
}
TEST_F(DisplayListTest, DrawUnorderedRoundRectPathCW) {
auto renderer = [](DlCanvas& canvas, DlPaint& paint, SkRect& rect) {
SkPath path = SkPath() //
.addRoundRect(rect, 2.0f, 2.0f, SkPathDirection::kCW);
canvas.DrawPath(path, paint);
};
check_inverted_bounds(renderer, "DrawRoundRectPath Clockwise");
}
TEST_F(DisplayListTest, DrawUnorderedRoundRectPathCCW) {
auto renderer = [](DlCanvas& canvas, DlPaint& paint, SkRect& rect) {
SkPath path = SkPath() //
.addRoundRect(rect, 2.0f, 2.0f, SkPathDirection::kCCW);
canvas.DrawPath(path, paint);
};
check_inverted_bounds(renderer, "DrawRoundRectPath Counter-Clockwise");
}
TEST_F(DisplayListTest, NopOperationsOmittedFromRecords) {
auto run_tests = [](const std::string& name,
void init(DisplayListBuilder & builder, DlPaint & paint),
uint32_t expected_op_count = 0u) {
auto run_one_test =
[init](const std::string& name,
void build(DisplayListBuilder & builder, DlPaint & paint),
uint32_t expected_op_count = 0u) {
DisplayListBuilder builder;
DlPaint paint;
init(builder, paint);
build(builder, paint);
auto list = builder.Build();
if (list->op_count() != expected_op_count) {
FML_LOG(ERROR) << *list;
}
ASSERT_EQ(list->op_count(), expected_op_count) << name;
ASSERT_TRUE(list->bounds().isEmpty()) << name;
};
run_one_test(
name + " DrawColor",
[](DisplayListBuilder& builder, DlPaint& paint) {
builder.DrawColor(paint.getColor(), paint.getBlendMode());
},
expected_op_count);
run_one_test(
name + " DrawPaint",
[](DisplayListBuilder& builder, DlPaint& paint) {
builder.DrawPaint(paint);
},
expected_op_count);
run_one_test(
name + " DrawRect",
[](DisplayListBuilder& builder, DlPaint& paint) {
builder.DrawRect({10, 10, 20, 20}, paint);
},
expected_op_count);
run_one_test(
name + " Other Draw Ops",
[](DisplayListBuilder& builder, DlPaint& paint) {
builder.DrawLine({10, 10}, {20, 20}, paint);
builder.DrawOval({10, 10, 20, 20}, paint);
builder.DrawCircle({50, 50}, 20, paint);
builder.DrawRRect(SkRRect::MakeRectXY({10, 10, 20, 20}, 5, 5), paint);
builder.DrawDRRect(SkRRect::MakeRectXY({5, 5, 100, 100}, 5, 5),
SkRRect::MakeRectXY({10, 10, 20, 20}, 5, 5),
paint);
builder.DrawPath(kTestPath1, paint);
builder.DrawArc({10, 10, 20, 20}, 45, 90, true, paint);
SkPoint pts[] = {{10, 10}, {20, 20}};
builder.DrawPoints(PointMode::kLines, 2, pts, paint);
builder.DrawVertices(TestVertices1, DlBlendMode::kSrcOver, paint);
builder.DrawImage(TestImage1, {10, 10}, DlImageSampling::kLinear,
&paint);
builder.DrawImageRect(TestImage1, SkRect{0.0f, 0.0f, 10.0f, 10.0f},
SkRect{10.0f, 10.0f, 25.0f, 25.0f},
DlImageSampling::kLinear, &paint);
builder.DrawImageNine(TestImage1, {10, 10, 20, 20},
{10, 10, 100, 100}, DlFilterMode::kLinear,
&paint);
SkRSXform xforms[] = {{1, 0, 10, 10}, {0, 1, 10, 10}};
SkRect rects[] = {{10, 10, 20, 20}, {10, 20, 30, 20}};
builder.DrawAtlas(TestImage1, xforms, rects, nullptr, 2,
DlBlendMode::kSrcOver, DlImageSampling::kLinear,
nullptr, &paint);
builder.DrawTextBlob(GetTestTextBlob(1), 10, 10, paint);
// Dst mode eliminates most rendering ops except for
// the following two, so we'll prune those manually...
if (paint.getBlendMode() != DlBlendMode::kDst) {
builder.DrawDisplayList(TestDisplayList1, paint.getOpacity());
builder.DrawShadow(kTestPath1, paint.getColor(), 1, true, 1);
}
},
expected_op_count);
run_one_test(
name + " SaveLayer",
[](DisplayListBuilder& builder, DlPaint& paint) {
builder.SaveLayer(nullptr, &paint, nullptr);
builder.DrawRect({10, 10, 20, 20}, DlPaint());
builder.Restore();
},
expected_op_count);
run_one_test(
name + " inside Save",
[](DisplayListBuilder& builder, DlPaint& paint) {
builder.Save();
builder.DrawRect({10, 10, 20, 20}, paint);
builder.Restore();
},
expected_op_count);
};
run_tests("transparent color", //
[](DisplayListBuilder& builder, DlPaint& paint) {
paint.setColor(DlColor::kTransparent());
});
run_tests("0 alpha", //
[](DisplayListBuilder& builder, DlPaint& paint) {
// The transparent test above already tested transparent
// black (all 0s), we set White color here so we can test
// the case of all 1s with a 0 alpha
paint.setColor(DlColor::kWhite());
paint.setAlpha(0);
});
run_tests("BlendMode::kDst", //
[](DisplayListBuilder& builder, DlPaint& paint) {
paint.setBlendMode(DlBlendMode::kDst);
});
run_tests("Empty rect clip", //
[](DisplayListBuilder& builder, DlPaint& paint) {
builder.ClipRect(SkRect::MakeEmpty(), ClipOp::kIntersect, false);
});
run_tests("Empty rrect clip", //
[](DisplayListBuilder& builder, DlPaint& paint) {
builder.ClipRRect(SkRRect::MakeEmpty(), ClipOp::kIntersect,
false);
});
run_tests("Empty path clip", //
[](DisplayListBuilder& builder, DlPaint& paint) {
builder.ClipPath(SkPath(), ClipOp::kIntersect, false);
});
run_tests("Transparent SaveLayer", //
[](DisplayListBuilder& builder, DlPaint& paint) {
DlPaint save_paint;
save_paint.setColor(DlColor::kTransparent());
builder.SaveLayer(nullptr, &save_paint);
});
run_tests("0 alpha SaveLayer", //
[](DisplayListBuilder& builder, DlPaint& paint) {
DlPaint save_paint;
// The transparent test above already tested transparent
// black (all 0s), we set White color here so we can test
// the case of all 1s with a 0 alpha
save_paint.setColor(DlColor::kWhite());
save_paint.setAlpha(0);
builder.SaveLayer(nullptr, &save_paint);
});
run_tests("Dst blended SaveLayer", //
[](DisplayListBuilder& builder, DlPaint& paint) {
DlPaint save_paint;
save_paint.setBlendMode(DlBlendMode::kDst);
builder.SaveLayer(nullptr, &save_paint);
});
run_tests(
"Nop inside SaveLayer",
[](DisplayListBuilder& builder, DlPaint& paint) {
builder.SaveLayer(nullptr, nullptr);
paint.setBlendMode(DlBlendMode::kDst);
},
2u);
run_tests("DrawImage inside Culled SaveLayer", //
[](DisplayListBuilder& builder, DlPaint& paint) {
DlPaint save_paint;
save_paint.setColor(DlColor::kTransparent());
builder.SaveLayer(nullptr, &save_paint);
builder.DrawImage(TestImage1, {10, 10}, DlImageSampling::kLinear);
});
}
TEST_F(DisplayListTest, ImpellerPathPreferenceIsHonored) {
class Tester : virtual public DlOpReceiver,
public IgnoreClipDispatchHelper,
public IgnoreDrawDispatchHelper,
public IgnoreAttributeDispatchHelper,
public IgnoreTransformDispatchHelper {
public:
explicit Tester(bool prefer_impeller_paths)
: prefer_impeller_paths_(prefer_impeller_paths) {}
bool PrefersImpellerPaths() const override {
return prefer_impeller_paths_;
}
void drawPath(const SkPath& path) override { skia_draw_path_calls_++; }
void drawPath(const CacheablePath& cache) override {
impeller_draw_path_calls_++;
}
void clipPath(const SkPath& path, ClipOp op, bool is_aa) override {
skia_clip_path_calls_++;
}
void clipPath(const CacheablePath& cache, ClipOp op, bool is_aa) override {
impeller_clip_path_calls_++;
}
virtual void drawShadow(const SkPath& sk_path,
const DlColor color,
const SkScalar elevation,
bool transparent_occluder,
SkScalar dpr) override {
skia_draw_shadow_calls_++;
}
virtual void drawShadow(const CacheablePath& cache,
const DlColor color,
const SkScalar elevation,
bool transparent_occluder,
SkScalar dpr) override {
impeller_draw_shadow_calls_++;
}
int skia_draw_path_calls() const { return skia_draw_path_calls_; }
int skia_clip_path_calls() const { return skia_draw_path_calls_; }
int skia_draw_shadow_calls() const { return skia_draw_path_calls_; }
int impeller_draw_path_calls() const { return impeller_draw_path_calls_; }
int impeller_clip_path_calls() const { return impeller_draw_path_calls_; }
int impeller_draw_shadow_calls() const { return impeller_draw_path_calls_; }
private:
const bool prefer_impeller_paths_;
int skia_draw_path_calls_ = 0;
int skia_clip_path_calls_ = 0;
int skia_draw_shadow_calls_ = 0;
int impeller_draw_path_calls_ = 0;
int impeller_clip_path_calls_ = 0;
int impeller_draw_shadow_calls_ = 0;
};
DisplayListBuilder builder;
builder.DrawPath(SkPath::Rect(SkRect::MakeLTRB(0, 0, 100, 100)), DlPaint());
builder.ClipPath(SkPath::Rect(SkRect::MakeLTRB(0, 0, 100, 100)),
ClipOp::kIntersect, true);
builder.DrawShadow(SkPath::Rect(SkRect::MakeLTRB(20, 20, 80, 80)),
DlColor::kBlue(), 1.0f, true, 1.0f);
auto display_list = builder.Build();
{
Tester skia_tester(false);
display_list->Dispatch(skia_tester);
EXPECT_EQ(skia_tester.skia_draw_path_calls(), 1);
EXPECT_EQ(skia_tester.skia_clip_path_calls(), 1);
EXPECT_EQ(skia_tester.skia_draw_shadow_calls(), 1);
EXPECT_EQ(skia_tester.impeller_draw_path_calls(), 0);
EXPECT_EQ(skia_tester.impeller_clip_path_calls(), 0);
EXPECT_EQ(skia_tester.impeller_draw_shadow_calls(), 0);
}
{
Tester impeller_tester(true);
display_list->Dispatch(impeller_tester);
EXPECT_EQ(impeller_tester.skia_draw_path_calls(), 0);
EXPECT_EQ(impeller_tester.skia_clip_path_calls(), 0);
EXPECT_EQ(impeller_tester.skia_draw_shadow_calls(), 0);
EXPECT_EQ(impeller_tester.impeller_draw_path_calls(), 1);
EXPECT_EQ(impeller_tester.impeller_clip_path_calls(), 1);
EXPECT_EQ(impeller_tester.impeller_draw_shadow_calls(), 1);
}
}
class SaveLayerBoundsExpector : public virtual DlOpReceiver,
public IgnoreAttributeDispatchHelper,
public IgnoreClipDispatchHelper,
public IgnoreTransformDispatchHelper,
public IgnoreDrawDispatchHelper {
public:
explicit SaveLayerBoundsExpector() {}
SaveLayerBoundsExpector& addComputedExpectation(const SkRect& bounds) {
expected_.emplace_back(BoundsExpectation{
.bounds = bounds,
.options = SaveLayerOptions(),
});
return *this;
}
SaveLayerBoundsExpector& addSuppliedExpectation(const SkRect& bounds,
bool clipped = false) {
SaveLayerOptions options;
options = options.with_bounds_from_caller();
if (clipped) {
options = options.with_content_is_clipped();
}
expected_.emplace_back(BoundsExpectation{
.bounds = bounds,
.options = options,
});
return *this;
}
void saveLayer(const SkRect& bounds,
const SaveLayerOptions options,
const DlImageFilter* backdrop) override {
ASSERT_LT(save_layer_count_, expected_.size());
auto expected = expected_[save_layer_count_];
EXPECT_EQ(options.bounds_from_caller(),
expected.options.bounds_from_caller())
<< "expected bounds index " << save_layer_count_;
EXPECT_EQ(options.content_is_clipped(),
expected.options.content_is_clipped())
<< "expected bounds index " << save_layer_count_;
if (!SkScalarNearlyEqual(bounds.fLeft, expected.bounds.fLeft) ||
!SkScalarNearlyEqual(bounds.fTop, expected.bounds.fTop) ||
!SkScalarNearlyEqual(bounds.fRight, expected.bounds.fRight) ||
!SkScalarNearlyEqual(bounds.fBottom, expected.bounds.fBottom)) {
EXPECT_EQ(bounds, expected.bounds)
<< "expected bounds index " << save_layer_count_;
}
save_layer_count_++;
}
bool all_bounds_checked() const {
return save_layer_count_ == expected_.size();
}
private:
struct BoundsExpectation {
const SkRect bounds;
const SaveLayerOptions options;
};
std::vector<BoundsExpectation> expected_;
size_t save_layer_count_ = 0;
};
TEST_F(DisplayListTest, SaveLayerBoundsComputationOfSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DisplayListBuilder builder;
builder.SaveLayer(nullptr, nullptr);
{ //
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsComputationOfMaskBlurredRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DlPaint draw_paint;
auto mask_filter = DlBlurMaskFilter::Make(DlBlurStyle::kNormal, 2.0f);
draw_paint.setMaskFilter(mask_filter);
DisplayListBuilder builder;
builder.SaveLayer(nullptr, nullptr);
{ //
builder.DrawRect(rect, draw_paint);
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect.makeOutset(6.0f, 6.0f));
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsComputationOfImageBlurredRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DlPaint draw_paint;
auto image_filter = DlBlurImageFilter::Make(2.0f, 3.0f, DlTileMode::kDecal);
draw_paint.setImageFilter(image_filter);
DisplayListBuilder builder;
builder.SaveLayer(nullptr, nullptr);
{ //
builder.DrawRect(rect, draw_paint);
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect.makeOutset(6.0f, 9.0f));
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsComputationOfStrokedRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DlPaint draw_paint;
draw_paint.setStrokeWidth(5.0f);
draw_paint.setDrawStyle(DlDrawStyle::kStroke);
DisplayListBuilder builder;
builder.SaveLayer(nullptr, nullptr);
{ //
builder.DrawRect(rect, draw_paint);
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect.makeOutset(2.5f, 2.5f));
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, TranslatedSaveLayerBoundsComputationOfSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DisplayListBuilder builder;
builder.Translate(10.0f, 10.0f);
builder.SaveLayer(nullptr, nullptr);
{ //
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, ScaledSaveLayerBoundsComputationOfSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DisplayListBuilder builder;
builder.Scale(10.0f, 10.0f);
builder.SaveLayer(nullptr, nullptr);
{ //
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, RotatedSaveLayerBoundsComputationOfSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DisplayListBuilder builder;
builder.Rotate(45.0f);
builder.SaveLayer(nullptr, nullptr);
{ //
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, TransformResetSaveLayerBoundsComputationOfSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
SkRect rect_doubled = SkMatrix::Scale(2.0f, 2.0f).mapRect(rect);
DisplayListBuilder builder;
builder.Scale(10.0f, 10.0f);
builder.SaveLayer(nullptr, nullptr);
builder.TransformReset();
builder.Scale(20.0f, 20.0f);
// Net local transform for saveLayer is Scale(2, 2)
{ //
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect_doubled);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsComputationOfTranslatedSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DisplayListBuilder builder;
builder.SaveLayer(nullptr, nullptr);
{ //
builder.Translate(10.0f, 10.0f);
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect.makeOffset(10.0f, 10.0f));
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsComputationOfScaledSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DisplayListBuilder builder;
builder.SaveLayer(nullptr, nullptr);
{ //
builder.Scale(10.0f, 10.0f);
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(
SkRect::MakeLTRB(1000.0f, 1000.0f, 2000.0f, 2000.0f));
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsComputationOfRotatedSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DisplayListBuilder builder;
builder.SaveLayer(nullptr, nullptr);
{ //
builder.Rotate(45.0f);
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
SkMatrix matrix = SkMatrix::RotateDeg(45.0f);
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(matrix.mapRect(rect));
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsComputationOfNestedSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DisplayListBuilder builder;
builder.SaveLayer(nullptr, nullptr);
{ //
builder.SaveLayer(nullptr, nullptr);
{ //
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect);
expector.addComputedExpectation(rect);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, FloodingSaveLayerBoundsComputationOfSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DlPaint save_paint;
auto color_filter =
DlBlendColorFilter::Make(DlColor::kRed(), DlBlendMode::kSrc);
ASSERT_TRUE(color_filter->modifies_transparent_black());
save_paint.setColorFilter(color_filter);
SkRect clip_rect = rect.makeOutset(100.0f, 100.0f);
ASSERT_NE(clip_rect, rect);
ASSERT_TRUE(clip_rect.contains(rect));
DisplayListBuilder builder;
builder.ClipRect(clip_rect);
builder.SaveLayer(nullptr, &save_paint);
{ //
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, NestedFloodingSaveLayerBoundsComputationOfSimpleRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DlPaint save_paint;
auto color_filter =
DlBlendColorFilter::Make(DlColor::kRed(), DlBlendMode::kSrc);
ASSERT_TRUE(color_filter->modifies_transparent_black());
save_paint.setColorFilter(color_filter);
SkRect clip_rect = rect.makeOutset(100.0f, 100.0f);
ASSERT_NE(clip_rect, rect);
ASSERT_TRUE(clip_rect.contains(rect));
DisplayListBuilder builder;
builder.ClipRect(clip_rect);
builder.SaveLayer(nullptr, nullptr);
{
builder.SaveLayer(nullptr, &save_paint);
{ //
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(clip_rect);
expector.addComputedExpectation(rect);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsComputationOfFloodingImageFilter) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DlPaint draw_paint;
auto color_filter =
DlBlendColorFilter::Make(DlColor::kRed(), DlBlendMode::kSrc);
ASSERT_TRUE(color_filter->modifies_transparent_black());
auto image_filter = DlColorFilterImageFilter::Make(color_filter);
draw_paint.setImageFilter(image_filter);
SkRect clip_rect = rect.makeOutset(100.0f, 100.0f);
ASSERT_NE(clip_rect, rect);
ASSERT_TRUE(clip_rect.contains(rect));
DisplayListBuilder builder;
builder.ClipRect(clip_rect);
builder.SaveLayer(nullptr, nullptr);
{ //
builder.DrawRect(rect, draw_paint);
}
builder.Restore();
auto display_list = builder.Build();
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(clip_rect);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsComputationOfFloodingColorFilter) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
DlPaint draw_paint;
auto color_filter =
DlBlendColorFilter::Make(DlColor::kRed(), DlBlendMode::kSrc);
ASSERT_TRUE(color_filter->modifies_transparent_black());
draw_paint.setColorFilter(color_filter);
SkRect clip_rect = rect.makeOutset(100.0f, 100.0f);
ASSERT_NE(clip_rect, rect);
ASSERT_TRUE(clip_rect.contains(rect));
DisplayListBuilder builder;
builder.ClipRect(clip_rect);
builder.SaveLayer(nullptr, nullptr);
{ //
builder.DrawRect(rect, draw_paint);
}
builder.Restore();
auto display_list = builder.Build();
// A color filter is implicitly clipped to the draw bounds so the layer
// bounds will be the same as the draw bounds.
SaveLayerBoundsExpector expector;
expector.addComputedExpectation(rect);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsClipDetectionSimpleUnclippedRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
SkRect save_rect = SkRect::MakeLTRB(50.0f, 50.0f, 250.0f, 250.0f);
DisplayListBuilder builder;
builder.SaveLayer(&save_rect, nullptr);
{ //
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
// A color filter is implicitly clipped to the draw bounds so the layer
// bounds will be the same as the draw bounds.
SaveLayerBoundsExpector expector;
expector.addSuppliedExpectation(rect);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
TEST_F(DisplayListTest, SaveLayerBoundsClipDetectionSimpleClippedRect) {
SkRect rect = SkRect::MakeLTRB(100.0f, 100.0f, 200.0f, 200.0f);
SkRect save_rect = SkRect::MakeLTRB(50.0f, 50.0f, 110.0f, 110.0f);
SkRect content_rect = SkRect::MakeLTRB(100.0f, 100.0f, 110.0f, 110.0f);
DisplayListBuilder builder;
builder.SaveLayer(&save_rect, nullptr);
{ //
builder.DrawRect(rect, DlPaint());
}
builder.Restore();
auto display_list = builder.Build();
// A color filter is implicitly clipped to the draw bounds so the layer
// bounds will be the same as the draw bounds.
SaveLayerBoundsExpector expector;
expector.addSuppliedExpectation(content_rect, true);
display_list->Dispatch(expector);
EXPECT_TRUE(expector.all_bounds_checked());
}
} // namespace testing
} // namespace flutter
| engine/display_list/display_list_unittests.cc/0 | {
"file_path": "engine/display_list/display_list_unittests.cc",
"repo_id": "engine",
"token_count": 58196
} | 203 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/display_list/dl_paint.h"
namespace flutter {
DlPaint::DlPaint(DlColor color)
: blend_mode_(static_cast<unsigned>(DlBlendMode::kDefaultMode)),
draw_style_(static_cast<unsigned>(DlDrawStyle::kDefaultStyle)),
stroke_cap_(static_cast<unsigned>(DlStrokeCap::kDefaultCap)),
stroke_join_(static_cast<unsigned>(DlStrokeJoin::kDefaultJoin)),
is_anti_alias_(false),
is_invert_colors_(false),
color_(color),
stroke_width_(kDefaultWidth),
stroke_miter_(kDefaultMiter) {}
bool DlPaint::operator==(DlPaint const& other) const {
return blend_mode_ == other.blend_mode_ && //
draw_style_ == other.draw_style_ && //
stroke_cap_ == other.stroke_cap_ && //
stroke_join_ == other.stroke_join_ && //
is_anti_alias_ == other.is_anti_alias_ && //
is_invert_colors_ == other.is_invert_colors_ && //
color_ == other.color_ && //
stroke_width_ == other.stroke_width_ && //
stroke_miter_ == other.stroke_miter_ && //
Equals(color_source_, other.color_source_) && //
Equals(color_filter_, other.color_filter_) && //
Equals(image_filter_, other.image_filter_) && //
Equals(mask_filter_, other.mask_filter_) && //
Equals(path_effect_, other.path_effect_);
}
const DlPaint DlPaint::kDefault;
} // namespace flutter
| engine/display_list/dl_paint.cc/0 | {
"file_path": "engine/display_list/dl_paint.cc",
"repo_id": "engine",
"token_count": 749
} | 204 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/display_list/dl_blend_mode.h"
#include "flutter/display_list/dl_color.h"
#include "flutter/display_list/dl_sampling_options.h"
#include "flutter/display_list/dl_tile_mode.h"
#include "flutter/display_list/effects/dl_color_filter.h"
#include "flutter/display_list/effects/dl_image_filter.h"
#include "flutter/display_list/testing/dl_test_equality.h"
#include "flutter/display_list/utils/dl_comparable.h"
#include "gtest/gtest.h"
#include "third_party/skia/include/core/SkBlendMode.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkSamplingOptions.h"
#include "third_party/skia/include/effects/SkImageFilters.h"
namespace flutter {
namespace testing {
// SkRect::contains treats the rect as a half-open interval which is
// appropriate for so many operations. Unfortunately, we are using
// it here to test containment of the corners of a transformed quad
// so the corners of the quad that are measured against the right
// and bottom edges are contained even if they are on the right or
// bottom edge. This method does the "all sides inclusive" version
// of SkRect::contains.
static bool containsInclusive(const SkRect rect, const SkPoint p) {
// Test with a slight offset of 1E-9 to "forgive" IEEE bit-rounding
// Ending up with bounds that are off by 1E-9 (these numbers are all
// being tested in device space with this method) will be off by a
// negligible amount of a pixel that wouldn't contribute to changing
// the color of a pixel.
return (p.fX >= rect.fLeft - 1E-9 && //
p.fX <= rect.fRight + 1E-9 && //
p.fY >= rect.fTop - 1E-9 && //
p.fY <= rect.fBottom + 1E-9);
}
static bool containsInclusive(const SkRect rect, const SkPoint quad[4]) {
return (containsInclusive(rect, quad[0]) && //
containsInclusive(rect, quad[1]) && //
containsInclusive(rect, quad[2]) && //
containsInclusive(rect, quad[3]));
}
static bool containsInclusive(const SkIRect rect, const SkPoint quad[4]) {
return containsInclusive(SkRect::Make(rect), quad);
}
static bool containsInclusive(const SkIRect rect, const SkRect bounds) {
return (bounds.fLeft >= rect.fLeft - 1E-9 &&
bounds.fTop >= rect.fTop - 1E-9 &&
bounds.fRight <= rect.fRight + 1E-9 &&
bounds.fBottom <= rect.fBottom + 1E-9);
}
// Used to verify that the expected output bounds and reverse-engineered
// "input bounds for output bounds" rectangles are included in the rectangle
// returned from the various bounds computation methods under the specified
// matrix.
static void TestBoundsWithMatrix(const DlImageFilter& filter,
const SkMatrix& matrix,
const SkRect& sourceBounds,
const SkPoint expectedLocalOutputQuad[4]) {
SkRect device_input_bounds = matrix.mapRect(sourceBounds);
SkPoint expected_output_quad[4];
matrix.mapPoints(expected_output_quad, expectedLocalOutputQuad, 4);
SkIRect device_filter_ibounds;
ASSERT_EQ(filter.map_device_bounds(device_input_bounds.roundOut(), matrix,
device_filter_ibounds),
&device_filter_ibounds);
ASSERT_TRUE(containsInclusive(device_filter_ibounds, expected_output_quad));
SkIRect reverse_input_ibounds;
ASSERT_EQ(filter.get_input_device_bounds(device_filter_ibounds, matrix,
reverse_input_ibounds),
&reverse_input_ibounds);
ASSERT_TRUE(containsInclusive(reverse_input_ibounds, device_input_bounds));
}
static void TestInvalidBounds(const DlImageFilter& filter,
const SkMatrix& matrix,
const SkRect& localInputBounds) {
SkIRect device_input_bounds = matrix.mapRect(localInputBounds).roundOut();
SkRect local_filter_bounds;
ASSERT_EQ(filter.map_local_bounds(localInputBounds, local_filter_bounds),
nullptr);
ASSERT_EQ(local_filter_bounds, localInputBounds);
SkIRect device_filter_ibounds;
ASSERT_EQ(filter.map_device_bounds(device_input_bounds, matrix,
device_filter_ibounds),
nullptr);
ASSERT_EQ(device_filter_ibounds, device_input_bounds);
SkIRect reverse_input_ibounds;
ASSERT_EQ(filter.get_input_device_bounds(device_input_bounds, matrix,
reverse_input_ibounds),
nullptr);
ASSERT_EQ(reverse_input_ibounds, device_input_bounds);
}
// localInputBounds is a sample bounds for testing as input to the filter.
// localExpectOutputBounds is the theoretical output bounds for applying
// the filter to the localInputBounds.
// localExpectInputBounds is the theoretical input bounds required for the
// filter to cover the localExpectOutputBounds
// If either of the expected bounds are nullptr then the bounds methods will
// be assumed to be unable to perform their computations for the given
// image filter and will be returning null.
static void TestBounds(const DlImageFilter& filter,
const SkRect& sourceBounds,
const SkPoint expectedLocalOutputQuad[4]) {
SkRect local_filter_bounds;
ASSERT_EQ(filter.map_local_bounds(sourceBounds, local_filter_bounds),
&local_filter_bounds);
ASSERT_TRUE(containsInclusive(local_filter_bounds, expectedLocalOutputQuad));
for (int scale = 1; scale <= 4; scale++) {
for (int skew = 0; skew < 8; skew++) {
for (int degrees = 0; degrees <= 360; degrees += 15) {
SkMatrix matrix;
matrix.setScale(scale, scale);
matrix.postSkew(skew / 8.0, skew / 8.0);
matrix.postRotate(degrees);
ASSERT_TRUE(matrix.invert(nullptr));
TestBoundsWithMatrix(filter, matrix, sourceBounds,
expectedLocalOutputQuad);
matrix.setPerspX(0.001);
matrix.setPerspY(0.001);
ASSERT_TRUE(matrix.invert(nullptr));
TestBoundsWithMatrix(filter, matrix, sourceBounds,
expectedLocalOutputQuad);
}
}
}
}
static void TestBounds(const DlImageFilter& filter,
const SkRect& sourceBounds,
const SkRect& expectedLocalOutputBounds) {
SkPoint expected_local_output_quad[4];
expectedLocalOutputBounds.toQuad(expected_local_output_quad);
TestBounds(filter, sourceBounds, expected_local_output_quad);
}
TEST(DisplayListImageFilter, BlurConstructor) {
DlBlurImageFilter filter(5.0, 6.0, DlTileMode::kMirror);
}
TEST(DisplayListImageFilter, BlurShared) {
DlBlurImageFilter filter(5.0, 6.0, DlTileMode::kMirror);
ASSERT_NE(filter.shared().get(), &filter);
ASSERT_EQ(*filter.shared(), filter);
}
TEST(DisplayListImageFilter, BlurAsBlur) {
DlBlurImageFilter filter(5.0, 6.0, DlTileMode::kMirror);
ASSERT_NE(filter.asBlur(), nullptr);
ASSERT_EQ(filter.asBlur(), &filter);
}
TEST(DisplayListImageFilter, BlurContents) {
DlBlurImageFilter filter(5.0, 6.0, DlTileMode::kMirror);
ASSERT_EQ(filter.sigma_x(), 5.0);
ASSERT_EQ(filter.sigma_y(), 6.0);
ASSERT_EQ(filter.tile_mode(), DlTileMode::kMirror);
}
TEST(DisplayListImageFilter, BlurEquals) {
DlBlurImageFilter filter1(5.0, 6.0, DlTileMode::kMirror);
DlBlurImageFilter filter2(5.0, 6.0, DlTileMode::kMirror);
TestEquals(filter1, filter2);
}
TEST(DisplayListImageFilter, BlurWithLocalMatrixEquals) {
DlBlurImageFilter filter1(5.0, 6.0, DlTileMode::kMirror);
DlBlurImageFilter filter2(5.0, 6.0, DlTileMode::kMirror);
SkMatrix local_matrix = SkMatrix::Translate(10, 10);
TestEquals(*filter1.makeWithLocalMatrix(local_matrix),
*filter2.makeWithLocalMatrix(local_matrix));
}
TEST(DisplayListImageFilter, BlurNotEquals) {
DlBlurImageFilter filter1(5.0, 6.0, DlTileMode::kMirror);
DlBlurImageFilter filter2(7.0, 6.0, DlTileMode::kMirror);
DlBlurImageFilter filter3(5.0, 8.0, DlTileMode::kMirror);
DlBlurImageFilter filter4(5.0, 6.0, DlTileMode::kRepeat);
TestNotEquals(filter1, filter2, "Sigma X differs");
TestNotEquals(filter1, filter3, "Sigma Y differs");
TestNotEquals(filter1, filter4, "Tile Mode differs");
}
TEST(DisplayListImageFilter, BlurBounds) {
DlBlurImageFilter filter = DlBlurImageFilter(5, 10, DlTileMode::kDecal);
SkRect input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
SkRect expected_output_bounds = input_bounds.makeOutset(15, 30);
TestBounds(filter, input_bounds, expected_output_bounds);
}
TEST(DisplayListImageFilter, BlurZeroSigma) {
std::shared_ptr<DlImageFilter> filter =
DlBlurImageFilter::Make(0, 0, DlTileMode::kMirror);
ASSERT_EQ(filter, nullptr);
filter = DlBlurImageFilter::Make(3, SK_ScalarNaN, DlTileMode::kMirror);
ASSERT_EQ(filter, nullptr);
filter = DlBlurImageFilter::Make(SK_ScalarNaN, 3, DlTileMode::kMirror);
ASSERT_EQ(filter, nullptr);
filter =
DlBlurImageFilter::Make(SK_ScalarNaN, SK_ScalarNaN, DlTileMode::kMirror);
ASSERT_EQ(filter, nullptr);
filter = DlBlurImageFilter::Make(3, 0, DlTileMode::kMirror);
ASSERT_NE(filter, nullptr);
filter = DlBlurImageFilter::Make(0, 3, DlTileMode::kMirror);
ASSERT_NE(filter, nullptr);
}
TEST(DisplayListImageFilter, DilateConstructor) {
DlDilateImageFilter filter(5.0, 6.0);
}
TEST(DisplayListImageFilter, DilateShared) {
DlDilateImageFilter filter(5.0, 6.0);
ASSERT_NE(filter.shared().get(), &filter);
ASSERT_EQ(*filter.shared(), filter);
}
TEST(DisplayListImageFilter, DilateAsDilate) {
DlDilateImageFilter filter(5.0, 6.0);
ASSERT_NE(filter.asDilate(), nullptr);
ASSERT_EQ(filter.asDilate(), &filter);
}
TEST(DisplayListImageFilter, DilateContents) {
DlDilateImageFilter filter(5.0, 6.0);
ASSERT_EQ(filter.radius_x(), 5.0);
ASSERT_EQ(filter.radius_y(), 6.0);
}
TEST(DisplayListImageFilter, DilateEquals) {
DlDilateImageFilter filter1(5.0, 6.0);
DlDilateImageFilter filter2(5.0, 6.0);
TestEquals(filter1, filter2);
}
TEST(DisplayListImageFilter, DilateWithLocalMatrixEquals) {
DlDilateImageFilter filter1(5.0, 6.0);
DlDilateImageFilter filter2(5.0, 6.0);
SkMatrix local_matrix = SkMatrix::Translate(10, 10);
TestEquals(*filter1.makeWithLocalMatrix(local_matrix),
*filter2.makeWithLocalMatrix(local_matrix));
}
TEST(DisplayListImageFilter, DilateNotEquals) {
DlDilateImageFilter filter1(5.0, 6.0);
DlDilateImageFilter filter2(7.0, 6.0);
DlDilateImageFilter filter3(5.0, 8.0);
TestNotEquals(filter1, filter2, "Radius X differs");
TestNotEquals(filter1, filter3, "Radius Y differs");
}
TEST(DisplayListImageFilter, DilateBounds) {
DlDilateImageFilter filter = DlDilateImageFilter(5, 10);
SkRect input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
SkRect expected_output_bounds = input_bounds.makeOutset(5, 10);
TestBounds(filter, input_bounds, expected_output_bounds);
}
TEST(DisplayListImageFilter, ErodeConstructor) {
DlErodeImageFilter filter(5.0, 6.0);
}
TEST(DisplayListImageFilter, ErodeShared) {
DlErodeImageFilter filter(5.0, 6.0);
ASSERT_NE(filter.shared().get(), &filter);
ASSERT_EQ(*filter.shared(), filter);
}
TEST(DisplayListImageFilter, ErodeAsErode) {
DlErodeImageFilter filter(5.0, 6.0);
ASSERT_NE(filter.asErode(), nullptr);
ASSERT_EQ(filter.asErode(), &filter);
}
TEST(DisplayListImageFilter, ErodeContents) {
DlErodeImageFilter filter(5.0, 6.0);
ASSERT_EQ(filter.radius_x(), 5.0);
ASSERT_EQ(filter.radius_y(), 6.0);
}
TEST(DisplayListImageFilter, ErodeEquals) {
DlErodeImageFilter filter1(5.0, 6.0);
DlErodeImageFilter filter2(5.0, 6.0);
TestEquals(filter1, filter2);
}
TEST(DisplayListImageFilter, ErodeWithLocalMatrixEquals) {
DlErodeImageFilter filter1(5.0, 6.0);
DlErodeImageFilter filter2(5.0, 6.0);
SkMatrix local_matrix = SkMatrix::Translate(10, 10);
TestEquals(*filter1.makeWithLocalMatrix(local_matrix),
*filter2.makeWithLocalMatrix(local_matrix));
}
TEST(DisplayListImageFilter, ErodeNotEquals) {
DlErodeImageFilter filter1(5.0, 6.0);
DlErodeImageFilter filter2(7.0, 6.0);
DlErodeImageFilter filter3(5.0, 8.0);
TestNotEquals(filter1, filter2, "Radius X differs");
TestNotEquals(filter1, filter3, "Radius Y differs");
}
TEST(DisplayListImageFilter, ErodeBounds) {
DlErodeImageFilter filter = DlErodeImageFilter(5, 10);
SkRect input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
SkRect expected_output_bounds = input_bounds.makeInset(5, 10);
TestBounds(filter, input_bounds, expected_output_bounds);
}
TEST(DisplayListImageFilter, MatrixConstructor) {
DlMatrixImageFilter filter(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
}
TEST(DisplayListImageFilter, MatrixShared) {
DlMatrixImageFilter filter(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
ASSERT_NE(filter.shared().get(), &filter);
ASSERT_EQ(*filter.shared(), filter);
}
TEST(DisplayListImageFilter, MatrixAsMatrix) {
DlMatrixImageFilter filter(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
ASSERT_NE(filter.asMatrix(), nullptr);
ASSERT_EQ(filter.asMatrix(), &filter);
}
TEST(DisplayListImageFilter, MatrixContents) {
SkMatrix matrix = SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1);
DlMatrixImageFilter filter(matrix, DlImageSampling::kLinear);
ASSERT_EQ(filter.matrix(), matrix);
ASSERT_EQ(filter.sampling(), DlImageSampling::kLinear);
}
TEST(DisplayListImageFilter, MatrixEquals) {
SkMatrix matrix = SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1);
DlMatrixImageFilter filter1(matrix, DlImageSampling::kLinear);
DlMatrixImageFilter filter2(matrix, DlImageSampling::kLinear);
TestEquals(filter1, filter2);
}
TEST(DisplayListImageFilter, MatrixWithLocalMatrixEquals) {
SkMatrix matrix = SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1);
DlMatrixImageFilter filter1(matrix, DlImageSampling::kLinear);
DlMatrixImageFilter filter2(matrix, DlImageSampling::kLinear);
SkMatrix local_matrix = SkMatrix::Translate(10, 10);
TestEquals(*filter1.makeWithLocalMatrix(local_matrix),
*filter2.makeWithLocalMatrix(local_matrix));
}
TEST(DisplayListImageFilter, MatrixNotEquals) {
SkMatrix matrix1 = SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1);
SkMatrix matrix2 = SkMatrix::MakeAll(5.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1);
DlMatrixImageFilter filter1(matrix1, DlImageSampling::kLinear);
DlMatrixImageFilter filter2(matrix2, DlImageSampling::kLinear);
DlMatrixImageFilter filter3(matrix1, DlImageSampling::kNearestNeighbor);
TestNotEquals(filter1, filter2, "Matrix differs");
TestNotEquals(filter1, filter3, "Sampling differs");
}
TEST(DisplayListImageFilter, MatrixBounds) {
SkMatrix matrix = SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 7, //
0.0, 0.0, 1);
SkMatrix inverse;
ASSERT_TRUE(matrix.invert(&inverse));
DlMatrixImageFilter filter(matrix, DlImageSampling::kLinear);
SkRect input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
SkPoint expectedOutputQuad[4] = {
{50, 77}, // (20,20) => (20*2 + 10, 20/2 + 20*3 + 7) == (50, 77)
{50, 257}, // (20,80) => (20*2 + 10, 20/2 + 80*3 + 7) == (50, 257)
{170, 287}, // (80,80) => (80*2 + 10, 80/2 + 80*3 + 7) == (170, 287)
{170, 107}, // (80,20) => (80*2 + 10, 80/2 + 20*3 + 7) == (170, 107)
};
TestBounds(filter, input_bounds, expectedOutputQuad);
}
TEST(DisplayListImageFilter, ComposeConstructor) {
DlMatrixImageFilter outer(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
DlBlurImageFilter inner(5.0, 6.0, DlTileMode::kMirror);
DlComposeImageFilter filter(outer, inner);
}
TEST(DisplayListImageFilter, ComposeShared) {
DlMatrixImageFilter outer(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
DlBlurImageFilter inner(5.0, 6.0, DlTileMode::kMirror);
DlComposeImageFilter filter(outer, inner);
ASSERT_NE(filter.shared().get(), &filter);
ASSERT_EQ(*filter.shared(), filter);
}
TEST(DisplayListImageFilter, ComposeAsCompose) {
DlMatrixImageFilter outer(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
DlBlurImageFilter inner(5.0, 6.0, DlTileMode::kMirror);
DlComposeImageFilter filter(outer, inner);
ASSERT_NE(filter.asCompose(), nullptr);
ASSERT_EQ(filter.asCompose(), &filter);
}
TEST(DisplayListImageFilter, ComposeContents) {
DlMatrixImageFilter outer(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
DlBlurImageFilter inner(5.0, 6.0, DlTileMode::kMirror);
DlComposeImageFilter filter(outer, inner);
ASSERT_EQ(*filter.outer().get(), outer);
ASSERT_EQ(*filter.inner().get(), inner);
}
TEST(DisplayListImageFilter, ComposeEquals) {
DlMatrixImageFilter outer1(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
DlBlurImageFilter inner1(5.0, 6.0, DlTileMode::kMirror);
DlComposeImageFilter filter1(outer1, inner1);
DlMatrixImageFilter outer2(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
DlBlurImageFilter inner2(5.0, 6.0, DlTileMode::kMirror);
DlComposeImageFilter filter2(outer1, inner1);
TestEquals(filter1, filter2);
}
TEST(DisplayListImageFilter, ComposeWithLocalMatrixEquals) {
DlMatrixImageFilter outer1(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
DlBlurImageFilter inner1(5.0, 6.0, DlTileMode::kMirror);
DlComposeImageFilter filter1(outer1, inner1);
DlMatrixImageFilter outer2(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
DlBlurImageFilter inner2(5.0, 6.0, DlTileMode::kMirror);
DlComposeImageFilter filter2(outer1, inner1);
SkMatrix local_matrix = SkMatrix::Translate(10, 10);
TestEquals(*filter1.makeWithLocalMatrix(local_matrix),
*filter2.makeWithLocalMatrix(local_matrix));
}
TEST(DisplayListImageFilter, ComposeNotEquals) {
DlMatrixImageFilter outer1(SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
DlBlurImageFilter inner1(5.0, 6.0, DlTileMode::kMirror);
DlMatrixImageFilter outer2(SkMatrix::MakeAll(5.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1),
DlImageSampling::kLinear);
DlBlurImageFilter inner2(7.0, 6.0, DlTileMode::kMirror);
DlComposeImageFilter filter1(outer1, inner1);
DlComposeImageFilter filter2(outer2, inner1);
DlComposeImageFilter filter3(outer1, inner2);
TestNotEquals(filter1, filter2, "Outer differs");
TestNotEquals(filter1, filter3, "Inner differs");
}
TEST(DisplayListImageFilter, ComposeBounds) {
DlDilateImageFilter outer = DlDilateImageFilter(5, 10);
DlBlurImageFilter inner = DlBlurImageFilter(12, 5, DlTileMode::kDecal);
DlComposeImageFilter filter = DlComposeImageFilter(outer, inner);
SkRect input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
SkRect expected_output_bounds =
input_bounds.makeOutset(36, 15).makeOutset(5, 10);
TestBounds(filter, input_bounds, expected_output_bounds);
}
static void TestUnboundedBounds(DlImageFilter& filter,
const SkRect& sourceBounds,
const SkRect& expectedOutputBounds,
const SkRect& expectedInputBounds) {
SkRect bounds;
EXPECT_EQ(filter.map_local_bounds(sourceBounds, bounds), nullptr);
EXPECT_EQ(bounds, expectedOutputBounds);
SkIRect ibounds;
EXPECT_EQ(
filter.map_device_bounds(sourceBounds.roundOut(), SkMatrix::I(), ibounds),
nullptr);
EXPECT_EQ(ibounds, expectedOutputBounds.roundOut());
EXPECT_EQ(filter.get_input_device_bounds(sourceBounds.roundOut(),
SkMatrix::I(), ibounds),
nullptr);
EXPECT_EQ(ibounds, expectedInputBounds.roundOut());
}
TEST(DisplayListImageFilter, ComposeBoundsWithUnboundedInner) {
auto input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
auto expected_bounds = SkRect::MakeLTRB(5, 2, 95, 98);
DlBlendColorFilter color_filter(DlColor::kRed(), DlBlendMode::kSrcOver);
auto outer = DlBlurImageFilter(5.0, 6.0, DlTileMode::kRepeat);
auto inner = DlColorFilterImageFilter(color_filter.shared());
auto composed = DlComposeImageFilter(outer.shared(), inner.shared());
TestUnboundedBounds(composed, input_bounds, expected_bounds, expected_bounds);
}
TEST(DisplayListImageFilter, ComposeBoundsWithUnboundedOuter) {
auto input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
auto expected_bounds = SkRect::MakeLTRB(5, 2, 95, 98);
DlBlendColorFilter color_filter(DlColor::kRed(), DlBlendMode::kSrcOver);
auto outer = DlColorFilterImageFilter(color_filter.shared());
auto inner = DlBlurImageFilter(5.0, 6.0, DlTileMode::kRepeat);
auto composed = DlComposeImageFilter(outer.shared(), inner.shared());
TestUnboundedBounds(composed, input_bounds, expected_bounds, expected_bounds);
}
TEST(DisplayListImageFilter, ComposeBoundsWithUnboundedInnerAndOuter) {
auto input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
auto expected_bounds = input_bounds;
DlBlendColorFilter color_filter1(DlColor::kRed(), DlBlendMode::kSrcOver);
DlBlendColorFilter color_filter2(DlColor::kBlue(), DlBlendMode::kSrcOver);
auto outer = DlColorFilterImageFilter(color_filter1.shared());
auto inner = DlColorFilterImageFilter(color_filter2.shared());
auto composed = DlComposeImageFilter(outer.shared(), inner.shared());
TestUnboundedBounds(composed, input_bounds, expected_bounds, expected_bounds);
}
// See https://github.com/flutter/flutter/issues/108433
TEST(DisplayListImageFilter, Issue108433) {
auto input_bounds = SkIRect::MakeLTRB(20, 20, 80, 80);
auto expected_bounds = SkIRect::MakeLTRB(5, 2, 95, 98);
DlBlendColorFilter dl_color_filter(DlColor::kRed(), DlBlendMode::kSrcOver);
auto dl_outer = DlBlurImageFilter(5.0, 6.0, DlTileMode::kRepeat);
auto dl_inner = DlColorFilterImageFilter(dl_color_filter.shared());
auto dl_compose = DlComposeImageFilter(dl_outer, dl_inner);
SkIRect dl_bounds;
ASSERT_EQ(
dl_compose.map_device_bounds(input_bounds, SkMatrix::I(), dl_bounds),
nullptr);
ASSERT_EQ(dl_bounds, expected_bounds);
}
TEST(DisplayListImageFilter, ColorFilterConstructor) {
DlBlendColorFilter dl_color_filter(DlColor::kRed(), DlBlendMode::kLighten);
DlColorFilterImageFilter filter(dl_color_filter);
}
TEST(DisplayListImageFilter, ColorFilterShared) {
DlBlendColorFilter dl_color_filter(DlColor::kRed(), DlBlendMode::kLighten);
DlColorFilterImageFilter filter(dl_color_filter);
ASSERT_EQ(*filter.shared(), filter);
}
TEST(DisplayListImageFilter, ColorFilterAsColorFilter) {
DlBlendColorFilter dl_color_filter(DlColor::kRed(), DlBlendMode::kLighten);
DlColorFilterImageFilter filter(dl_color_filter);
ASSERT_NE(filter.asColorFilter(), nullptr);
ASSERT_EQ(filter.asColorFilter(), &filter);
}
TEST(DisplayListImageFilter, ColorFilterContents) {
DlBlendColorFilter dl_color_filter(DlColor::kRed(), DlBlendMode::kLighten);
DlColorFilterImageFilter filter(dl_color_filter);
ASSERT_EQ(*filter.color_filter().get(), dl_color_filter);
}
TEST(DisplayListImageFilter, ColorFilterEquals) {
DlBlendColorFilter dl_color_filter1(DlColor::kRed(), DlBlendMode::kLighten);
DlColorFilterImageFilter filter1(dl_color_filter1);
DlBlendColorFilter dl_color_filter2(DlColor::kRed(), DlBlendMode::kLighten);
DlColorFilterImageFilter filter2(dl_color_filter2);
TestEquals(filter1, filter2);
}
TEST(DisplayListImageFilter, ColorFilterWithLocalMatrixEquals) {
DlBlendColorFilter dl_color_filter1(DlColor::kRed(), DlBlendMode::kLighten);
DlColorFilterImageFilter filter1(dl_color_filter1);
DlBlendColorFilter dl_color_filter2(DlColor::kRed(), DlBlendMode::kLighten);
DlColorFilterImageFilter filter2(dl_color_filter2);
SkMatrix local_matrix = SkMatrix::Translate(10, 10);
TestEquals(*filter1.makeWithLocalMatrix(local_matrix),
*filter2.makeWithLocalMatrix(local_matrix));
}
TEST(DisplayListImageFilter, ColorFilterNotEquals) {
DlBlendColorFilter dl_color_filter1(DlColor::kRed(), DlBlendMode::kLighten);
DlColorFilterImageFilter filter1(dl_color_filter1);
DlBlendColorFilter dl_color_filter2(DlColor::kBlue(), DlBlendMode::kLighten);
DlColorFilterImageFilter filter2(dl_color_filter2);
DlBlendColorFilter dl_color_filter3(DlColor::kRed(), DlBlendMode::kDarken);
DlColorFilterImageFilter filter3(dl_color_filter3);
TestNotEquals(filter1, filter2, "Color differs");
TestNotEquals(filter1, filter3, "Blend Mode differs");
}
TEST(DisplayListImageFilter, ColorFilterBounds) {
DlBlendColorFilter dl_color_filter(DlColor::kRed(), DlBlendMode::kSrcIn);
DlColorFilterImageFilter filter(dl_color_filter);
SkRect input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
TestBounds(filter, input_bounds, input_bounds);
}
TEST(DisplayListImageFilter, ColorFilterModifiesTransparencyBounds) {
DlBlendColorFilter dl_color_filter(DlColor::kRed(), DlBlendMode::kSrcOver);
DlColorFilterImageFilter filter(dl_color_filter);
SkRect input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
TestInvalidBounds(filter, SkMatrix::I(), input_bounds);
}
TEST(DisplayListImageFilter, LocalImageFilterBounds) {
auto filter_matrix = SkMatrix::MakeAll(2.0, 0.0, 10, //
0.5, 3.0, 15, //
0.0, 0.0, 1);
std::vector<sk_sp<SkImageFilter>> sk_filters{
SkImageFilters::Blur(5.0, 6.0, SkTileMode::kRepeat, nullptr),
SkImageFilters::ColorFilter(
SkColorFilters::Blend(SK_ColorRED, SkBlendMode::kSrcOver), nullptr),
SkImageFilters::Dilate(5.0, 10.0, nullptr),
SkImageFilters::MatrixTransform(
filter_matrix, SkSamplingOptions(SkFilterMode::kLinear), nullptr),
SkImageFilters::Compose(
SkImageFilters::Blur(5.0, 6.0, SkTileMode::kRepeat, nullptr),
SkImageFilters::ColorFilter(
SkColorFilters::Blend(SK_ColorRED, SkBlendMode::kSrcOver),
nullptr))};
DlBlendColorFilter dl_color_filter(DlColor::kRed(), DlBlendMode::kSrcOver);
std::vector<std::shared_ptr<DlImageFilter>> dl_filters{
std::make_shared<DlBlurImageFilter>(5.0, 6.0, DlTileMode::kRepeat),
std::make_shared<DlColorFilterImageFilter>(dl_color_filter.shared()),
std::make_shared<DlDilateImageFilter>(5, 10),
std::make_shared<DlMatrixImageFilter>(filter_matrix,
DlImageSampling::kLinear),
std::make_shared<DlComposeImageFilter>(
std::make_shared<DlBlurImageFilter>(5.0, 6.0, DlTileMode::kRepeat),
std::make_shared<DlColorFilterImageFilter>(
dl_color_filter.shared()))};
auto persp = SkMatrix::I();
persp.setPerspY(0.001);
std::vector<SkMatrix> matrices = {
SkMatrix::Translate(10.0, 10.0),
SkMatrix::Scale(2.0, 2.0).preTranslate(10.0, 10.0),
SkMatrix::RotateDeg(45).preTranslate(5.0, 5.0), persp};
std::vector<SkMatrix> bounds_matrices{SkMatrix::Translate(5.0, 10.0),
SkMatrix::Scale(2.0, 2.0)};
for (unsigned j = 0; j < matrices.size(); j++) {
DlLocalMatrixImageFilter filter(matrices[j], nullptr);
{
const auto input_bounds = SkRect::MakeLTRB(20, 20, 80, 80);
SkRect output_bounds;
EXPECT_EQ(filter.map_local_bounds(input_bounds, output_bounds),
&output_bounds);
EXPECT_EQ(input_bounds, output_bounds);
}
for (unsigned k = 0; k < bounds_matrices.size(); k++) {
auto& bounds_matrix = bounds_matrices[k];
{
const auto input_bounds = SkIRect::MakeLTRB(20, 20, 80, 80);
SkIRect output_bounds;
EXPECT_EQ(filter.map_device_bounds(input_bounds, bounds_matrix,
output_bounds),
&output_bounds);
EXPECT_EQ(input_bounds, output_bounds);
}
{
const auto output_bounds = SkIRect::MakeLTRB(20, 20, 80, 80);
SkIRect input_bounds;
EXPECT_EQ(filter.get_input_device_bounds(output_bounds, bounds_matrix,
input_bounds),
&input_bounds);
EXPECT_EQ(input_bounds, output_bounds);
}
}
}
for (unsigned i = 0; i < sk_filters.size(); i++) {
for (unsigned j = 0; j < matrices.size(); j++) {
for (unsigned k = 0; k < bounds_matrices.size(); k++) {
auto desc = "filter " + std::to_string(i + 1) //
+ ", filter matrix " + std::to_string(j + 1) //
+ ", bounds matrix " + std::to_string(k + 1);
auto& m = matrices[j];
auto& bounds_matrix = bounds_matrices[k];
auto sk_local_filter = sk_filters[i]->makeWithLocalMatrix(m);
auto dl_local_filter = dl_filters[i]->makeWithLocalMatrix(m);
if (!sk_local_filter || !dl_local_filter) {
// Temporarily relax the equivalence testing to allow Skia to expand
// their behavior. Once the Skia fixes are rolled in, the
// DlImageFilter should adapt to the new rules.
// See https://github.com/flutter/flutter/issues/114723
ASSERT_TRUE(sk_local_filter || !dl_local_filter) << desc;
continue;
}
{
auto input_bounds = SkIRect::MakeLTRB(20, 20, 80, 80);
SkIRect sk_rect, dl_rect;
sk_rect = sk_local_filter->filterBounds(
input_bounds, bounds_matrix,
SkImageFilter::MapDirection::kForward_MapDirection);
if (dl_local_filter->map_device_bounds(input_bounds, bounds_matrix,
dl_rect)) {
ASSERT_EQ(sk_rect, dl_rect) << desc;
} else {
ASSERT_TRUE(dl_local_filter->modifies_transparent_black()) << desc;
ASSERT_FALSE(sk_local_filter->canComputeFastBounds()) << desc;
}
}
{
// Test for: Know the outset bounds to get the inset bounds
// Skia have some bounds calculate error of DilateFilter and
// MatrixFilter
// Skia issue: https://bugs.chromium.org/p/skia/issues/detail?id=13444
// flutter issue: https://github.com/flutter/flutter/issues/108693
if (i == 2 || i == 3) {
continue;
}
auto outset_bounds = SkIRect::MakeLTRB(20, 20, 80, 80);
SkIRect sk_rect, dl_rect;
sk_rect = sk_local_filter->filterBounds(
outset_bounds, bounds_matrix,
SkImageFilter::MapDirection::kReverse_MapDirection);
if (dl_local_filter->get_input_device_bounds(
outset_bounds, bounds_matrix, dl_rect)) {
ASSERT_EQ(sk_rect, dl_rect) << desc;
} else {
ASSERT_TRUE(dl_local_filter->modifies_transparent_black());
ASSERT_FALSE(sk_local_filter->canComputeFastBounds());
}
}
}
}
}
}
} // namespace testing
} // namespace flutter
| engine/display_list/effects/dl_image_filter_unittests.cc/0 | {
"file_path": "engine/display_list/effects/dl_image_filter_unittests.cc",
"repo_id": "engine",
"token_count": 15241
} | 205 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_DISPLAY_LIST_IMAGE_DL_IMAGE_H_
#define FLUTTER_DISPLAY_LIST_IMAGE_DL_IMAGE_H_
#include <memory>
#include <optional>
#include <string>
#include "flutter/fml/macros.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkRefCnt.h"
namespace impeller {
class Texture;
} // namespace impeller
namespace flutter {
//------------------------------------------------------------------------------
/// @brief Represents an image whose allocation is (usually) resident on
/// device memory.
///
/// Since it is usually impossible or expensive to transmute images
/// for one rendering backend to another, these objects are backend
/// specific.
///
class DlImage : public SkRefCnt {
public:
// Describes which GPU context owns this image.
enum class OwningContext { kRaster, kIO };
static sk_sp<DlImage> Make(const SkImage* image);
static sk_sp<DlImage> Make(sk_sp<SkImage> image);
virtual ~DlImage();
//----------------------------------------------------------------------------
/// @brief If this display list image is meant to be used by the Skia
/// backend, an SkImage instance. Null otherwise.
///
/// @return A Skia image instance or null.
///
virtual sk_sp<SkImage> skia_image() const = 0;
//----------------------------------------------------------------------------
/// @brief If this display list image is meant to be used by the Impeller
/// backend, an Impeller texture instance. Null otherwise.
///
/// @return An Impeller texture instance or null.
///
virtual std::shared_ptr<impeller::Texture> impeller_texture() const = 0;
//----------------------------------------------------------------------------
/// @brief If the pixel format of this image ignores alpha, this returns
/// true. This method might conservatively return false when it
/// cannot guarnatee an opaque image, for example when the pixel
/// format of the image supports alpha but the image is made up of
/// entirely opaque pixels.
///
/// @return True if the pixel format of this image ignores alpha.
///
virtual bool isOpaque() const = 0;
virtual bool isTextureBacked() const = 0;
//----------------------------------------------------------------------------
/// @brief If the underlying platform image held by this object has no
/// threading requirements for the release of that image (or if
/// arrangements have already been made to forward that image to
/// the correct thread upon deletion), this method returns true.
///
/// @return True if the underlying image is held in a thread-safe manner.
///
virtual bool isUIThreadSafe() const = 0;
//----------------------------------------------------------------------------
/// @return The dimensions of the pixel grid.
///
virtual SkISize dimensions() const = 0;
//----------------------------------------------------------------------------
/// @return The approximate byte size of the allocation of this image.
/// This takes into account details such as mip-mapping. The
/// allocation is usually resident in device memory.
///
virtual size_t GetApproximateByteSize() const = 0;
//----------------------------------------------------------------------------
/// @return The width of the pixel grid. A convenience method that calls
/// |DlImage::dimensions|.
///
int width() const;
//----------------------------------------------------------------------------
/// @return The height of the pixel grid. A convenience method that calls
/// |DlImage::dimensions|.
///
int height() const;
//----------------------------------------------------------------------------
/// @return The bounds of the pixel grid with 0, 0 as origin. A
/// convenience method that calls |DlImage::dimensions|.
///
SkIRect bounds() const;
//----------------------------------------------------------------------------
/// @return Specifies which context was used to create this image. The
/// image must be collected on the same task runner as its
/// context.
virtual OwningContext owning_context() const { return OwningContext::kIO; }
//----------------------------------------------------------------------------
/// @return An error, if any, that occurred when trying to create the
/// image.
virtual std::optional<std::string> get_error() const;
bool Equals(const DlImage* other) const {
if (!other) {
return false;
}
if (this == other) {
return true;
}
return skia_image() == other->skia_image() &&
impeller_texture() == other->impeller_texture();
}
bool Equals(const DlImage& other) const { return Equals(&other); }
bool Equals(const sk_sp<const DlImage>& other) const {
return Equals(other.get());
}
protected:
DlImage();
};
} // namespace flutter
#endif // FLUTTER_DISPLAY_LIST_IMAGE_DL_IMAGE_H_
| engine/display_list/image/dl_image.h/0 | {
"file_path": "engine/display_list/image/dl_image.h",
"repo_id": "engine",
"token_count": 1610
} | 206 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_DISPLAY_LIST_TESTING_DL_TEST_EQUALITY_H_
#define FLUTTER_DISPLAY_LIST_TESTING_DL_TEST_EQUALITY_H_
#include "flutter/display_list/dl_attributes.h"
#include "flutter/display_list/utils/dl_comparable.h"
#include "gtest/gtest.h"
namespace flutter {
namespace testing {
template <class T>
static void TestEquals(T& source1, T& source2) {
ASSERT_TRUE(source1 == source2);
ASSERT_TRUE(source2 == source1);
ASSERT_FALSE(source1 != source2);
ASSERT_FALSE(source2 != source1);
ASSERT_EQ(source1, source2);
ASSERT_EQ(source2, source1);
ASSERT_TRUE(Equals(&source1, &source2));
ASSERT_TRUE(Equals(&source2, &source1));
}
template <class T>
static void TestNotEquals(T& source1, T& source2, const std::string& label) {
ASSERT_FALSE(source1 == source2) << label;
ASSERT_FALSE(source2 == source1) << label;
ASSERT_TRUE(source1 != source2) << label;
ASSERT_TRUE(source2 != source1) << label;
ASSERT_NE(source1, source2) << label;
ASSERT_NE(source2, source1) << label;
ASSERT_TRUE(NotEquals(&source1, &source2));
ASSERT_TRUE(NotEquals(&source2, &source1));
}
} // namespace testing
} // namespace flutter
#endif // FLUTTER_DISPLAY_LIST_TESTING_DL_TEST_EQUALITY_H_
| engine/display_list/testing/dl_test_equality.h/0 | {
"file_path": "engine/display_list/testing/dl_test_equality.h",
"repo_id": "engine",
"token_count": 528
} | 207 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/display_list/utils/dl_matrix_clip_tracker.h"
#include "gtest/gtest.h"
namespace flutter {
namespace testing {
TEST(DisplayListMatrixClipTracker, Constructor) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
const SkMatrix matrix = SkMatrix::Scale(4, 4);
const SkM44 m44 = SkM44::Scale(4, 4);
const SkRect local_cull_rect = SkRect::MakeLTRB(5, 5, 15, 15);
DisplayListMatrixClipTracker tracker1(cull_rect, matrix);
DisplayListMatrixClipTracker tracker2(cull_rect, m44);
ASSERT_FALSE(tracker1.using_4x4_matrix());
ASSERT_EQ(tracker1.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker1.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker1.matrix_3x3(), matrix);
ASSERT_EQ(tracker1.matrix_4x4(), m44);
ASSERT_FALSE(tracker2.using_4x4_matrix());
ASSERT_EQ(tracker2.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker2.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker2.matrix_3x3(), matrix);
ASSERT_EQ(tracker2.matrix_4x4(), m44);
}
TEST(DisplayListMatrixClipTracker, Constructor4x4) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
// clang-format off
const SkM44 m44 = SkM44(4, 0, 0.5, 0,
0, 4, 0.5, 0,
0, 0, 4.0, 0,
0, 0, 0.0, 1);
// clang-format on
const SkRect local_cull_rect = SkRect::MakeLTRB(5, 5, 15, 15);
DisplayListMatrixClipTracker tracker(cull_rect, m44);
ASSERT_TRUE(tracker.using_4x4_matrix());
ASSERT_EQ(tracker.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker.matrix_4x4(), m44);
}
TEST(DisplayListMatrixClipTracker, TransformTo4x4) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
// clang-format off
const SkM44 m44 = SkM44(4, 0, 0.5, 0,
0, 4, 0.5, 0,
0, 0, 4.0, 0,
0, 0, 0.0, 1);
// clang-format on
const SkRect local_cull_rect = SkRect::MakeLTRB(5, 5, 15, 15);
DisplayListMatrixClipTracker tracker(cull_rect, SkMatrix::I());
ASSERT_FALSE(tracker.using_4x4_matrix());
tracker.transform(m44);
ASSERT_TRUE(tracker.using_4x4_matrix());
ASSERT_EQ(tracker.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker.matrix_4x4(), m44);
}
TEST(DisplayListMatrixClipTracker, SetTo4x4) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
// clang-format off
const SkM44 m44 = SkM44(4, 0, 0.5, 0,
0, 4, 0.5, 0,
0, 0, 4.0, 0,
0, 0, 0.0, 1);
// clang-format on
const SkRect local_cull_rect = SkRect::MakeLTRB(5, 5, 15, 15);
DisplayListMatrixClipTracker tracker(cull_rect, SkMatrix::I());
ASSERT_FALSE(tracker.using_4x4_matrix());
tracker.setTransform(m44);
ASSERT_TRUE(tracker.using_4x4_matrix());
ASSERT_EQ(tracker.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker.matrix_4x4(), m44);
}
TEST(DisplayListMatrixClipTracker, UpgradeTo4x4SaveAndRestore) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
// clang-format off
const SkM44 m44 = SkM44(4, 0, 0.5, 0,
0, 4, 0.5, 0,
0, 0, 4.0, 0,
0, 0, 0.0, 1);
// clang-format on
const SkRect local_cull_rect = SkRect::MakeLTRB(5, 5, 15, 15);
DisplayListMatrixClipTracker tracker(cull_rect, SkMatrix::I());
ASSERT_FALSE(tracker.using_4x4_matrix());
tracker.save();
ASSERT_FALSE(tracker.using_4x4_matrix());
tracker.transform(m44);
ASSERT_TRUE(tracker.using_4x4_matrix());
ASSERT_EQ(tracker.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker.matrix_4x4(), m44);
tracker.restore();
ASSERT_FALSE(tracker.using_4x4_matrix());
ASSERT_EQ(tracker.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker.local_cull_rect(), cull_rect);
ASSERT_EQ(tracker.matrix_4x4(), SkM44());
}
TEST(DisplayListMatrixClipTracker, Translate) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
const SkMatrix matrix = SkMatrix::Scale(4, 4);
const SkM44 m44 = SkM44::Scale(4, 4);
const SkMatrix translated_matrix =
SkMatrix::Concat(matrix, SkMatrix::Translate(5, 1));
const SkM44 translated_m44 = SkM44(translated_matrix);
const SkRect local_cull_rect = SkRect::MakeLTRB(0, 4, 10, 14);
DisplayListMatrixClipTracker tracker1(cull_rect, matrix);
DisplayListMatrixClipTracker tracker2(cull_rect, m44);
tracker1.translate(5, 1);
tracker2.translate(5, 1);
ASSERT_FALSE(tracker1.using_4x4_matrix());
ASSERT_EQ(tracker1.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker1.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker1.matrix_3x3(), translated_matrix);
ASSERT_EQ(tracker1.matrix_4x4(), translated_m44);
ASSERT_FALSE(tracker2.using_4x4_matrix());
ASSERT_EQ(tracker2.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker2.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker2.matrix_3x3(), translated_matrix);
ASSERT_EQ(tracker2.matrix_4x4(), translated_m44);
}
TEST(DisplayListMatrixClipTracker, Scale) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
const SkMatrix matrix = SkMatrix::Scale(4, 4);
const SkM44 m44 = SkM44::Scale(4, 4);
const SkMatrix scaled_matrix =
SkMatrix::Concat(matrix, SkMatrix::Scale(5, 2.5));
const SkM44 scaled_m44 = SkM44(scaled_matrix);
const SkRect local_cull_rect = SkRect::MakeLTRB(1, 2, 3, 6);
DisplayListMatrixClipTracker tracker1(cull_rect, matrix);
DisplayListMatrixClipTracker tracker2(cull_rect, m44);
tracker1.scale(5, 2.5);
tracker2.scale(5, 2.5);
ASSERT_FALSE(tracker1.using_4x4_matrix());
ASSERT_EQ(tracker1.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker1.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker1.matrix_3x3(), scaled_matrix);
ASSERT_EQ(tracker1.matrix_4x4(), scaled_m44);
ASSERT_FALSE(tracker2.using_4x4_matrix());
ASSERT_EQ(tracker2.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker2.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker2.matrix_3x3(), scaled_matrix);
ASSERT_EQ(tracker2.matrix_4x4(), scaled_m44);
}
TEST(DisplayListMatrixClipTracker, Skew) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
const SkMatrix matrix = SkMatrix::Scale(4, 4);
const SkM44 m44 = SkM44::Scale(4, 4);
const SkMatrix skewed_matrix =
SkMatrix::Concat(matrix, SkMatrix::Skew(.25, 0));
const SkM44 skewed_m44 = SkM44(skewed_matrix);
const SkRect local_cull_rect = SkRect::MakeLTRB(1.25, 5, 13.75, 15);
DisplayListMatrixClipTracker tracker1(cull_rect, matrix);
DisplayListMatrixClipTracker tracker2(cull_rect, m44);
tracker1.skew(.25, 0);
tracker2.skew(.25, 0);
ASSERT_FALSE(tracker1.using_4x4_matrix());
ASSERT_EQ(tracker1.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker1.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker1.matrix_3x3(), skewed_matrix);
ASSERT_EQ(tracker1.matrix_4x4(), skewed_m44);
ASSERT_FALSE(tracker2.using_4x4_matrix());
ASSERT_EQ(tracker2.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker2.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker2.matrix_3x3(), skewed_matrix);
ASSERT_EQ(tracker2.matrix_4x4(), skewed_m44);
}
TEST(DisplayListMatrixClipTracker, Rotate) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
const SkMatrix matrix = SkMatrix::Scale(4, 4);
const SkM44 m44 = SkM44::Scale(4, 4);
const SkMatrix rotated_matrix =
SkMatrix::Concat(matrix, SkMatrix::RotateDeg(90));
const SkM44 rotated_m44 = SkM44(rotated_matrix);
const SkRect local_cull_rect = SkRect::MakeLTRB(5, -15, 15, -5);
DisplayListMatrixClipTracker tracker1(cull_rect, matrix);
DisplayListMatrixClipTracker tracker2(cull_rect, m44);
tracker1.rotate(90);
tracker2.rotate(90);
ASSERT_FALSE(tracker1.using_4x4_matrix());
ASSERT_EQ(tracker1.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker1.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker1.matrix_3x3(), rotated_matrix);
ASSERT_EQ(tracker1.matrix_4x4(), rotated_m44);
ASSERT_FALSE(tracker2.using_4x4_matrix());
ASSERT_EQ(tracker2.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker2.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker2.matrix_3x3(), rotated_matrix);
ASSERT_EQ(tracker2.matrix_4x4(), rotated_m44);
}
TEST(DisplayListMatrixClipTracker, Transform2DAffine) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
const SkMatrix matrix = SkMatrix::Scale(4, 4);
const SkM44 m44 = SkM44::Scale(4, 4);
const SkMatrix transformed_matrix =
SkMatrix::Concat(matrix, SkMatrix::MakeAll(2, 0, 5, //
0, 2, 6, //
0, 0, 1));
const SkM44 transformed_m44 = SkM44(transformed_matrix);
const SkRect local_cull_rect = SkRect::MakeLTRB(0, -0.5, 5, 4.5);
DisplayListMatrixClipTracker tracker1(cull_rect, matrix);
DisplayListMatrixClipTracker tracker2(cull_rect, m44);
tracker1.transform2DAffine(2, 0, 5, //
0, 2, 6);
tracker2.transform2DAffine(2, 0, 5, //
0, 2, 6);
ASSERT_FALSE(tracker1.using_4x4_matrix());
ASSERT_EQ(tracker1.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker1.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker1.matrix_3x3(), transformed_matrix);
ASSERT_EQ(tracker1.matrix_4x4(), transformed_m44);
ASSERT_FALSE(tracker2.using_4x4_matrix());
ASSERT_EQ(tracker2.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker2.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker2.matrix_3x3(), transformed_matrix);
ASSERT_EQ(tracker2.matrix_4x4(), transformed_m44);
}
TEST(DisplayListMatrixClipTracker, TransformFullPerspectiveUsing3x3Matrix) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
const SkMatrix matrix = SkMatrix::Scale(4, 4);
const SkM44 m44 = SkM44::Scale(4, 4);
const SkMatrix transformed_matrix =
SkMatrix::Concat(matrix, SkMatrix::MakeAll(2, 0, 5, //
0, 2, 6, //
0, 0, 1));
const SkM44 transformed_m44 = SkM44(transformed_matrix);
const SkRect local_cull_rect = SkRect::MakeLTRB(0, -0.5, 5, 4.5);
DisplayListMatrixClipTracker tracker1(cull_rect, matrix);
DisplayListMatrixClipTracker tracker2(cull_rect, m44);
tracker1.transformFullPerspective(2, 0, 0, 5, //
0, 2, 0, 6, //
0, 0, 1, 0, //
0, 0, 0, 1);
tracker2.transformFullPerspective(2, 0, 0, 5, //
0, 2, 0, 6, //
0, 0, 1, 0, //
0, 0, 0, 1);
ASSERT_FALSE(tracker1.using_4x4_matrix());
ASSERT_EQ(tracker1.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker1.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker1.matrix_3x3(), transformed_matrix);
ASSERT_EQ(tracker1.matrix_4x4(), transformed_m44);
ASSERT_FALSE(tracker2.using_4x4_matrix());
ASSERT_EQ(tracker2.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker2.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker2.matrix_3x3(), transformed_matrix);
ASSERT_EQ(tracker2.matrix_4x4(), transformed_m44);
}
TEST(DisplayListMatrixClipTracker, TransformFullPerspectiveUsing4x4Matrix) {
const SkRect cull_rect = SkRect::MakeLTRB(20, 20, 60, 60);
const SkMatrix matrix = SkMatrix::Scale(4, 4);
const SkM44 m44 = SkM44::Scale(4, 4);
const SkM44 transformed_m44 = SkM44(m44, SkM44(2, 0, 0, 5, //
0, 2, 0, 6, //
0, 0, 1, 7, //
0, 0, 0, 1));
const SkRect local_cull_rect = SkRect::MakeLTRB(0, -0.5, 5, 4.5);
DisplayListMatrixClipTracker tracker1(cull_rect, matrix);
DisplayListMatrixClipTracker tracker2(cull_rect, m44);
tracker1.transformFullPerspective(2, 0, 0, 5, //
0, 2, 0, 6, //
0, 0, 1, 7, //
0, 0, 0, 1);
tracker2.transformFullPerspective(2, 0, 0, 5, //
0, 2, 0, 6, //
0, 0, 1, 7, //
0, 0, 0, 1);
ASSERT_TRUE(tracker1.using_4x4_matrix());
ASSERT_EQ(tracker1.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker1.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker1.matrix_4x4(), transformed_m44);
ASSERT_TRUE(tracker2.using_4x4_matrix());
ASSERT_EQ(tracker2.device_cull_rect(), cull_rect);
ASSERT_EQ(tracker2.local_cull_rect(), local_cull_rect);
ASSERT_EQ(tracker2.matrix_4x4(), transformed_m44);
}
TEST(DisplayListMatrixClipTracker, ClipDifference) {
SkRect cull_rect = SkRect::MakeLTRB(20, 20, 40, 40);
auto non_reducing = [&cull_rect](const SkRect& diff_rect,
const std::string& label) {
{
DisplayListMatrixClipTracker tracker(cull_rect, SkMatrix::I());
tracker.clipRect(diff_rect, DlCanvas::ClipOp::kDifference, false);
ASSERT_EQ(tracker.device_cull_rect(), cull_rect) << label;
}
{
DisplayListMatrixClipTracker tracker(cull_rect, SkMatrix::I());
const SkRRect diff_rrect = SkRRect::MakeRect(diff_rect);
tracker.clipRRect(diff_rrect, DlCanvas::ClipOp::kDifference, false);
ASSERT_EQ(tracker.device_cull_rect(), cull_rect) << label << " (RRect)";
}
{
DisplayListMatrixClipTracker tracker(cull_rect, SkMatrix::I());
const SkPath diff_path = SkPath().addRect(diff_rect);
tracker.clipPath(diff_path, DlCanvas::ClipOp::kDifference, false);
ASSERT_EQ(tracker.device_cull_rect(), cull_rect) << label << " (RRect)";
}
};
auto reducing = [&cull_rect](const SkRect& diff_rect,
const SkRect& result_rect,
const std::string& label) {
ASSERT_TRUE(result_rect.isEmpty() || cull_rect.contains(result_rect));
{
DisplayListMatrixClipTracker tracker(cull_rect, SkMatrix::I());
tracker.clipRect(diff_rect, DlCanvas::ClipOp::kDifference, false);
ASSERT_EQ(tracker.device_cull_rect(), result_rect) << label;
}
{
DisplayListMatrixClipTracker tracker(cull_rect, SkMatrix::I());
const SkRRect diff_rrect = SkRRect::MakeRect(diff_rect);
tracker.clipRRect(diff_rrect, DlCanvas::ClipOp::kDifference, false);
ASSERT_EQ(tracker.device_cull_rect(), result_rect) << label << " (RRect)";
}
{
DisplayListMatrixClipTracker tracker(cull_rect, SkMatrix::I());
const SkPath diff_path = SkPath().addRect(diff_rect);
tracker.clipPath(diff_path, DlCanvas::ClipOp::kDifference, false);
ASSERT_EQ(tracker.device_cull_rect(), result_rect) << label << " (RRect)";
}
};
// Skim the corners and edge
non_reducing(SkRect::MakeLTRB(10, 10, 20, 20), "outside UL corner");
non_reducing(SkRect::MakeLTRB(20, 10, 40, 20), "Above");
non_reducing(SkRect::MakeLTRB(40, 10, 50, 20), "outside UR corner");
non_reducing(SkRect::MakeLTRB(40, 20, 50, 40), "Right");
non_reducing(SkRect::MakeLTRB(40, 40, 50, 50), "outside LR corner");
non_reducing(SkRect::MakeLTRB(20, 40, 40, 50), "Below");
non_reducing(SkRect::MakeLTRB(10, 40, 20, 50), "outside LR corner");
non_reducing(SkRect::MakeLTRB(10, 20, 20, 40), "Left");
// Overlap corners
non_reducing(SkRect::MakeLTRB(15, 15, 25, 25), "covering UL corner");
non_reducing(SkRect::MakeLTRB(35, 15, 45, 25), "covering UR corner");
non_reducing(SkRect::MakeLTRB(35, 35, 45, 45), "covering LR corner");
non_reducing(SkRect::MakeLTRB(15, 35, 25, 45), "covering LL corner");
// Overlap edges, but not across an entire side
non_reducing(SkRect::MakeLTRB(20, 15, 39, 25), "Top edge left-biased");
non_reducing(SkRect::MakeLTRB(21, 15, 40, 25), "Top edge, right biased");
non_reducing(SkRect::MakeLTRB(35, 20, 45, 39), "Right edge, top-biased");
non_reducing(SkRect::MakeLTRB(35, 21, 45, 40), "Right edge, bottom-biased");
non_reducing(SkRect::MakeLTRB(20, 35, 39, 45), "Bottom edge, left-biased");
non_reducing(SkRect::MakeLTRB(21, 35, 40, 45), "Bottom edge, right-biased");
non_reducing(SkRect::MakeLTRB(15, 20, 25, 39), "Left edge, top-biased");
non_reducing(SkRect::MakeLTRB(15, 21, 25, 40), "Left edge, bottom-biased");
// Slice all the way through the middle
non_reducing(SkRect::MakeLTRB(25, 15, 35, 45), "Vertical interior slice");
non_reducing(SkRect::MakeLTRB(15, 25, 45, 35), "Horizontal interior slice");
// Slice off each edge
reducing(SkRect::MakeLTRB(20, 15, 40, 25), //
SkRect::MakeLTRB(20, 25, 40, 40), //
"Slice off top");
reducing(SkRect::MakeLTRB(35, 20, 45, 40), //
SkRect::MakeLTRB(20, 20, 35, 40), //
"Slice off right");
reducing(SkRect::MakeLTRB(20, 35, 40, 45), //
SkRect::MakeLTRB(20, 20, 40, 35), //
"Slice off bottom");
reducing(SkRect::MakeLTRB(15, 20, 25, 40), //
SkRect::MakeLTRB(25, 20, 40, 40), //
"Slice off left");
// cull rect contains diff rect
non_reducing(SkRect::MakeLTRB(21, 21, 39, 39), "Contained, non-covering");
// cull rect equals diff rect
reducing(cull_rect, SkRect::MakeEmpty(), "Perfectly covering");
// diff rect contains cull rect
reducing(SkRect::MakeLTRB(15, 15, 45, 45), SkRect::MakeEmpty(), "Smothering");
}
TEST(DisplayListMatrixClipTracker, ClipPathWithInvertFillType) {
SkRect cull_rect = SkRect::MakeLTRB(0, 0, 100.0, 100.0);
DisplayListMatrixClipTracker builder(cull_rect, SkMatrix::I());
SkPath clip = SkPath().addCircle(10.2, 11.3, 2).addCircle(20.4, 25.7, 2);
clip.setFillType(SkPathFillType::kInverseWinding);
builder.clipPath(clip, DlCanvas::ClipOp::kIntersect, false);
ASSERT_EQ(builder.local_cull_rect(), cull_rect);
ASSERT_EQ(builder.device_cull_rect(), cull_rect);
}
TEST(DisplayListMatrixClipTracker, DiffClipPathWithInvertFillType) {
SkRect cull_rect = SkRect::MakeLTRB(0, 0, 100.0, 100.0);
DisplayListMatrixClipTracker tracker(cull_rect, SkMatrix::I());
SkPath clip = SkPath().addCircle(10.2, 11.3, 2).addCircle(20.4, 25.7, 2);
clip.setFillType(SkPathFillType::kInverseWinding);
SkRect clip_bounds = SkRect::MakeLTRB(8.2, 9.3, 22.4, 27.7);
tracker.clipPath(clip, DlCanvas::ClipOp::kDifference, false);
ASSERT_EQ(tracker.local_cull_rect(), clip_bounds);
ASSERT_EQ(tracker.device_cull_rect(), clip_bounds);
}
} // namespace testing
} // namespace flutter
| engine/display_list/utils/dl_matrix_clip_tracker_unittests.cc/0 | {
"file_path": "engine/display_list/utils/dl_matrix_clip_tracker_unittests.cc",
"repo_id": "engine",
"token_count": 8667
} | 208 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/compositor_context.h"
#include <optional>
#include <utility>
#include "flutter/flow/layers/layer_tree.h"
#include "third_party/skia/include/core/SkCanvas.h"
namespace flutter {
std::optional<SkRect> FrameDamage::ComputeClipRect(
flutter::LayerTree& layer_tree,
bool has_raster_cache,
bool impeller_enabled) {
if (layer_tree.root_layer()) {
PaintRegionMap empty_paint_region_map;
DiffContext context(layer_tree.frame_size(), layer_tree.paint_region_map(),
prev_layer_tree_ ? prev_layer_tree_->paint_region_map()
: empty_paint_region_map,
has_raster_cache, impeller_enabled);
context.PushCullRect(SkRect::MakeIWH(layer_tree.frame_size().width(),
layer_tree.frame_size().height()));
{
DiffContext::AutoSubtreeRestore subtree(&context);
const Layer* prev_root_layer = nullptr;
if (!prev_layer_tree_ ||
prev_layer_tree_->frame_size() != layer_tree.frame_size()) {
// If there is no previous layer tree assume the entire frame must be
// repainted.
context.MarkSubtreeDirty(SkRect::MakeIWH(
layer_tree.frame_size().width(), layer_tree.frame_size().height()));
} else {
prev_root_layer = prev_layer_tree_->root_layer();
}
layer_tree.root_layer()->Diff(&context, prev_root_layer);
}
damage_ =
context.ComputeDamage(additional_damage_, horizontal_clip_alignment_,
vertical_clip_alignment_);
return SkRect::Make(damage_->buffer_damage);
}
return std::nullopt;
}
CompositorContext::CompositorContext()
: texture_registry_(std::make_shared<TextureRegistry>()),
raster_time_(fixed_refresh_rate_updater_),
ui_time_(fixed_refresh_rate_updater_) {}
CompositorContext::CompositorContext(Stopwatch::RefreshRateUpdater& updater)
: texture_registry_(std::make_shared<TextureRegistry>()),
raster_time_(updater),
ui_time_(updater) {}
CompositorContext::~CompositorContext() = default;
void CompositorContext::BeginFrame(ScopedFrame& frame,
bool enable_instrumentation) {
if (enable_instrumentation) {
raster_time_.Start();
}
}
void CompositorContext::EndFrame(ScopedFrame& frame,
bool enable_instrumentation) {
if (enable_instrumentation) {
raster_time_.Stop();
}
}
std::unique_ptr<CompositorContext::ScopedFrame> CompositorContext::AcquireFrame(
GrDirectContext* gr_context,
DlCanvas* canvas,
ExternalViewEmbedder* view_embedder,
const SkMatrix& root_surface_transformation,
bool instrumentation_enabled,
bool surface_supports_readback,
fml::RefPtr<fml::RasterThreadMerger>
raster_thread_merger, // NOLINT(performance-unnecessary-value-param)
impeller::AiksContext* aiks_context) {
return std::make_unique<ScopedFrame>(
*this, gr_context, canvas, view_embedder, root_surface_transformation,
instrumentation_enabled, surface_supports_readback, raster_thread_merger,
aiks_context);
}
CompositorContext::ScopedFrame::ScopedFrame(
CompositorContext& context,
GrDirectContext* gr_context,
DlCanvas* canvas,
ExternalViewEmbedder* view_embedder,
const SkMatrix& root_surface_transformation,
bool instrumentation_enabled,
bool surface_supports_readback,
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger,
impeller::AiksContext* aiks_context)
: context_(context),
gr_context_(gr_context),
canvas_(canvas),
aiks_context_(aiks_context),
view_embedder_(view_embedder),
root_surface_transformation_(root_surface_transformation),
instrumentation_enabled_(instrumentation_enabled),
surface_supports_readback_(surface_supports_readback),
raster_thread_merger_(std::move(raster_thread_merger)) {
context_.BeginFrame(*this, instrumentation_enabled_);
}
CompositorContext::ScopedFrame::~ScopedFrame() {
context_.EndFrame(*this, instrumentation_enabled_);
}
RasterStatus CompositorContext::ScopedFrame::Raster(
flutter::LayerTree& layer_tree,
bool ignore_raster_cache,
FrameDamage* frame_damage) {
TRACE_EVENT0("flutter", "CompositorContext::ScopedFrame::Raster");
std::optional<SkRect> clip_rect;
if (frame_damage) {
clip_rect = frame_damage->ComputeClipRect(layer_tree, !ignore_raster_cache,
!gr_context_);
if (aiks_context_ &&
!ShouldPerformPartialRepaint(clip_rect, layer_tree.frame_size())) {
clip_rect = std::nullopt;
frame_damage->Reset();
}
}
bool root_needs_readback = layer_tree.Preroll(
*this, ignore_raster_cache, clip_rect ? *clip_rect : kGiantRect);
bool needs_save_layer = root_needs_readback && !surface_supports_readback();
PostPrerollResult post_preroll_result = PostPrerollResult::kSuccess;
if (view_embedder_ && raster_thread_merger_) {
post_preroll_result =
view_embedder_->PostPrerollAction(raster_thread_merger_);
}
if (post_preroll_result == PostPrerollResult::kResubmitFrame) {
return RasterStatus::kResubmit;
}
if (post_preroll_result == PostPrerollResult::kSkipAndRetryFrame) {
return RasterStatus::kSkipAndRetry;
}
if (aiks_context_) {
PaintLayerTreeImpeller(layer_tree, clip_rect, ignore_raster_cache);
} else {
PaintLayerTreeSkia(layer_tree, clip_rect, needs_save_layer,
ignore_raster_cache);
}
return RasterStatus::kSuccess;
}
void CompositorContext::ScopedFrame::PaintLayerTreeSkia(
flutter::LayerTree& layer_tree,
std::optional<SkRect> clip_rect,
bool needs_save_layer,
bool ignore_raster_cache) {
DlAutoCanvasRestore restore(canvas(), clip_rect.has_value());
if (canvas()) {
if (clip_rect) {
canvas()->ClipRect(*clip_rect);
}
if (needs_save_layer) {
TRACE_EVENT0("flutter", "Canvas::saveLayer");
SkRect bounds = SkRect::Make(layer_tree.frame_size());
DlPaint paint;
paint.setBlendMode(DlBlendMode::kSrc);
canvas()->SaveLayer(&bounds, &paint);
}
canvas()->Clear(DlColor::kTransparent());
}
// The canvas()->Restore() is taken care of by the DlAutoCanvasRestore
layer_tree.Paint(*this, ignore_raster_cache);
}
void CompositorContext::ScopedFrame::PaintLayerTreeImpeller(
flutter::LayerTree& layer_tree,
std::optional<SkRect> clip_rect,
bool ignore_raster_cache) {
if (canvas() && clip_rect) {
canvas()->Translate(-clip_rect->x(), -clip_rect->y());
}
layer_tree.Paint(*this, ignore_raster_cache);
}
/// @brief The max ratio of pixel width or height to size that is dirty which
/// results in a partial repaint.
///
/// Performing a partial repaint has a small overhead - Impeller needs to
/// allocate a fairly large resolve texture for the root pass instead of
/// using the drawable texture, and a final blit must be performed. At a
/// minimum, if the damage rect is the entire buffer, we must not perform
/// a partial repaint. Beyond that, we could only experimentally
/// determine what this value should be. From looking at the Flutter
/// Gallery, we noticed that there are occassionally small partial
/// repaints which shave off trivial numbers of pixels.
constexpr float kImpellerRepaintRatio = 0.7f;
bool CompositorContext::ShouldPerformPartialRepaint(
std::optional<SkRect> damage_rect,
SkISize layer_tree_size) {
if (!damage_rect.has_value()) {
return false;
}
if (damage_rect->width() >= layer_tree_size.width() &&
damage_rect->height() >= layer_tree_size.height()) {
return false;
}
auto rx = damage_rect->width() / layer_tree_size.width();
auto ry = damage_rect->height() / layer_tree_size.height();
return rx <= kImpellerRepaintRatio || ry <= kImpellerRepaintRatio;
}
void CompositorContext::OnGrContextCreated() {
texture_registry_->OnGrContextCreated();
raster_cache_.Clear();
}
void CompositorContext::OnGrContextDestroyed() {
texture_registry_->OnGrContextDestroyed();
raster_cache_.Clear();
}
} // namespace flutter
| engine/flow/compositor_context.cc/0 | {
"file_path": "engine/flow/compositor_context.cc",
"repo_id": "engine",
"token_count": 3293
} | 209 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLOW_LAYER_SNAPSHOT_STORE_H_
#define FLUTTER_FLOW_LAYER_SNAPSHOT_STORE_H_
#include <vector>
#include "flutter/fml/logging.h"
#include "flutter/fml/time/time_delta.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkRefCnt.h"
namespace flutter {
/// Container for snapshot data pertaining to a given layer. A layer is
/// identified by it's unique id.
class LayerSnapshotData {
public:
LayerSnapshotData(int64_t layer_unique_id,
const fml::TimeDelta& duration,
const sk_sp<SkData>& snapshot,
const SkRect& bounds);
~LayerSnapshotData() = default;
int64_t GetLayerUniqueId() const { return layer_unique_id_; }
fml::TimeDelta GetDuration() const { return duration_; }
sk_sp<SkData> GetSnapshot() const { return snapshot_; }
SkRect GetBounds() const { return bounds_; }
private:
const int64_t layer_unique_id_;
const fml::TimeDelta duration_;
const sk_sp<SkData> snapshot_;
const SkRect bounds_;
};
/// Collects snapshots of layers during frame rasterization.
class LayerSnapshotStore {
public:
typedef std::vector<LayerSnapshotData> Snapshots;
LayerSnapshotStore() = default;
~LayerSnapshotStore() = default;
/// Clears all the stored snapshots.
void Clear();
/// Adds snapshots for a given layer. `duration` marks the time taken to
/// rasterize this one layer.
void Add(const LayerSnapshotData& data);
// Returns the number of snapshots collected.
size_t Size() const { return layer_snapshots_.size(); }
// make this class iterable
Snapshots::iterator begin() { return layer_snapshots_.begin(); }
Snapshots::iterator end() { return layer_snapshots_.end(); }
private:
Snapshots layer_snapshots_;
FML_DISALLOW_COPY_AND_ASSIGN(LayerSnapshotStore);
};
} // namespace flutter
#endif // FLUTTER_FLOW_LAYER_SNAPSHOT_STORE_H_
| engine/flow/layer_snapshot_store.h/0 | {
"file_path": "engine/flow/layer_snapshot_store.h",
"repo_id": "engine",
"token_count": 737
} | 210 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLOW_LAYERS_CLIP_SHAPE_LAYER_H_
#define FLUTTER_FLOW_LAYERS_CLIP_SHAPE_LAYER_H_
#include "flutter/flow/layers/cacheable_layer.h"
#include "flutter/flow/layers/container_layer.h"
#include "flutter/flow/paint_utils.h"
namespace flutter {
template <class T>
class ClipShapeLayer : public CacheableContainerLayer {
public:
using ClipShape = T;
ClipShapeLayer(const ClipShape& clip_shape, Clip clip_behavior)
: CacheableContainerLayer(),
clip_shape_(clip_shape),
clip_behavior_(clip_behavior) {
FML_DCHECK(clip_behavior != Clip::kNone);
}
void Diff(DiffContext* context, const Layer* old_layer) override {
DiffContext::AutoSubtreeRestore subtree(context);
auto* prev = static_cast<const ClipShapeLayer<ClipShape>*>(old_layer);
if (!context->IsSubtreeDirty()) {
FML_DCHECK(prev);
if (clip_behavior_ != prev->clip_behavior_ ||
clip_shape_ != prev->clip_shape_) {
context->MarkSubtreeDirty(context->GetOldLayerPaintRegion(old_layer));
}
}
if (UsesSaveLayer() && context->has_raster_cache()) {
context->WillPaintWithIntegralTransform();
}
if (context->PushCullRect(clip_shape_bounds())) {
DiffChildren(context, prev);
}
context->SetLayerPaintRegion(this, context->CurrentSubtreeRegion());
}
void Preroll(PrerollContext* context) override {
bool uses_save_layer = UsesSaveLayer();
// We can use the raster_cache for children only when the use_save_layer is
// true so if use_save_layer is false we pass the layer_raster_item is
// nullptr which mean we don't do raster cache logic.
AutoCache cache =
AutoCache(uses_save_layer ? layer_raster_cache_item_.get() : nullptr,
context, context->state_stack.transform_3x3());
Layer::AutoPrerollSaveLayerState save =
Layer::AutoPrerollSaveLayerState::Create(context, UsesSaveLayer());
auto mutator = context->state_stack.save();
ApplyClip(mutator);
SkRect child_paint_bounds = SkRect::MakeEmpty();
PrerollChildren(context, &child_paint_bounds);
if (child_paint_bounds.intersect(clip_shape_bounds())) {
set_paint_bounds(child_paint_bounds);
} else {
set_paint_bounds(SkRect::MakeEmpty());
}
// If we use a SaveLayer then we can accept opacity on behalf
// of our children and apply it in the saveLayer.
if (uses_save_layer) {
context->renderable_state_flags = kSaveLayerRenderFlags;
}
}
void Paint(PaintContext& context) const override {
FML_DCHECK(needs_painting(context));
auto mutator = context.state_stack.save();
ApplyClip(mutator);
if (!UsesSaveLayer()) {
PaintChildren(context);
return;
}
if (context.raster_cache) {
mutator.integralTransform();
auto restore_apply = context.state_stack.applyState(
paint_bounds(), LayerStateStack::kCallerCanApplyOpacity);
DlPaint paint;
if (layer_raster_cache_item_->Draw(context,
context.state_stack.fill(paint))) {
return;
}
}
mutator.saveLayer(paint_bounds());
PaintChildren(context);
}
bool UsesSaveLayer() const {
return clip_behavior_ == Clip::kAntiAliasWithSaveLayer;
}
protected:
virtual const SkRect& clip_shape_bounds() const = 0;
virtual void ApplyClip(LayerStateStack::MutatorContext& mutator) const = 0;
virtual ~ClipShapeLayer() = default;
const ClipShape& clip_shape() const { return clip_shape_; }
Clip clip_behavior() const { return clip_behavior_; }
private:
const ClipShape clip_shape_;
Clip clip_behavior_;
FML_DISALLOW_COPY_AND_ASSIGN(ClipShapeLayer);
};
} // namespace flutter
#endif // FLUTTER_FLOW_LAYERS_CLIP_SHAPE_LAYER_H_
| engine/flow/layers/clip_shape_layer.h/0 | {
"file_path": "engine/flow/layers/clip_shape_layer.h",
"repo_id": "engine",
"token_count": 1491
} | 211 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLOW_LAYERS_LAYER_H_
#define FLUTTER_FLOW_LAYERS_LAYER_H_
#include <algorithm>
#include <memory>
#include <unordered_set>
#include <vector>
#include "flutter/common/graphics/texture.h"
#include "flutter/display_list/dl_canvas.h"
#include "flutter/flow/diff_context.h"
#include "flutter/flow/embedded_views.h"
#include "flutter/flow/layer_snapshot_store.h"
#include "flutter/flow/layers/layer_state_stack.h"
#include "flutter/flow/raster_cache.h"
#include "flutter/flow/stopwatch.h"
#include "flutter/fml/build_config.h"
#include "flutter/fml/compiler_specific.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/macros.h"
#include "flutter/fml/trace_event.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkRRect.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/utils/SkNWayCanvas.h"
class GrDirectContext;
namespace flutter {
namespace testing {
class MockLayer;
} // namespace testing
class ContainerLayer;
class DisplayListLayer;
class PerformanceOverlayLayer;
class TextureLayer;
class RasterCacheItem;
static constexpr SkRect kGiantRect = SkRect::MakeLTRB(-1E9F, -1E9F, 1E9F, 1E9F);
// This should be an exact copy of the Clip enum in painting.dart.
enum Clip { kNone, kHardEdge, kAntiAlias, kAntiAliasWithSaveLayer };
struct PrerollContext {
RasterCache* raster_cache;
GrDirectContext* gr_context;
ExternalViewEmbedder* view_embedder;
LayerStateStack& state_stack;
sk_sp<SkColorSpace> dst_color_space;
bool surface_needs_readback;
// These allow us to paint in the end of subtree Preroll.
const Stopwatch& raster_time;
const Stopwatch& ui_time;
std::shared_ptr<TextureRegistry> texture_registry;
// These allow us to track properties like elevation, opacity, and the
// presence of a platform view during Preroll.
bool has_platform_view = false;
// These allow us to track properties like elevation, opacity, and the
// presence of a texture layer during Preroll.
bool has_texture_layer = false;
// The list of flags that describe which rendering state attributes
// (such as opacity, ColorFilter, ImageFilter) a given layer can
// render itself without requiring the parent to perform a protective
// saveLayer with those attributes.
// For containers, the flags will be set to the intersection (logical
// and) of all of the state bits that all of the children can render
// or to 0 if some of the children overlap and, as such, cannot apply
// those attributes individually and separately.
int renderable_state_flags = 0;
std::vector<RasterCacheItem*>* raster_cached_entries;
};
struct PaintContext {
// When splitting the scene into multiple canvases (e.g when embedding
// a platform view on iOS) during the paint traversal we apply any state
// changes which affect children (i.e. saveLayer attributes) to the
// state_stack and any local rendering state changes for leaf layers to
// the canvas or builder.
// When we switch a canvas or builder (when painting a PlatformViewLayer)
// the new canvas receives all of the stateful changes from the state_stack
// to put it into the exact same state that the outgoing canvas had at the
// time it was swapped out.
// The state stack lazily applies saveLayer calls to its current canvas,
// allowing leaf layers to report that they can handle rendering some of
// its state attributes themselves via the |applyState| method.
LayerStateStack& state_stack;
DlCanvas* canvas;
// Whether current canvas is an overlay canvas. Used to determine if the
// raster cache is painting to a surface that will be displayed above a
// platform view, in which case it will attempt to preserve the R-Tree.
bool rendering_above_platform_view = false;
GrDirectContext* gr_context;
sk_sp<SkColorSpace> dst_color_space;
ExternalViewEmbedder* view_embedder;
const Stopwatch& raster_time;
const Stopwatch& ui_time;
std::shared_ptr<TextureRegistry> texture_registry;
const RasterCache* raster_cache;
// Snapshot store to collect leaf layer snapshots. The store is non-null
// only when leaf layer tracing is enabled.
LayerSnapshotStore* layer_snapshot_store = nullptr;
bool enable_leaf_layer_tracing = false;
bool impeller_enabled = false;
impeller::AiksContext* aiks_context;
};
// Represents a single composited layer. Created on the UI thread but then
// subsequently used on the Rasterizer thread.
class Layer {
public:
// The state attribute flags that represent which attributes a
// layer can render if it plans to use a saveLayer call in its
// |Paint| method.
static constexpr int kSaveLayerRenderFlags =
LayerStateStack::kCallerCanApplyOpacity |
LayerStateStack::kCallerCanApplyColorFilter |
LayerStateStack::kCallerCanApplyImageFilter;
// The state attribute flags that represent which attributes a
// layer can render if it will be rendering its content/children
// from a cached representation.
static constexpr int kRasterCacheRenderFlags =
LayerStateStack::kCallerCanApplyOpacity;
Layer();
virtual ~Layer();
void AssignOldLayer(Layer* old_layer) {
original_layer_id_ = old_layer->original_layer_id_;
}
// Used to establish link between old layer and new layer that replaces it.
// If this method returns true, it is assumed that this layer replaces the old
// layer in tree and is able to diff with it.
virtual bool IsReplacing(DiffContext* context, const Layer* old_layer) const {
return original_layer_id_ == old_layer->original_layer_id_;
}
// Performs diff with given layer
virtual void Diff(DiffContext* context, const Layer* old_layer) {}
// Used when diffing retained layer; In case the layer is identical, it
// doesn't need to be diffed, but the paint region needs to be stored in diff
// context so that it can be used in next frame
virtual void PreservePaintRegion(DiffContext* context) {
// retained layer means same instance so 'this' is used to index into both
// current and old region
context->SetLayerPaintRegion(this, context->GetOldLayerPaintRegion(this));
}
virtual void Preroll(PrerollContext* context) = 0;
// Used during Preroll by layers that employ a saveLayer to manage the
// PrerollContext settings with values affected by the saveLayer mechanism.
// This object must be created before calling Preroll on the children to
// set up the state for the children and then restore the state upon
// destruction.
class AutoPrerollSaveLayerState {
public:
[[nodiscard]] static AutoPrerollSaveLayerState Create(
PrerollContext* preroll_context,
bool save_layer_is_active = true,
bool layer_itself_performs_readback = false);
~AutoPrerollSaveLayerState();
private:
AutoPrerollSaveLayerState(PrerollContext* preroll_context,
bool save_layer_is_active,
bool layer_itself_performs_readback);
PrerollContext* preroll_context_;
bool save_layer_is_active_;
bool layer_itself_performs_readback_;
bool prev_surface_needs_readback_;
};
virtual void Paint(PaintContext& context) const = 0;
virtual void PaintChildren(PaintContext& context) const { FML_DCHECK(false); }
bool subtree_has_platform_view() const { return subtree_has_platform_view_; }
void set_subtree_has_platform_view(bool value) {
subtree_has_platform_view_ = value;
}
// Returns the paint bounds in the layer's local coordinate system
// as determined during Preroll(). The bounds should include any
// transform, clip or distortions performed by the layer itself,
// but not any similar modifications inherited from its ancestors.
const SkRect& paint_bounds() const { return paint_bounds_; }
// This must be set by the time Preroll() returns otherwise the layer will
// be assumed to have empty paint bounds (paints no content).
// The paint bounds should be independent of the context outside of this
// layer as the layer may be painted under different conditions than
// the Preroll context. The most common example of this condition is
// that we might Preroll the layer with a cull_rect established by a
// clip layer above it but then we might be asked to paint anyway if
// another layer above us needs to cache its children. During the
// paint operation that arises due to the caching, the clip will
// be the bounds of the layer needing caching, not the cull_rect
// that we saw in the overall Preroll operation.
void set_paint_bounds(const SkRect& paint_bounds) {
paint_bounds_ = paint_bounds;
}
// Determines if the layer has any content.
bool is_empty() const { return paint_bounds_.isEmpty(); }
// Determines if the Paint() method is necessary based on the properties
// of the indicated PaintContext object.
bool needs_painting(PaintContext& context) const {
if (subtree_has_platform_view_) {
// Workaround for the iOS embedder. The iOS embedder expects that
// if we preroll it, then we will later call its Paint() method.
// Now that we preroll all layers without any culling, we may
// call its Preroll() without calling its Paint(). For now, we
// will not perform paint culling on any subtree that has a
// platform view.
// See https://github.com/flutter/flutter/issues/81419
return true;
}
return !context.state_stack.painting_is_nop() &&
!context.state_stack.content_culled(paint_bounds_);
}
// Propagated unique_id of the first layer in "chain" of replacement layers
// that can be diffed.
uint64_t original_layer_id() const { return original_layer_id_; }
uint64_t unique_id() const { return unique_id_; }
virtual RasterCacheKeyID caching_key_id() const {
return RasterCacheKeyID(unique_id_, RasterCacheKeyType::kLayer);
}
virtual const ContainerLayer* as_container_layer() const { return nullptr; }
virtual const DisplayListLayer* as_display_list_layer() const {
return nullptr;
}
virtual const TextureLayer* as_texture_layer() const { return nullptr; }
virtual const PerformanceOverlayLayer* as_performance_overlay_layer() const {
return nullptr;
}
virtual const testing::MockLayer* as_mock_layer() const { return nullptr; }
private:
SkRect paint_bounds_;
uint64_t unique_id_;
uint64_t original_layer_id_;
bool subtree_has_platform_view_ = false;
static uint64_t NextUniqueID();
FML_DISALLOW_COPY_AND_ASSIGN(Layer);
};
} // namespace flutter
#endif // FLUTTER_FLOW_LAYERS_LAYER_H_
| engine/flow/layers/layer.h/0 | {
"file_path": "engine/flow/layers/layer.h",
"repo_id": "engine",
"token_count": 3363
} | 212 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_
#define FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_
#include <string>
#include "flutter/flow/layers/layer.h"
#include "flutter/flow/stopwatch.h"
#include "flutter/fml/macros.h"
class SkTextBlob;
namespace flutter {
const int kDisplayRasterizerStatistics = 1 << 0;
const int kVisualizeRasterizerStatistics = 1 << 1;
const int kDisplayEngineStatistics = 1 << 2;
const int kVisualizeEngineStatistics = 1 << 3;
class PerformanceOverlayLayer : public Layer {
public:
static sk_sp<SkTextBlob> MakeStatisticsText(const Stopwatch& stopwatch,
const std::string& label_prefix,
const std::string& font_path);
bool IsReplacing(DiffContext* context, const Layer* layer) const override {
return layer->as_performance_overlay_layer() != nullptr;
}
void Diff(DiffContext* context, const Layer* old_layer) override;
const PerformanceOverlayLayer* as_performance_overlay_layer() const override {
return this;
}
explicit PerformanceOverlayLayer(uint64_t options,
const char* font_path = nullptr);
void Preroll(PrerollContext* context) override {}
void Paint(PaintContext& context) const override;
private:
int options_;
std::string font_path_;
FML_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer);
};
} // namespace flutter
#endif // FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_
| engine/flow/layers/performance_overlay_layer.h/0 | {
"file_path": "engine/flow/layers/performance_overlay_layer.h",
"repo_id": "engine",
"token_count": 633
} | 213 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLOW_PAINT_REGION_H_
#define FLUTTER_FLOW_PAINT_REGION_H_
#include <utility>
#include <vector>
#include "flutter/fml/logging.h"
#include "third_party/skia/include/core/SkRect.h"
namespace flutter {
// Corresponds to area on the screen where the layer subtree has painted to.
//
// The area is used when adding damage of removed or dirty layer to overall
// damage.
//
// Because there is a PaintRegion for each layer, it must be able to represent
// the area with minimal overhead. This is accomplished by having one
// vector<SkRect> shared between all paint regions, and each paint region
// keeping begin and end index of rects relevant to particular subtree.
//
// All rects are in screen coordinates.
class PaintRegion {
public:
PaintRegion() = default;
PaintRegion(std::shared_ptr<std::vector<SkRect>> rects,
size_t from,
size_t to,
bool has_readback,
bool has_texture)
: rects_(std::move(rects)),
from_(from),
to_(to),
has_readback_(has_readback),
has_texture_(has_texture) {}
std::vector<SkRect>::const_iterator begin() const {
FML_DCHECK(is_valid());
return rects_->begin() + from_;
}
std::vector<SkRect>::const_iterator end() const {
FML_DCHECK(is_valid());
return rects_->begin() + to_;
}
// Compute bounds for this region
SkRect ComputeBounds() const;
bool is_valid() const { return rects_ != nullptr; }
// Returns true if there is a layer in subtree represented by this region
// that performs readback
bool has_readback() const { return has_readback_; }
// Returns whether there is a TextureLayer in subtree represented by this
// region.
bool has_texture() const { return has_texture_; }
private:
std::shared_ptr<std::vector<SkRect>> rects_;
size_t from_ = 0;
size_t to_ = 0;
bool has_readback_ = false;
bool has_texture_ = false;
};
} // namespace flutter
#endif // FLUTTER_FLOW_PAINT_REGION_H_
| engine/flow/paint_region.h/0 | {
"file_path": "engine/flow/paint_region.h",
"repo_id": "engine",
"token_count": 752
} | 214 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLOW_STOPWATCH_DL_H_
#define FLUTTER_FLOW_STOPWATCH_DL_H_
#include "flow/stopwatch.h"
namespace flutter {
//------------------------------------------------------------------------------
/// A stopwatch visualizer that uses DisplayList (|DlCanvas|) to draw.
///
/// @note This is the newer non-backend specific version, that works in both
/// Skia and Impeller. The older Skia-specific version is
/// |SkStopwatchVisualizer|, which still should be used for Skia-specific
/// optimizations.
class DlStopwatchVisualizer : public StopwatchVisualizer {
public:
explicit DlStopwatchVisualizer(const Stopwatch& stopwatch)
: StopwatchVisualizer(stopwatch) {}
void Visualize(DlCanvas* canvas, const SkRect& rect) const override;
};
/// @brief Provides canvas-like painting methods that actually build vertices.
///
/// The goal is minimally invasive rendering for the performance monitor.
///
/// The methods in this class are intended to be used by |DlStopwatchVisualizer|
/// only. The rationale is the creating lines, rectangles, and paths (while OK
/// for general apps) would cause non-trivial work for the performance monitor
/// due to tessellation per-frame.
///
/// @note A goal of this class was to make updating the performance monitor
/// (and keeping it in sync with the |SkStopwatchVisualizer|) as easy as
/// possible (i.e. not having to do triangle-math).
class DlVertexPainter final {
public:
/// Draws a rectangle with the given color to a buffer.
void DrawRect(const SkRect& rect, const DlColor& color);
/// Converts the buffered vertices into a |DlVertices| object.
///
/// @note This method clears the buffer.
std::shared_ptr<DlVertices> IntoVertices();
private:
std::vector<SkPoint> vertices_;
std::vector<DlColor> colors_;
};
} // namespace flutter
#endif // FLUTTER_FLOW_STOPWATCH_DL_H_
| engine/flow/stopwatch_dl.h/0 | {
"file_path": "engine/flow/stopwatch_dl.h",
"repo_id": "engine",
"token_count": 600
} | 215 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLOW_TESTING_MOCK_EMBEDDER_H_
#define FLUTTER_FLOW_TESTING_MOCK_EMBEDDER_H_
#include "flutter/flow/embedded_views.h"
namespace flutter {
namespace testing {
class MockViewEmbedder : public ExternalViewEmbedder {
public:
MockViewEmbedder();
~MockViewEmbedder();
void AddCanvas(DlCanvas* canvas);
// |ExternalViewEmbedder|
DlCanvas* GetRootCanvas() override;
// |ExternalViewEmbedder|
void CancelFrame() override;
// |ExternalViewEmbedder|
void BeginFrame(GrDirectContext* context,
const fml::RefPtr<fml::RasterThreadMerger>&
raster_thread_merger) override;
// |ExternalViewEmbedder|
void PrepareFlutterView(int64_t flutter_view_id,
SkISize frame_size,
double device_pixel_ratio) override;
// |ExternalViewEmbedder|
void PrerollCompositeEmbeddedView(
int64_t view_id,
std::unique_ptr<EmbeddedViewParams> params) override;
// |ExternalViewEmbedder|
DlCanvas* CompositeEmbeddedView(int64_t view_id) override;
std::vector<int64_t> prerolled_views() const { return prerolled_views_; }
std::vector<int64_t> painted_views() const { return painted_views_; }
private:
std::deque<DlCanvas*> contexts_;
std::vector<int64_t> prerolled_views_;
std::vector<int64_t> painted_views_;
};
} // namespace testing
} // namespace flutter
#endif // FLUTTER_FLOW_TESTING_MOCK_EMBEDDER_H_
| engine/flow/testing/mock_embedder.h/0 | {
"file_path": "engine/flow/testing/mock_embedder.h",
"repo_id": "engine",
"token_count": 635
} | 216 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import 'package:litetest/litetest.dart';
import 'package:path/path.dart' as path;
Future<void> main(List<String> args) async {
if (args.length != 3) {
stderr.writeln('The first argument must be the path to the build output.');
stderr.writeln('The second argument must be the path to the frontend server dill.');
stderr.writeln('The third argument must be the path to the flutter_patched_sdk');
exit(-1);
}
final String dart = Platform.resolvedExecutable;
final String buildDir = args[0];
final String frontendServer = args[1];
final String sdkRoot = args[2];
final String basePath = path.canonicalize(path.join(path.dirname(Platform.script.toFilePath()), '..'));
final String fixtures = path.join(basePath, 'test', 'fixtures');
final String mainDart = path.join(fixtures, 'lib', 'main.dart');
final String packageConfig = path.join(fixtures, '.dart_tool', 'package_config.json');
final String regularDill = path.join(fixtures, 'toString.dill');
final String transformedDill = path.join(fixtures, 'toStringTransformed.dill');
void checkProcessResult(ProcessResult result) {
if (result.exitCode != 0) {
stdout.writeln(result.stdout);
stderr.writeln(result.stderr);
}
expect(result.exitCode, 0);
}
test('Without flag', () {
checkProcessResult(Process.runSync(dart, <String>[
frontendServer,
'--sdk-root=$sdkRoot',
'--target=flutter',
'--packages=$packageConfig',
'--output-dill=$regularDill',
mainDart,
]));
final ProcessResult runResult = Process.runSync(dart, <String>[regularDill]);
checkProcessResult(runResult);
String paintString = '"Paint.toString":"Paint(Color(0xffffffff))"';
if (buildDir.contains('release')) {
paintString = '"Paint.toString":"Instance of \'Paint\'"';
}
final String expectedStdout = '{$paintString,'
'"Brightness.toString":"Brightness.dark",'
'"Foo.toString":"I am a Foo",'
'"Keep.toString":"I am a Keep"}';
final String actualStdout = (runResult.stdout as String).trim();
expect(actualStdout, equals(expectedStdout));
});
test('With flag', () {
checkProcessResult(Process.runSync(dart, <String>[
frontendServer,
'--sdk-root=$sdkRoot',
'--target=flutter',
'--packages=$packageConfig',
'--output-dill=$transformedDill',
'--delete-tostring-package-uri', 'dart:ui',
'--delete-tostring-package-uri', 'package:flutter_frontend_fixtures',
mainDart,
]));
final ProcessResult runResult = Process.runSync(dart, <String>[transformedDill]);
checkProcessResult(runResult);
const String expectedStdout = '{"Paint.toString":"Instance of \'Paint\'",'
'"Brightness.toString":"Brightness.dark",'
'"Foo.toString":"Instance of \'Foo\'",'
'"Keep.toString":"I am a Keep"}';
final String actualStdout = (runResult.stdout as String).trim();
expect(actualStdout, equals(expectedStdout));
});
}
| engine/flutter_frontend_server/test/to_string_test.dart/0 | {
"file_path": "engine/flutter_frontend_server/test/to_string_test.dart",
"repo_id": "engine",
"token_count": 1168
} | 217 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FML_BASE32_H_
#define FLUTTER_FML_BASE32_H_
#include <string_view>
#include <utility>
#include "flutter/fml/logging.h"
namespace fml {
template <int from_length, int to_length, int buffer_length>
class BitConverter {
public:
void Append(int bits) {
FML_DCHECK(bits >= 0 && bits < (1 << from_length));
FML_DCHECK(CanAppend());
lower_free_bits_ -= from_length;
buffer_ |= (bits << lower_free_bits_);
}
int Extract() {
FML_DCHECK(CanExtract());
int result = Peek();
buffer_ = (buffer_ << to_length) & kMask;
lower_free_bits_ += to_length;
return result;
}
int Peek() const { return (buffer_ >> (buffer_length - to_length)); }
int BitsAvailable() const { return buffer_length - lower_free_bits_; }
bool CanAppend() const { return lower_free_bits_ >= from_length; }
bool CanExtract() const { return BitsAvailable() >= to_length; }
private:
static_assert(buffer_length >= 2 * from_length);
static_assert(buffer_length >= 2 * to_length);
static_assert(buffer_length < sizeof(int) * 8);
static constexpr int kMask = (1 << buffer_length) - 1;
int buffer_ = 0;
int lower_free_bits_ = buffer_length;
};
using Base32DecodeConverter = BitConverter<5, 8, 16>;
using Base32EncodeConverter = BitConverter<8, 5, 16>;
std::pair<bool, std::string> Base32Encode(std::string_view input);
std::pair<bool, std::string> Base32Decode(const std::string& input);
} // namespace fml
#endif // FLUTTER_FML_BASE32_H_
| engine/fml/base32.h/0 | {
"file_path": "engine/fml/base32.h",
"repo_id": "engine",
"token_count": 593
} | 218 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cpu_affinity.h"
#include "fml/file.h"
#include "fml/mapping.h"
#include "gtest/gtest.h"
#include "logging.h"
namespace fml {
namespace testing {
TEST(CpuAffinity, NonAndroidPlatformDefaults) {
ASSERT_FALSE(fml::EfficiencyCoreCount().has_value());
ASSERT_TRUE(fml::RequestAffinity(fml::CpuAffinity::kEfficiency));
}
TEST(CpuAffinity, NormalSlowMedFastCores) {
auto speeds = {CpuIndexAndSpeed{.index = 0, .speed = 1},
CpuIndexAndSpeed{.index = 1, .speed = 2},
CpuIndexAndSpeed{.index = 2, .speed = 3}};
auto tracker = CPUSpeedTracker(speeds);
ASSERT_TRUE(tracker.IsValid());
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kEfficiency)[0], 0u);
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kPerformance)[0], 2u);
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kNotPerformance).size(), 2u);
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kNotPerformance)[0], 0u);
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kNotPerformance)[1], 1u);
}
TEST(CpuAffinity, NoCpuData) {
auto tracker = CPUSpeedTracker({});
ASSERT_FALSE(tracker.IsValid());
}
TEST(CpuAffinity, AllSameSpeed) {
auto speeds = {CpuIndexAndSpeed{.index = 0, .speed = 1},
CpuIndexAndSpeed{.index = 1, .speed = 1},
CpuIndexAndSpeed{.index = 2, .speed = 1}};
auto tracker = CPUSpeedTracker(speeds);
ASSERT_FALSE(tracker.IsValid());
}
TEST(CpuAffinity, SingleCore) {
auto speeds = {CpuIndexAndSpeed{.index = 0, .speed = 1}};
auto tracker = CPUSpeedTracker(speeds);
ASSERT_FALSE(tracker.IsValid());
}
TEST(CpuAffinity, FileParsing) {
fml::ScopedTemporaryDirectory base_dir;
ASSERT_TRUE(base_dir.fd().is_valid());
// Generate a fake CPU speed file
fml::DataMapping test_data(std::string("12345"));
ASSERT_TRUE(fml::WriteAtomically(base_dir.fd(), "test_file", test_data));
auto file = fml::OpenFileReadOnly(base_dir.fd(), "test_file");
ASSERT_TRUE(file.is_valid());
// Open file and parse speed.
auto result = ReadIntFromFile(base_dir.path() + "/test_file");
ASSERT_TRUE(result.has_value());
ASSERT_EQ(result.value_or(0), 12345);
}
TEST(CpuAffinity, FileParsingWithNonNumber) {
fml::ScopedTemporaryDirectory base_dir;
ASSERT_TRUE(base_dir.fd().is_valid());
// Generate a fake CPU speed file
fml::DataMapping test_data(std::string("whoa this isnt a number"));
ASSERT_TRUE(fml::WriteAtomically(base_dir.fd(), "test_file", test_data));
auto file = fml::OpenFileReadOnly(base_dir.fd(), "test_file");
ASSERT_TRUE(file.is_valid());
// Open file and parse speed.
auto result = ReadIntFromFile(base_dir.path() + "/test_file");
ASSERT_FALSE(result.has_value());
}
TEST(CpuAffinity, MissingFileParsing) {
auto result = ReadIntFromFile("/does_not_exist");
ASSERT_FALSE(result.has_value());
}
} // namespace testing
} // namespace fml
| engine/fml/cpu_affinity_unittests.cc/0 | {
"file_path": "engine/fml/cpu_affinity_unittests.cc",
"repo_id": "engine",
"token_count": 1170
} | 219 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FML_ICU_UTIL_H_
#define FLUTTER_FML_ICU_UTIL_H_
#include <string>
#include "flutter/fml/macros.h"
#include "flutter/fml/mapping.h"
namespace fml {
namespace icu {
void InitializeICU(const std::string& icu_data_path = "");
void InitializeICUFromMapping(std::unique_ptr<Mapping> mapping);
} // namespace icu
} // namespace fml
#endif // FLUTTER_FML_ICU_UTIL_H_
| engine/fml/icu_util.h/0 | {
"file_path": "engine/fml/icu_util.h",
"repo_id": "engine",
"token_count": 206
} | 220 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Internal implementation details for ref_counted.h.
#ifndef FLUTTER_FML_MEMORY_REF_COUNTED_INTERNAL_H_
#define FLUTTER_FML_MEMORY_REF_COUNTED_INTERNAL_H_
#include <atomic>
#include "flutter/fml/logging.h"
#include "flutter/fml/macros.h"
namespace fml {
namespace internal {
// See ref_counted.h for comments on the public methods.
class RefCountedThreadSafeBase {
public:
void AddRef() const {
#ifndef NDEBUG
FML_DCHECK(!adoption_required_);
FML_DCHECK(!destruction_started_);
#endif
ref_count_.fetch_add(1u, std::memory_order_relaxed);
}
bool HasOneRef() const {
return ref_count_.load(std::memory_order_acquire) == 1u;
}
void AssertHasOneRef() const { FML_DCHECK(HasOneRef()); }
protected:
RefCountedThreadSafeBase();
~RefCountedThreadSafeBase();
// Returns true if the object should self-delete.
bool Release() const {
#ifndef NDEBUG
FML_DCHECK(!adoption_required_);
FML_DCHECK(!destruction_started_);
#endif
FML_DCHECK(ref_count_.load(std::memory_order_acquire) != 0u);
// TODO(vtl): We could add the following:
// if (ref_count_.load(std::memory_order_relaxed) == 1u) {
// #ifndef NDEBUG
// destruction_started_= true;
// #endif
// return true;
// }
// This would be correct. On ARM (an Nexus 4), in *single-threaded* tests,
// this seems to make the destruction case marginally faster (barely
// measurable), and while the non-destruction case remains about the same
// (possibly marginally slower, but my measurements aren't good enough to
// have any confidence in that). I should try multithreaded/multicore tests.
if (ref_count_.fetch_sub(1u, std::memory_order_release) == 1u) {
std::atomic_thread_fence(std::memory_order_acquire);
#ifndef NDEBUG
destruction_started_ = true;
#endif
return true;
}
return false;
}
#ifndef NDEBUG
void Adopt() {
FML_DCHECK(adoption_required_);
adoption_required_ = false;
}
#endif
private:
mutable std::atomic_uint_fast32_t ref_count_;
#ifndef NDEBUG
mutable bool adoption_required_ = false;
mutable bool destruction_started_ = false;
#endif
FML_DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafeBase);
};
inline RefCountedThreadSafeBase::RefCountedThreadSafeBase()
: ref_count_(1u)
#ifndef NDEBUG
,
adoption_required_(true)
#endif
{
}
inline RefCountedThreadSafeBase::~RefCountedThreadSafeBase() {
#ifndef NDEBUG
FML_DCHECK(!adoption_required_);
// Should only be destroyed as a result of |Release()|.
FML_DCHECK(destruction_started_);
#endif
}
} // namespace internal
} // namespace fml
#endif // FLUTTER_FML_MEMORY_REF_COUNTED_INTERNAL_H_
| engine/fml/memory/ref_counted_internal.h/0 | {
"file_path": "engine/fml/memory/ref_counted_internal.h",
"repo_id": "engine",
"token_count": 1056
} | 221 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.