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

Side by Side Diff: base/platform_file.h

Issue 7044095: Hooking MHTML generation to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor clean-up Created 9 years, 6 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_PLATFORM_FILE_H_ 5 #ifndef BASE_PLATFORM_FILE_H_
6 #define BASE_PLATFORM_FILE_H_ 6 #define BASE_PLATFORM_FILE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
11 #include <windows.h> 11 #include <windows.h>
12 #endif 12 #endif
13 13
14 #include <string> 14 #include <string>
15 15
16 #include "base/base_api.h" 16 #include "base/base_api.h"
17 #include "base/basictypes.h" 17 #include "base/basictypes.h"
18 #include "base/file_path.h" 18 #include "base/file_path.h"
19 #include "base/process.h"
19 #include "base/time.h" 20 #include "base/time.h"
20 21
21 namespace base { 22 namespace base {
22 23
23 #if defined(OS_WIN) 24 #if defined(OS_WIN)
24 typedef HANDLE PlatformFile; 25 typedef HANDLE PlatformFile;
25 const PlatformFile kInvalidPlatformFileValue = INVALID_HANDLE_VALUE; 26 const PlatformFile kInvalidPlatformFileValue = INVALID_HANDLE_VALUE;
26 #elif defined(OS_POSIX) 27 #elif defined(OS_POSIX)
27 typedef int PlatformFile; 28 typedef int PlatformFile;
28 const PlatformFile kInvalidPlatformFileValue = -1; 29 const PlatformFile kInvalidPlatformFileValue = -1;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // Flushes the buffers of the given file. 134 // Flushes the buffers of the given file.
134 BASE_API bool FlushPlatformFile(PlatformFile file); 135 BASE_API bool FlushPlatformFile(PlatformFile file);
135 136
136 // Touches the given file. 137 // Touches the given file.
137 BASE_API bool TouchPlatformFile(PlatformFile file, const Time& last_access_time, 138 BASE_API bool TouchPlatformFile(PlatformFile file, const Time& last_access_time,
138 const Time& last_modified_time); 139 const Time& last_modified_time);
139 140
140 // Returns some information for the given file. 141 // Returns some information for the given file.
141 BASE_API bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info); 142 BASE_API bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info);
142 143
144 // Returns a file handle equivalent to |file| that can be used in |process|.
145 BASE_API PlatformFile GetFileHandleForProcess(PlatformFile file,
146 ProcessHandle process,
147 bool close_source_handle);
148
143 // Use this class to pass ownership of a PlatformFile to a receiver that may or 149 // Use this class to pass ownership of a PlatformFile to a receiver that may or
144 // may not want to accept it. This class does not own the storage for the 150 // may not want to accept it. This class does not own the storage for the
145 // PlatformFile. 151 // PlatformFile.
146 // 152 //
147 // EXAMPLE: 153 // EXAMPLE:
148 // 154 //
149 // void MaybeProcessFile(PassPlatformFile pass_file) { 155 // void MaybeProcessFile(PassPlatformFile pass_file) {
150 // if (...) { 156 // if (...) {
151 // PlatformFile file = pass_file.ReleaseValue(); 157 // PlatformFile file = pass_file.ReleaseValue();
152 // // Now, we are responsible for closing |file|. 158 // // Now, we are responsible for closing |file|.
(...skipping 21 matching lines...) Expand all
174 return temp; 180 return temp;
175 } 181 }
176 182
177 private: 183 private:
178 PlatformFile* value_; 184 PlatformFile* value_;
179 }; 185 };
180 186
181 } // namespace base 187 } // namespace base
182 188
183 #endif // BASE_PLATFORM_FILE_H_ 189 #endif // BASE_PLATFORM_FILE_H_
OLDNEW
« no previous file with comments | « no previous file | base/platform_file_posix.cc » ('j') | chrome/browser/download/mhtml_generation_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698