summaryrefslogtreecommitdiffstats
path: root/net/tools
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-26 19:19:42 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-26 19:19:42 +0000
commite72b11f7fa92b7233bde9e75170499e768f4dbb4 (patch)
treeb541c7d0d477976826006bd73ac23b643863a2b9 /net/tools
parentbc0c5176598283115a1267d6e4cde76592527896 (diff)
downloadchromium_src-e72b11f7fa92b7233bde9e75170499e768f4dbb4.zip
chromium_src-e72b11f7fa92b7233bde9e75170499e768f4dbb4.tar.gz
chromium_src-e72b11f7fa92b7233bde9e75170499e768f4dbb4.tar.bz2
Quick hack to make the dump_cache work again. The URL
cracker won't parse our URLs that start with "GEThttp:" properly. BUG=none TEST=none Review URL: http://codereview.chromium.org/1572036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45603 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r--net/tools/dump_cache/cache_dumper.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/tools/dump_cache/cache_dumper.cc b/net/tools/dump_cache/cache_dumper.cc
index 1120817..20ba6b5 100644
--- a/net/tools/dump_cache/cache_dumper.cc
+++ b/net/tools/dump_cache/cache_dumper.cc
@@ -64,7 +64,10 @@ bool SafeCreateDirectory(const std::wstring& path) {
bool DiskDumper::CreateEntry(const std::string& key,
disk_cache::Entry** entry) {
FilePath path(path_);
- entry_path_ = net::UrlToFilenameEncoder::Encode(key, path);
+ // The URL may not start with a valid protocol; search for it.
+ int urlpos = key.find("http");
+ std::string url = urlpos > 0 ? key.substr(urlpos) : key;
+ entry_path_ = net::UrlToFilenameEncoder::Encode(url, path);
#ifdef WIN32_LARGE_FILENAME_SUPPORT
// In order for long filenames to work, we'll need to prepend