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

Side by Side Diff: Source/core/platform/FileSystem.h

Issue 22645008: Add WebKitUnitTestSupport::readFromFile and deprecate all PlatformFileHandle related methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/platform/chromium/FileSystemChromium.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Collabora, Ltd. All rights reserved. 3 * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 20 matching lines...) Expand all
31 #define FileSystem_h 31 #define FileSystem_h
32 32
33 #include <time.h> 33 #include <time.h>
34 #include "wtf/Forward.h" 34 #include "wtf/Forward.h"
35 #include "wtf/MathExtras.h" 35 #include "wtf/MathExtras.h"
36 #include "wtf/Vector.h" 36 #include "wtf/Vector.h"
37 #include "wtf/text/WTFString.h" 37 #include "wtf/text/WTFString.h"
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 #if OS(WINDOWS)
42 typedef void *HANDLE;
43 typedef HANDLE PlatformFileHandle;
44 #else
45 typedef int PlatformFileHandle;
46 #endif
47
48 enum FileOpenMode {
49 OpenForRead = 0,
50 OpenForWrite
51 };
52
53 struct FileMetadata; 41 struct FileMetadata;
54 42
55 bool getFileSize(const String&, long long& result); 43 bool getFileSize(const String&, long long& result);
56 bool getFileModificationTime(const String&, time_t& result); 44 bool getFileModificationTime(const String&, time_t& result);
57 bool getFileMetadata(const String&, FileMetadata&); 45 bool getFileMetadata(const String&, FileMetadata&);
58 String directoryName(const String&); 46 String directoryName(const String&);
59 47
60 inline double invalidFileTime() { return std::numeric_limits<double>::quiet_NaN( ); } 48 inline double invalidFileTime() { return std::numeric_limits<double>::quiet_NaN( ); }
61 inline bool isValidFileTime(double time) { return std::isfinite(time); } 49 inline bool isValidFileTime(double time) { return std::isfinite(time); }
62 50
63 // FIXME: Only used by test code, move them into WebUnitTestSupport.
64 PlatformFileHandle openFile(const String& path, FileOpenMode);
65 void closeFile(PlatformFileHandle&);
66 // Returns number of bytes actually written if successful, -1 otherwise.
67 int readFromFile(PlatformFileHandle, char* data, int length);
68
69 } // namespace WebCore 51 } // namespace WebCore
70 52
71 #endif // FileSystem_h 53 #endif // FileSystem_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/platform/chromium/FileSystemChromium.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698