| Index: chrome/common/extensions/extension_file_util.cc
|
| diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc
|
| index 7c2a94ed1275e0150de06b4f060d460a5d5d6c9e..fd882cf9d2c014f4100ddb19f63036fe045c855c 100644
|
| --- a/chrome/common/extensions/extension_file_util.cc
|
| +++ b/chrome/common/extensions/extension_file_util.cc
|
| @@ -34,7 +34,6 @@
|
| #include "extensions/common/manifest_constants.h"
|
| #include "extensions/common/manifest_handler.h"
|
| #include "grit/generated_resources.h"
|
| -#include "net/base/escape.h"
|
| #include "net/base/file_stream.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
|
|
| @@ -493,49 +492,6 @@ bool CheckForIllegalFilenames(const base::FilePath& extension_path,
|
| return true;
|
| }
|
|
|
| -base::FilePath ExtensionURLToRelativeFilePath(const GURL& url) {
|
| - std::string url_path = url.path();
|
| - if (url_path.empty() || url_path[0] != '/')
|
| - return base::FilePath();
|
| -
|
| - // Drop the leading slashes and convert %-encoded UTF8 to regular UTF8.
|
| - std::string file_path = net::UnescapeURLComponent(url_path,
|
| - net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS);
|
| - size_t skip = file_path.find_first_not_of("/\\");
|
| - if (skip != file_path.npos)
|
| - file_path = file_path.substr(skip);
|
| -
|
| - base::FilePath path = base::FilePath::FromUTF8Unsafe(file_path);
|
| -
|
| - // It's still possible for someone to construct an annoying URL whose path
|
| - // would still wind up not being considered relative at this point.
|
| - // For example: chrome-extension://id/c:////foo.html
|
| - if (path.IsAbsolute())
|
| - return base::FilePath();
|
| -
|
| - return path;
|
| -}
|
| -
|
| -base::FilePath ExtensionResourceURLToFilePath(const GURL& url,
|
| - const base::FilePath& root) {
|
| - std::string host = net::UnescapeURLComponent(url.host(),
|
| - net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS);
|
| - if (host.empty())
|
| - return base::FilePath();
|
| -
|
| - base::FilePath relative_path = ExtensionURLToRelativeFilePath(url);
|
| - if (relative_path.empty())
|
| - return base::FilePath();
|
| -
|
| - base::FilePath path = root.AppendASCII(host).Append(relative_path);
|
| - if (!base::PathExists(path))
|
| - return base::FilePath();
|
| - path = base::MakeAbsoluteFilePath(path);
|
| - if (path.empty() || !root.IsParent(path))
|
| - return base::FilePath();
|
| - return path;
|
| -}
|
| -
|
| base::FilePath GetInstallTempDir(const base::FilePath& extensions_dir) {
|
| // We do file IO in this function, but only when the current profile's
|
| // Temp directory has never been used before, or in a rare error case.
|
|
|