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

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

Issue 23830014: Throw exception if path can't be watched. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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') | 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) 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 _FileUtils { 5 patch class _FileUtils {
6 /* patch */ static SendPort _newServicePort() native "File_NewServicePort"; 6 /* patch */ static SendPort _newServicePort() native "File_NewServicePort";
7 } 7 }
8 8
9 patch class _File { 9 patch class _File {
10 /* patch */ static _exists(String path) native "File_Exists"; 10 /* patch */ static _exists(String path) native "File_Exists";
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 void _listen() { 71 void _listen() {
72 int socketId; 72 int socketId;
73 try { 73 try {
74 socketId = _watchPath(_path, _events, identical(true, _recursive)); 74 socketId = _watchPath(_path, _events, identical(true, _recursive));
75 } catch (e) { 75 } catch (e) {
76 throw new FileException( 76 throw new FileException(
77 "Failed to watch path", 77 "Failed to watch path",
78 _path, 78 _path,
79 e); 79 e);
80 } 80 }
81 print(socketId);
zra 2013/09/24 20:08:11 Is this a leftover debug print?
Anders Johnsen 2013/09/24 20:12:31 Heh, yep, too fast a fix :)
81 var socket = new _RawSocket(new _NativeSocket.watch(socketId)); 82 var socket = new _RawSocket(new _NativeSocket.watch(socketId));
82 _subscription = socket.expand((event) { 83 _subscription = socket.expand((event) {
83 var events = []; 84 var events = [];
84 var pair = {}; 85 var pair = {};
85 if (event == RawSocketEvent.READ) { 86 if (event == RawSocketEvent.READ) {
86 String getPath(event) { 87 String getPath(event) {
87 var path = _path; 88 var path = _path;
88 if (event[2] != null) { 89 if (event[2] != null) {
89 path += Platform.pathSeparator; 90 path += Platform.pathSeparator;
90 path += event[2]; 91 path += event[2];
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 151
151 int _watchPath(String path, int events, bool recursive) 152 int _watchPath(String path, int events, bool recursive)
152 native "FileSystemWatcher_WatchPath"; 153 native "FileSystemWatcher_WatchPath";
153 void _unwatchPath() native "FileSystemWatcher_UnwatchPath"; 154 void _unwatchPath() native "FileSystemWatcher_UnwatchPath";
154 List _readEvents() native "FileSystemWatcher_ReadEvents"; 155 List _readEvents() native "FileSystemWatcher_ReadEvents";
155 } 156 }
156 157
157 Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) { 158 Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) {
158 return new Uint8List.view(source.buffer, offsetInBytes, length); 159 return new Uint8List.view(source.buffer, offsetInBytes, length);
159 } 160 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/file_system_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698