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

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: cast length explicitly 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
« no previous file with comments | « mojo/shell/BUILD.gn ('k') | mojo/shell/dynamic_application_loader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/dynamic_application_loader.cc
diff --git a/mojo/shell/dynamic_application_loader.cc b/mojo/shell/dynamic_application_loader.cc
index 719a23f3ab38140750e6c4d933ea9cbbf1efcb19..eae422d10f274ffae735460f3d04b3017baaf868 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(
+ 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::FilePath path(decoded_path);
+#else
+ base::FilePath path(base::UTF16ToUTF8(decoded_path));
+#endif
// Async for consistency with network case.
base::MessageLoop::current()->PostTask(
« no previous file with comments | « mojo/shell/BUILD.gn ('k') | mojo/shell/dynamic_application_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698