-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Persist filters for the Network and CPU profiler pages (#8456)
- Loading branch information
1 parent
1d92ca4
commit 681edca
Showing
7 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/devtools_app/lib/src/shared/preferences/_cpu_profiler_preferences.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// 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. | ||
|
||
part of 'preferences.dart'; | ||
|
||
class CpuProfilerPreferencesController extends DisposableController | ||
with AutoDisposeControllerMixin { | ||
/// The active filter tag for the cpu profiler screen. | ||
/// | ||
/// This value caches the most recent filter settings. | ||
final filterTag = ValueNotifier<String>(''); | ||
|
||
@visibleForTesting | ||
static const filterStorageId = 'cpuProfiler.filter'; | ||
|
||
Future<void> init() async { | ||
filterTag.value = await storage.getValue(filterStorageId) ?? ''; | ||
addAutoDisposeListener( | ||
filterTag, | ||
() => storage.setValue(filterStorageId, filterTag.value), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters