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

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

Issue 2439173002: [windows] Make most file_win.cc functions use malloc for string conversions. (Closed)
Patch Set: Fix typo Created 4 years, 1 month 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
« no previous file with comments | « runtime/bin/file_macos.cc ('k') | runtime/bin/file_win.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) 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 #if !defined(DART_IO_DISABLED) 5 #if !defined(DART_IO_DISABLED)
6 6
7 #include "platform/globals.h" 7 #include "platform/globals.h"
8 #if defined(TARGET_OS_WINDOWS) 8 #if defined(TARGET_OS_WINDOWS)
9 9
10 #include "bin/file_system_watcher.h" 10 #include "bin/file_system_watcher.h"
(...skipping 22 matching lines...) Expand all
33 void FileSystemWatcher::Close(intptr_t id) { 33 void FileSystemWatcher::Close(intptr_t id) {
34 USE(id); 34 USE(id);
35 } 35 }
36 36
37 37
38 intptr_t FileSystemWatcher::WatchPath(intptr_t id, 38 intptr_t FileSystemWatcher::WatchPath(intptr_t id,
39 const char* path, 39 const char* path,
40 int events, 40 int events,
41 bool recursive) { 41 bool recursive) {
42 USE(id); 42 USE(id);
43 const wchar_t* name = StringUtilsWin::Utf8ToWide(path); 43 Utf8ToWideScope name(path);
44 HANDLE dir = CreateFileW(name, 44 HANDLE dir = CreateFileW(name.wide(),
45 FILE_LIST_DIRECTORY, 45 FILE_LIST_DIRECTORY,
46 FILE_SHARE_READ | 46 FILE_SHARE_READ |
47 FILE_SHARE_WRITE | 47 FILE_SHARE_WRITE |
48 FILE_SHARE_DELETE, 48 FILE_SHARE_DELETE,
49 NULL, 49 NULL,
50 OPEN_EXISTING, 50 OPEN_EXISTING,
51 FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, 51 FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED,
52 NULL); 52 NULL);
53 53
54 if (dir == INVALID_HANDLE_VALUE) { 54 if (dir == INVALID_HANDLE_VALUE) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 return events; 137 return events;
138 } 138 }
139 139
140 } // namespace bin 140 } // namespace bin
141 } // namespace dart 141 } // namespace dart
142 142
143 #endif // defined(TARGET_OS_WINDOWS) 143 #endif // defined(TARGET_OS_WINDOWS)
144 144
145 #endif // !defined(DART_IO_DISABLED) 145 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « runtime/bin/file_macos.cc ('k') | runtime/bin/file_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698