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

Unified Diff: mojo/shell/mojo_url_resolver.cc

Issue 397733003: mojo: kill app_thread before unloading main app library and add tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/mojo_url_resolver.cc
diff --git a/mojo/shell/mojo_url_resolver.cc b/mojo/shell/mojo_url_resolver.cc
index daa91639ecc6186d23573c505471a43fb451d362..8563b948067eb4fc934734a256707c3b917c4af5 100644
--- a/mojo/shell/mojo_url_resolver.cc
+++ b/mojo/shell/mojo_url_resolver.cc
@@ -38,6 +38,16 @@ MojoURLResolver::MojoURLResolver() {
MojoURLResolver::~MojoURLResolver() {
}
+void MojoURLResolver::SetOrigin(const std::string& origin) {
viettrungluu 2014/07/15 22:44:53 I wonder if "origin" is not the appropriate term.
tim (not reviewing) 2014/07/19 02:11:37 Done.
+ DCHECK(!origin.empty());
+ // Force a trailing slash on the origin to simplify resolving
+ // relative files and URLs below.
+ if (*origin.rbegin() != '/')
+ origin_ = GURL(origin + '/');
+ else
+ origin_ = GURL(origin);
+}
+
void MojoURLResolver::AddCustomMapping(const GURL& mojo_url,
const GURL& resolved_url) {
url_map_[mojo_url] = resolved_url;
@@ -63,7 +73,7 @@ GURL MojoURLResolver::Resolve(const GURL& mojo_url) const {
}
// Otherwise, resolve to an URL relative to origin_.
- return GURL(origin_ + "/" + lib);
+ return origin_.Resolve(lib);
}
} // namespace shell

Powered by Google App Engine
This is Rietveld 408576698