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

Unified Diff: mojo/shell/dynamic_application_loader.cc

Issue 640403002: Drop refs to net::EmbeddedTestServer / net::File{Path,URL} utils in mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use DecodeURLEscapeSequences Created 6 years, 2 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/dynamic_application_loader.cc
diff --git a/mojo/shell/dynamic_application_loader.cc b/mojo/shell/dynamic_application_loader.cc
index 1f24cf37fb16024b3c232baecc746838f2f21271..06ed3f33127bd7538e732a11cc42951b9a85cb5e 100644
--- a/mojo/shell/dynamic_application_loader.cc
+++ b/mojo/shell/dynamic_application_loader.cc
@@ -11,12 +11,14 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
+#include "base/strings/utf_string_conversions.h"
#include "mojo/common/common_type_converters.h"
#include "mojo/common/data_pipe_utils.h"
#include "mojo/services/public/interfaces/network/url_loader.mojom.h"
#include "mojo/shell/context.h"
+#include "mojo/shell/filename_util.h"
#include "mojo/shell/switches.h"
-#include "net/base/filename_util.h"
+#include "url/url_util.h"
namespace mojo {
namespace shell {
@@ -92,8 +94,17 @@ class DynamicApplicationLoader::LocalLoader : public Loader {
load_callbacks,
loader_complete_callback),
weak_ptr_factory_(this) {
- base::FilePath path;
- net::FileURLToFilePath(url, &path);
+ DCHECK(url.SchemeIsFile());
+ url::RawCanonOutputW<1024> output;
+ url::DecodeURLEscapeSequences(
jamesr 2014/10/16 21:41:37 PTAL
+ url.path().data(), url.path().length(), &output);
+ base::string16 decoded_path =
+ base::string16(output.data(), output.length());
+#if defined(OS_WIN)
+ base::FilePath path(decoded_path);
+#else
+ base::FilePath path(base::UTF16ToUTF8(decoded_path));
+#endif
// Async for consistency with network case.
base::MessageLoop::current()->PostTask(

Powered by Google App Engine
This is Rietveld 408576698