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

Side by Side Diff: trunk/src/net/tools/dump_cache/cache_dumper.cc

Issue 105823009: Revert 239280 "Move more file_util functions to base namespace." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "net/tools/dump_cache/cache_dumper.h" 5 #include "net/tools/dump_cache/cache_dumper.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 SafeCreateDirectory(entry_path_.DirName()); 101 SafeCreateDirectory(entry_path_.DirName());
102 102
103 base::FilePath::StringType file = entry_path_.value(); 103 base::FilePath::StringType file = entry_path_.value();
104 #ifdef WIN32_LARGE_FILENAME_SUPPORT 104 #ifdef WIN32_LARGE_FILENAME_SUPPORT
105 entry_ = CreateFileW(file.c_str(), GENERIC_WRITE|GENERIC_READ, 0, 0, 105 entry_ = CreateFileW(file.c_str(), GENERIC_WRITE|GENERIC_READ, 0, 0,
106 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); 106 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
107 if (entry_ == INVALID_HANDLE_VALUE) 107 if (entry_ == INVALID_HANDLE_VALUE)
108 wprintf(L"CreateFileW (%s) failed: %d\n", file.c_str(), GetLastError()); 108 wprintf(L"CreateFileW (%s) failed: %d\n", file.c_str(), GetLastError());
109 return (entry_ != INVALID_HANDLE_VALUE) ? net::OK : net::ERR_FAILED; 109 return (entry_ != INVALID_HANDLE_VALUE) ? net::OK : net::ERR_FAILED;
110 #else 110 #else
111 entry_ = base::OpenFile(entry_path_, "w+"); 111 entry_ = file_util::OpenFile(entry_path_, "w+");
112 return (entry_ != NULL) ? net::OK : net::ERR_FAILED; 112 return (entry_ != NULL) ? net::OK : net::ERR_FAILED;
113 #endif 113 #endif
114 } 114 }
115 115
116 // Utility Function to create a normalized header string from a 116 // Utility Function to create a normalized header string from a
117 // HttpResponseInfo. The output will be formatted exactly 117 // HttpResponseInfo. The output will be formatted exactly
118 // like so: 118 // like so:
119 // HTTP/<version> <status_code> <status_text>\n 119 // HTTP/<version> <status_code> <status_text>\n
120 // [<header-name>: <header-values>\n]* 120 // [<header-name>: <header-values>\n]*
121 // meaning, each line is \n-terminated, and there is no extra whitespace 121 // meaning, each line is \n-terminated, and there is no extra whitespace
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 #else 211 #else
212 return fwrite(data, 1, len, entry_); 212 return fwrite(data, 1, len, entry_);
213 #endif 213 #endif
214 } 214 }
215 215
216 void DiskDumper::CloseEntry(disk_cache::Entry* entry, base::Time last_used, 216 void DiskDumper::CloseEntry(disk_cache::Entry* entry, base::Time last_used,
217 base::Time last_modified) { 217 base::Time last_modified) {
218 #ifdef WIN32_LARGE_FILENAME_SUPPORT 218 #ifdef WIN32_LARGE_FILENAME_SUPPORT
219 CloseHandle(entry_); 219 CloseHandle(entry_);
220 #else 220 #else
221 base::CloseFile(entry_); 221 file_util::CloseFile(entry_);
222 #endif 222 #endif
223 } 223 }
OLDNEW
« no previous file with comments | « trunk/src/net/proxy/proxy_config_service_linux.cc ('k') | trunk/src/net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698