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

Unified Diff: mojo/shell/local_fetcher.cc

Issue 1109993002: Adds support for mojo apps to live in their own directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to trunk and move filename_util to own dir Created 5 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/shell/local_fetcher.h ('k') | mojo/util/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/local_fetcher.cc
diff --git a/mojo/shell/local_fetcher.cc b/mojo/shell/local_fetcher.cc
index a945dc2f42bab8b0b36ae00d06805c3840017527..21eb718597579b2a5bb6444db99dfa8c7abf43d2 100644
--- a/mojo/shell/local_fetcher.cc
+++ b/mojo/shell/local_fetcher.cc
@@ -9,11 +9,11 @@
#include "base/format_macros.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "mojo/common/common_type_converters.h"
#include "mojo/common/data_pipe_utils.h"
#include "mojo/common/url_type_converters.h"
+#include "mojo/util/filename_util.h"
#include "url/url_util.h"
namespace mojo {
@@ -30,26 +30,13 @@ void IgnoreResult(bool result) {
LocalFetcher::LocalFetcher(const GURL& url,
const GURL& url_without_query,
const FetchCallback& loader_callback)
- : Fetcher(loader_callback), url_(url), path_(UrlToFile(url_without_query)) {
+ : Fetcher(loader_callback),
+ url_(url),
+ path_(util::UrlToFilePath(url_without_query)) {
TRACE_EVENT1("mojo_shell", "LocalFetcher::LocalFetcher", "url", url.spec());
loader_callback_.Run(make_scoped_ptr(this));
}
-base::FilePath LocalFetcher::UrlToFile(const GURL& url) {
- DCHECK(url.SchemeIsFile());
- url::RawCanonOutputW<1024> output;
- url::DecodeURLEscapeSequences(url.path().data(),
- static_cast<int>(url.path().length()), &output);
- base::string16 decoded_path = base::string16(output.data(), output.length());
-#if defined(OS_WIN)
- base::TrimString(decoded_path, L"/", &decoded_path);
- base::FilePath path(decoded_path);
-#else
- base::FilePath path(base::UTF16ToUTF8(decoded_path));
-#endif
- return path;
-}
-
const GURL& LocalFetcher::GetURL() const {
return url_;
}
« no previous file with comments | « mojo/shell/local_fetcher.h ('k') | mojo/util/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698