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

Side by Side Diff: runtime/bin/file_system_watcher_macos.cc

Issue 907883002: Remove SetNonBlocking/SetBlocking methods from Socket and add missing close-on-exec (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/socket.h » ('j') | runtime/bin/socket_android.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_MACOS) 6 #if defined(TARGET_OS_MACOS)
7 7
8 #include "bin/file_system_watcher.h" 8 #include "bin/file_system_watcher.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 257
258 bool has_run_loop() const { return run_loop_ != NULL; } 258 bool has_run_loop() const { return run_loop_ != NULL; }
259 259
260 static void TimerCallback(CFRunLoopTimerRef timer, void* context) { 260 static void TimerCallback(CFRunLoopTimerRef timer, void* context) {
261 // Dummy callback to keep RunLoop alive. 261 // Dummy callback to keep RunLoop alive.
262 } 262 }
263 263
264 Node* AddPath(const char* path, int events, bool recursive) { 264 Node* AddPath(const char* path, int events, bool recursive) {
265 int fds[2]; 265 int fds[2];
266 VOID_NO_RETRY_EXPECTED(pipe(fds)); 266 VOID_NO_RETRY_EXPECTED(pipe(fds));
267 Socket::SetNonBlocking(fds[0]); 267 FDUtils::SetNonBlocking(fds[0]);
268 Socket::SetBlocking(fds[1]); 268 FDUtils::SetBlocking(fds[1]);
269 269
270 char base_path[PATH_MAX]; 270 char base_path[PATH_MAX];
271 realpath(path, base_path); 271 realpath(path, base_path);
272 272
273 return new Node(this, base_path, fds[0], fds[1], recursive); 273 return new Node(this, base_path, fds[0], fds[1], recursive);
274 } 274 }
275 275
276 private: 276 private:
277 static void Callback(ConstFSEventStreamRef ref, 277 static void Callback(ConstFSEventStreamRef ref,
278 void* client, 278 void* client,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 Dart_ListSetAt(event, 4, Dart_NewInteger(path_id)); 386 Dart_ListSetAt(event, 4, Dart_NewInteger(path_id));
387 Dart_ListSetAt(events, i, event); 387 Dart_ListSetAt(events, i, event);
388 } 388 }
389 return events; 389 return events;
390 } 390 }
391 391
392 } // namespace bin 392 } // namespace bin
393 } // namespace dart 393 } // namespace dart
394 394
395 #endif // defined(TARGET_OS_MACOS) 395 #endif // defined(TARGET_OS_MACOS)
396
397
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/socket.h » ('j') | runtime/bin/socket_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698