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

Unified Diff: mojo/shell/mojo_url_resolver.cc

Issue 327523004: Introduce very beginning of navigation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add url dependency to two smaple apps Created 6 years, 6 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/services/navigation/navigation.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/mojo_url_resolver.cc
diff --git a/mojo/shell/mojo_url_resolver.cc b/mojo/shell/mojo_url_resolver.cc
index 63a8b570330b1650bd4dd4bc9f94abf78b3fcd32..9591b1df142b76cb8321f59aa216e8fab47e559c 100644
--- a/mojo/shell/mojo_url_resolver.cc
+++ b/mojo/shell/mojo_url_resolver.cc
@@ -9,18 +9,19 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "net/base/filename_util.h"
+#include "url/url_util.h"
namespace mojo {
namespace shell {
namespace {
-std::string MakeSharedLibraryName(const std::string& file_name) {
+std::string MakeSharedLibraryName(const std::string& host_name) {
#if defined(OS_WIN)
- return file_name + ".dll";
+ return host_name + ".dll";
#elif defined(OS_LINUX)
- return "lib" + file_name + ".so";
+ return "lib" + host_name + ".so";
#elif defined(OS_MACOSX)
- return "lib" + file_name + ".dylib";
+ return "lib" + host_name + ".dylib";
#else
NOTREACHED() << "dynamic loading of services not supported";
return std::string();
@@ -30,6 +31,8 @@ std::string MakeSharedLibraryName(const std::string& file_name) {
} // namespace
MojoURLResolver::MojoURLResolver() {
+ // Needed to treat first component of mojo URLs as host, not path.
+ url::AddStandardScheme("mojo");
}
MojoURLResolver::~MojoURLResolver() {
@@ -49,7 +52,7 @@ GURL MojoURLResolver::Resolve(const GURL& mojo_url) const {
if (it != url_map_.end())
return it->second;
- std::string lib = MakeSharedLibraryName(mojo_url.ExtractFileName());
+ std::string lib = MakeSharedLibraryName(mojo_url.host());
if (local_file_set_.find(mojo_url) != local_file_set_.end()) {
// Resolve to a local file URL.
« no previous file with comments | « mojo/services/navigation/navigation.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698