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

Unified Diff: base/platform_file.h

Issue 8843: Add write and read/write support to FileStream (renamed from FileInputStream)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/build/base.vcproj ('k') | base/platform_file_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/platform_file.h
===================================================================
--- base/platform_file.h (revision 4227)
+++ base/platform_file.h (working copy)
@@ -2,39 +2,45 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef NET_DISK_CACHE_OS_FILE_H_
-#define NET_DISK_CACHE_OS_FILE_H_
+#ifndef BASE_PLATFORM_FILE_H_
+#define BASE_PLATFORM_FILE_H_
+#include "build/build_config.h"
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
#include <string>
-#include "build/build_config.h"
+namespace base {
-namespace disk_cache {
-
#if defined(OS_WIN)
-#include <windows.h>
-typedef HANDLE OSFile;
+typedef HANDLE PlatformFile;
+const PlatformFile kInvalidPlatformFileValue = INVALID_HANDLE_VALUE;
#elif defined(OS_POSIX)
-typedef int OSFile;
-const OSFile INVALID_HANDLE_VALUE = -1;
+typedef int PlatformFile;
+const PlatformFile kInvalidPlatformFileValue = -1;
#endif
-enum OSFileFlags {
- OS_FILE_OPEN = 1,
- OS_FILE_CREATE = 2,
- OS_FILE_OPEN_ALWAYS = 4, // May create a new file.
- OS_FILE_CREATE_ALWAYS = 8, // May overwrite an old file.
- OS_FILE_READ = 16,
- OS_FILE_WRITE = 32,
- OS_FILE_SHARE_READ = 64,
- OS_FILE_SHARE_WRITE = 128
+enum PlatformFileFlags {
+ PLATFORM_FILE_OPEN = 1,
+ PLATFORM_FILE_CREATE = 2,
+ PLATFORM_FILE_OPEN_ALWAYS = 4, // May create a new file.
+ PLATFORM_FILE_CREATE_ALWAYS = 8, // May overwrite an old file.
+ PLATFORM_FILE_READ = 16,
+ PLATFORM_FILE_WRITE = 32,
+ PLATFORM_FILE_EXCLUSIVE_READ = 64, // EXCLUSIVE is opposite of Windows SHARE
+ PLATFORM_FILE_EXCLUSIVE_WRITE = 128,
+ PLATFORM_FILE_ASYNC = 256
};
-// Creates or open the given file. If OS_FILE_OPEN_ALWAYS is used, and |created|
-// is provided, |created| will be set to true if the file was created or to
-// false in case the file was just opened.
-OSFile CreateOSFile(const std::wstring& name, int flags, bool* created);
+// Creates or open the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and
+// |created| is provided, |created| will be set to true if the file was created
+// or to false in case the file was just opened.
+PlatformFile CreatePlatformFile(const std::wstring& name,
+ int flags,
+ bool* created);
-} // namespace disk_cache
+} // namespace base
-#endif // NET_DISK_CACHE_OS_FILE_H_
+#endif // BASE_PLATFORM_FILE_H_
Property changes on: base\platform_file.h
___________________________________________________________________
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/net/disk_cache/os_file.h:r69-2775
« no previous file with comments | « base/build/base.vcproj ('k') | base/platform_file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698