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

Unified Diff: mojo/shell/application_manager/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: rename 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
Index: mojo/shell/application_manager/local_fetcher.cc
diff --git a/mojo/shell/application_manager/local_fetcher.cc b/mojo/shell/application_manager/local_fetcher.cc
index a8b889dcff0ed981693b92776aef6685f3e70b5a..91eec86f7f5f23cfb3f39fd15fee4981dafc55a7 100644
--- a/mojo/shell/application_manager/local_fetcher.cc
+++ b/mojo/shell/application_manager/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/shell/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_(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_;
}

Powered by Google App Engine
This is Rietveld 408576698