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

Unified Diff: base/platform_file_win.cc

Issue 7044095: Hooking MHTML generation to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for browser test. 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 side-by-side diff with in-line comments
Download patch
Index: base/platform_file_win.cc
diff --git a/base/platform_file_win.cc b/base/platform_file_win.cc
index f448db065a7be5be284d95b9ad9df6fb2001de16..e531577d0246e5032f8e8bf4d62163825a89c315 100644
--- a/base/platform_file_win.cc
+++ b/base/platform_file_win.cc
@@ -217,4 +217,19 @@ bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) {
return true;
}
+PlatformFile GetFileHandleForProcess(PlatformFile file,
+ ProcessHandle process,
+ bool close_source_handle) {
+ if (file == base::kInvalidPlatformFileValue)
+ return base::kInvalidPlatformFileValue;
+
+ PlatformFile result = base::kInvalidPlatformFileValue;
+ // Note that when |close_source_handle| is true, |file| is closed whether or
+ // not DuplicateHandle succeeds.
+ DuplicateHandle(GetCurrentProcess(), file, process, &result, 0, false,
+ DUPLICATE_SAME_ACCESS |
+ (close_source_handle ? DUPLICATE_CLOSE_SOURCE : 0));
+ return result;
+}
+
} // namespace disk_cache

Powered by Google App Engine
This is Rietveld 408576698