Skip to content

Don't cleanup datadir #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions webdev/lib/src/serve/chrome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,20 @@ var _currentCompleter = Completer<Chrome>();
class Chrome {
final int debugPort;
final Process _process;
final Directory _dataDir;

final ChromeConnection chromeConnection;

Chrome._(
this.debugPort,
this.chromeConnection, {
Process process,
Directory dataDir,
}) : _process = process,
_dataDir = dataDir;
}) : _process = process;

Future<void> close() async {
if (_currentCompleter.isCompleted) _currentCompleter = Completer<Chrome>();
chromeConnection.close();
_process?.kill();
await _process?.exitCode;
await _dataDir?.delete(recursive: true);
}

/// Connects to an instance of Chrome with an open debug port.
Expand Down Expand Up @@ -97,7 +93,6 @@ class Chrome {
port,
ChromeConnection('localhost', port),
process: process,
dataDir: dataDir,
));
}

Expand Down