Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart

Issue 2508973005: Un-deprecate some deprecated code and fix a couple of hints (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/context/builder.dart ('k') | pkg/analyzer/lib/src/generated/constant.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 import 'dart:isolate'; 7 import 'dart:isolate';
8 8
9 import 'package:analyzer/src/dart/analysis/byte_store.dart'; 9 import 'package:analyzer/src/dart/analysis/byte_store.dart';
10 import 'package:path/path.dart'; 10 import 'package:path/path.dart';
11 11
12 /** 12 /**
13 * [ByteStore] that stores values as files. 13 * [ByteStore] that stores values as files.
14 */ 14 */
15 class FileByteStore implements ByteStore { 15 class FileByteStore implements ByteStore {
16 static bool _cleanUpSendPortShouldBePrepared = true; 16 static bool _cleanUpSendPortShouldBePrepared = true;
17 static SendPort _cleanUpSendPort; 17 static SendPort _cleanUpSendPort;
18 18
19 final String _cachePath; 19 final String _cachePath;
20 final String _tempName = 'temp_${pid}'; 20 final String _tempName = 'temp_$pid';
21 final int _maxSizeBytes; 21 final int _maxSizeBytes;
22 22
23 int _bytesWrittenSinceCleanup = 0; 23 int _bytesWrittenSinceCleanup = 0;
24 bool _evictionIsolateIsRunning = false; 24 bool _evictionIsolateIsRunning = false;
25 25
26 FileByteStore(this._cachePath, this._maxSizeBytes) { 26 FileByteStore(this._cachePath, this._maxSizeBytes) {
27 _requestCacheCleanUp(); 27 _requestCacheCleanUp();
28 } 28 }
29 29
30 @override 30 @override
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 if (currentSizeBytes < maxSizeBytes) { 132 if (currentSizeBytes < maxSizeBytes) {
133 break; 133 break;
134 } 134 }
135 try { 135 try {
136 await file.delete(); 136 await file.delete();
137 } catch (_) {} 137 } catch (_) {}
138 currentSizeBytes -= fileStatMap[file].size; 138 currentSizeBytes -= fileStatMap[file].size;
139 } 139 }
140 } 140 }
141 } 141 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/context/builder.dart ('k') | pkg/analyzer/lib/src/generated/constant.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698