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

Unified Diff: runtime/bin/file_system_watcher.cc

Issue 3001963002: [dart:io] Namespaces for file IO (Closed)
Patch Set: Fuchsia fix Created 3 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file_system_watcher.h ('k') | runtime/bin/file_system_watcher_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_system_watcher.cc
diff --git a/runtime/bin/file_system_watcher.cc b/runtime/bin/file_system_watcher.cc
index fc7666540041bfdc36da557e77ed7f7f67d1c0aa..a32d62b4acb00fece153ebaaef9f20a551772778 100644
--- a/runtime/bin/file_system_watcher.cc
+++ b/runtime/bin/file_system_watcher.cc
@@ -6,6 +6,7 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
+#include "bin/file.h"
#include "bin/utils.h"
#include "include/dart_api.h"
@@ -14,7 +15,7 @@ namespace dart {
namespace bin {
void FUNCTION_NAME(FileSystemWatcher_IsSupported)(Dart_NativeArguments args) {
- Dart_SetReturnValue(args, Dart_NewBoolean(FileSystemWatcher::IsSupported()));
+ Dart_SetBooleanReturnValue(args, FileSystemWatcher::IsSupported());
}
void FUNCTION_NAME(FileSystemWatcher_InitWatcher)(Dart_NativeArguments args) {
@@ -34,14 +35,16 @@ void FUNCTION_NAME(FileSystemWatcher_CloseWatcher)(Dart_NativeArguments args) {
void FUNCTION_NAME(FileSystemWatcher_WatchPath)(Dart_NativeArguments args) {
intptr_t id = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 0));
- const char* path = DartUtils::GetStringValue(Dart_GetNativeArgument(args, 1));
- int events = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 2));
- bool recursive = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 3));
- intptr_t path_id = FileSystemWatcher::WatchPath(id, path, events, recursive);
+ Namespace* namespc = Namespace::GetNamespace(args, 1);
+ const char* path = DartUtils::GetStringValue(Dart_GetNativeArgument(args, 2));
+ int events = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 3));
+ bool recursive = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 4));
+ intptr_t path_id =
+ FileSystemWatcher::WatchPath(id, namespc, path, events, recursive);
if (path_id == -1) {
Dart_ThrowException(DartUtils::NewDartOSError());
}
- Dart_SetReturnValue(args, Dart_NewInteger(path_id));
+ Dart_SetIntegerReturnValue(args, path_id);
}
void FUNCTION_NAME(FileSystemWatcher_UnwatchPath)(Dart_NativeArguments args) {
@@ -62,7 +65,7 @@ void FUNCTION_NAME(FileSystemWatcher_GetSocketId)(Dart_NativeArguments args) {
intptr_t id = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 0));
intptr_t path_id = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 1));
int socket_id = FileSystemWatcher::GetSocketId(id, path_id);
- Dart_SetReturnValue(args, Dart_NewInteger(socket_id));
+ Dart_SetIntegerReturnValue(args, socket_id);
}
} // namespace bin
« no previous file with comments | « runtime/bin/file_system_watcher.h ('k') | runtime/bin/file_system_watcher_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698