OLD | NEW |
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 #if !defined(TARGET_OS_IOS) |
| 11 |
10 #include <errno.h> // NOLINT | 12 #include <errno.h> // NOLINT |
11 #include <fcntl.h> // NOLINT | 13 #include <fcntl.h> // NOLINT |
12 #include <unistd.h> // NOLINT | 14 #include <unistd.h> // NOLINT |
13 #include <CoreServices/CoreServices.h> // NOLINT | 15 #include <CoreServices/CoreServices.h> // NOLINT |
14 | 16 |
15 #include "bin/eventhandler.h" | 17 #include "bin/eventhandler.h" |
16 #include "bin/fdutils.h" | 18 #include "bin/fdutils.h" |
17 #include "bin/file.h" | 19 #include "bin/file.h" |
18 #include "bin/socket.h" | 20 #include "bin/socket.h" |
19 #include "bin/thread.h" | 21 #include "bin/thread.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 Dart_ListSetAt(event, 3, Dart_NewBoolean(true)); | 387 Dart_ListSetAt(event, 3, Dart_NewBoolean(true)); |
386 Dart_ListSetAt(event, 4, Dart_NewInteger(path_id)); | 388 Dart_ListSetAt(event, 4, Dart_NewInteger(path_id)); |
387 Dart_ListSetAt(events, i, event); | 389 Dart_ListSetAt(events, i, event); |
388 } | 390 } |
389 return events; | 391 return events; |
390 } | 392 } |
391 | 393 |
392 } // namespace bin | 394 } // namespace bin |
393 } // namespace dart | 395 } // namespace dart |
394 | 396 |
| 397 #else // !defined(TARGET_OS_IOS) |
| 398 |
| 399 namespace dart { |
| 400 namespace bin { |
| 401 |
| 402 // FSEvents are unavailable on iOS. Stub out related methods |
| 403 Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) { |
| 404 return DartUtils::NewDartOSError(); |
| 405 } |
| 406 |
| 407 intptr_t FileSystemWatcher::GetSocketId(intptr_t id, intptr_t path_id) { |
| 408 return -1; |
| 409 } |
| 410 |
| 411 bool FileSystemWatcher::IsSupported() { |
| 412 return false; |
| 413 } |
| 414 |
| 415 void FileSystemWatcher::UnwatchPath(intptr_t id, intptr_t path_id) { |
| 416 } |
| 417 |
| 418 intptr_t FileSystemWatcher::Init() { |
| 419 return -1; |
| 420 } |
| 421 |
| 422 void FileSystemWatcher::Close(intptr_t id) { |
| 423 } |
| 424 |
| 425 intptr_t FileSystemWatcher::WatchPath(intptr_t id, |
| 426 const char* path, |
| 427 int events, |
| 428 bool recursive) { |
| 429 return -1; |
| 430 } |
| 431 |
| 432 } // namespace bin |
| 433 } // namespace dart |
| 434 |
| 435 #endif // !defined(TARGET_OS_IOS) |
| 436 |
395 #endif // defined(TARGET_OS_MACOS) | 437 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |