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

Side by Side Diff: runtime/bin/file_patch.dart

Issue 939643002: Add error handling when initializing the file system watcher (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/file_system_watcher.cc » ('j') | runtime/bin/file_system_watcher.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 patch class _File { 5 patch class _File {
6 /* patch */ static _exists(String path) native "File_Exists"; 6 /* patch */ static _exists(String path) native "File_Exists";
7 /* patch */ static _create(String path) native "File_Create"; 7 /* patch */ static _create(String path) native "File_Create";
8 /* patch */ static _createLink(String path, String target) 8 /* patch */ static _createLink(String path, String target)
9 native "File_CreateLink"; 9 native "File_CreateLink";
10 /* patch */ static _linkTarget(String path) native "File_LinkTarget"; 10 /* patch */ static _linkTarget(String path) native "File_LinkTarget";
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 Stream get stream => _broadcastController.stream; 93 Stream get stream => _broadcastController.stream;
94 94
95 void _listen() { 95 void _listen() {
96 if (_id == null) { 96 if (_id == null) {
97 try { 97 try {
98 _id = _initWatcher(); 98 _id = _initWatcher();
99 _newWatcher(); 99 _newWatcher();
100 } catch (e) { 100 } catch (e) {
101 _broadcastController.addError(new FileSystemException( 101 _broadcastController.addError(new FileSystemException(
102 "Failed to initialize file system entity watcher")); 102 "Failed to initialize file system entity watcher", null, e));
103 _broadcastController.close(); 103 _broadcastController.close();
104 return; 104 return;
105 } 105 }
106 } 106 }
107 var pathId; 107 var pathId;
108 try { 108 try {
109 pathId = _watchPath(_id, _path, _events, _recursive); 109 pathId = _watchPath(_id, _path, _events, _recursive);
110 } catch (e) { 110 } catch (e) {
111 _broadcastController.addError(new FileSystemException( 111 _broadcastController.addError(new FileSystemException(
112 "Failed to watch path", _path, e)); 112 "Failed to watch path", _path, e));
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 void _pathWatchedEnd() { 361 void _pathWatchedEnd() {
362 _subscription.cancel(); 362 _subscription.cancel();
363 _controller.close(); 363 _controller.close();
364 } 364 }
365 } 365 }
366 366
367 367
368 Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) { 368 Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) {
369 return new Uint8List.view(source.buffer, offsetInBytes, length); 369 return new Uint8List.view(source.buffer, offsetInBytes, length);
370 } 370 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/file_system_watcher.cc » ('j') | runtime/bin/file_system_watcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698