Chromium Code Reviews| Index: net/base/net_util.cc |
| diff --git a/net/base/net_util.cc b/net/base/net_util.cc |
| index f7f11a687ba096438f77ceaa1c48d9af1a28aa69..ff712a4eaec43ece7ce726962dc243db81e02a6b 100644 |
| --- a/net/base/net_util.cc |
| +++ b/net/base/net_util.cc |
| @@ -998,6 +998,12 @@ GURL FilePathToFileURL(const base::FilePath& path) { |
| // "file://///server/path" for UNC. The URL canonicalizer will fix up the |
| // latter case to be the canonical UNC form: "file://server/path" |
| base::FilePath::StringType url_string(kFileURLPrefix); |
| + if (!path.IsAbsolute()) { |
| + base::FilePath current_dir; |
| + PathService::Get(base::DIR_CURRENT, ¤t_dir); |
| + url_string.append(current_dir.value()); |
| + url_string.append(1, base::FilePath::kSeparators[0]); |
|
wtc
2014/01/21 22:25:36
Nit: you can use push_back to append just one char
|
| + } |
| url_string.append(path.value()); |
| // Now do replacement of some characters. Since we assume the input is a |