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

Side by Side Diff: pkg/front_end/lib/src/incremental/file_byte_store.dart

Issue 2971063002: Issue 30006. Don't flush on write to FileByteStore. (Closed)
Patch Set: Created 3 years, 5 months 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 | « no previous file | no next file » | 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:front_end/src/incremental/byte_store.dart'; 9 import 'package:front_end/src/incremental/byte_store.dart';
10 import 'package:path/path.dart'; 10 import 'package:path/path.dart';
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return _getFileForKey(key).readAsBytesSync(); 152 return _getFileForKey(key).readAsBytesSync();
153 } catch (_) { 153 } catch (_) {
154 return null; 154 return null;
155 } 155 }
156 } 156 }
157 157
158 @override 158 @override
159 void put(String key, List<int> bytes) { 159 void put(String key, List<int> bytes) {
160 try { 160 try {
161 File tempFile = _getFileForKey(_tempName); 161 File tempFile = _getFileForKey(_tempName);
162 tempFile.writeAsBytesSync(bytes, flush: true); 162 tempFile.writeAsBytesSync(bytes);
163 File file = _getFileForKey(key); 163 File file = _getFileForKey(key);
164 tempFile.renameSync(file.path); 164 tempFile.renameSync(file.path);
165 } catch (_) {} 165 } catch (_) {}
166 } 166 }
167 167
168 File _getFileForKey(String key) { 168 File _getFileForKey(String key) {
169 return new File(join(_cachePath, key)); 169 return new File(join(_cachePath, key));
170 } 170 }
171 } 171 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698