Changeset 63308 in webkit
- Timestamp:
- Jul 14, 2010 4:15:05 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63307 r63308 1 2010-07-14 Joone Hur <joone@kldp.org> 2 3 Reviewed by Jian Li. 4 5 [GTK] Enabling File Reader/Writer APIs 6 https://bugs.webkit.org/show_bug.cgi?id=40209 7 8 The layout test fast/files will be enabled after eventSender.beginDragWithFiles is implemented for GTK. 9 10 * platform/gtk/FileSystemGtk.cpp: 11 (WebCore::openFile): Added. 12 (WebCore::readFromFile): Added. 13 1 14 2010-07-14 Nikolas Zimmermann <nzimmermann@rim.com> 2 15 -
trunk/WebCore/platform/gtk/FileSystemGtk.cpp
r61077 r63308 25 25 #include "GOwnPtr.h" 26 26 #include "PlatformString.h" 27 #include <wtf/text/CString.h> 28 27 28 #include <errno.h> 29 #include <fcntl.h> 29 30 #include <glib.h> 30 31 #include <glib/gstdio.h> 31 32 32 #include <unistd.h> 33 #include <wtf/text/CString.h> 33 34 34 35 namespace WebCore { … … 234 235 } 235 236 237 PlatformFileHandle openFile(const String& path, FileOpenMode mode) 238 { 239 CString fsRep = fileSystemRepresentation(path); 240 241 if (fsRep.isNull()) 242 return invalidPlatformFileHandle; 243 244 int platformFlag = 0; 245 if (mode == OpenForRead) 246 platformFlag |= O_RDONLY; 247 else if (mode == OpenForWrite) 248 platformFlag |= (O_WRONLY | O_CREAT | O_TRUNC); 249 250 return g_open(fsRep.data(), platformFlag, 0666); 251 } 252 236 253 void closeFile(PlatformFileHandle& handle) 237 254 { … … 256 273 } 257 274 275 int readFromFile(PlatformFileHandle handle, char* data, int length) 276 { 277 do { 278 int bytesRead = read(handle, data, static_cast<size_t>(length)); 279 if (bytesRead >= 0) 280 return bytesRead; 281 } while (errno == EINTR); 282 283 return -1; 284 } 285 258 286 bool unloadModule(PlatformModule module) 259 287 {
Note: See TracChangeset
for help on using the changeset viewer.