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

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

Issue 337033: FilePath::Append() doesn't allow you to append a fully-qualified... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "net/base/io_buffer.h" 7 #include "net/base/io_buffer.h"
8 #include "net/disk_cache/entry_impl.h" 8 #include "net/disk_cache/entry_impl.h"
9 #include "net/http/http_cache.h" 9 #include "net/http/http_cache.h"
10 #include "net/http/http_response_headers.h" 10 #include "net/http/http_response_headers.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 bool DiskDumper::CreateEntry(const std::string& key, 64 bool DiskDumper::CreateEntry(const std::string& key,
65 disk_cache::Entry** entry) { 65 disk_cache::Entry** entry) {
66 FilePath path(path_); 66 FilePath path(path_);
67 entry_path_ = net::UrlToFilenameEncoder::Encode(key, path); 67 entry_path_ = net::UrlToFilenameEncoder::Encode(key, path);
68 68
69 #ifdef WIN32_LARGE_FILENAME_SUPPORT 69 #ifdef WIN32_LARGE_FILENAME_SUPPORT
70 // In order for long filenames to work, we'll need to prepend 70 // In order for long filenames to work, we'll need to prepend
71 // the windows magic token. 71 // the windows magic token.
72 const std::wstring kLongFilenamePrefix(L"\\\\?\\"); 72 const std::wstring kLongFilenamePrefix(L"\\\\?\\");
73 entry_path_ = FilePath(kLongFilenamePrefix).Append(entry_path_); 73 // There is no way to prepend to a filename. We simply *have*
74 // to convert to a wstring to do this.
75 std::wstring name = kLongFilenamePrefix;
76 name.append(entry_path_.ToWStringHack());
77 entry_path_ = FilePath(name);
74 #endif 78 #endif
75 79
76 entry_url_ = key; 80 entry_url_ = key;
77 81
78 FilePath directory = entry_path_.DirName(); 82 FilePath directory = entry_path_.DirName();
79 SafeCreateDirectory(directory.value()); 83 SafeCreateDirectory(directory.value());
80 84
81 std::wstring file = entry_path_.value(); 85 std::wstring file = entry_path_.value();
82 #ifdef WIN32_LARGE_FILENAME_SUPPORT 86 #ifdef WIN32_LARGE_FILENAME_SUPPORT
83 entry_ = CreateFileW(file.c_str(), GENERIC_WRITE|GENERIC_READ, 0, 0, 87 entry_ = CreateFileW(file.c_str(), GENERIC_WRITE|GENERIC_READ, 0, 0,
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 190
187 void DiskDumper::CloseEntry(disk_cache::Entry* entry, base::Time last_used, 191 void DiskDumper::CloseEntry(disk_cache::Entry* entry, base::Time last_used,
188 base::Time last_modified) { 192 base::Time last_modified) {
189 #ifdef WIN32_LARGE_FILENAME_SUPPORT 193 #ifdef WIN32_LARGE_FILENAME_SUPPORT
190 CloseHandle(entry_); 194 CloseHandle(entry_);
191 #else 195 #else
192 file_util::CloseFile(entry_); 196 file_util::CloseFile(entry_);
193 #endif 197 #endif
194 } 198 }
195 199
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698