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

Unified Diff: shell/context.cc

Issue 926093003: AddOriginMapping() (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Try removing const Created 5 years, 10 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: shell/context.cc
diff --git a/shell/context.cc b/shell/context.cc
index 94b71f4c37f9a1f7c567ee8e1ac616ee6746f30d..a4baddb9b9a57e5c1aa2ad98533b3003987e2bfc 100644
--- a/shell/context.cc
+++ b/shell/context.cc
@@ -28,6 +28,7 @@
#include "services/tracing/tracing.mojom.h"
#include "shell/application_manager/application_loader.h"
#include "shell/application_manager/application_manager.h"
+#include "shell/command_line_util.h"
#include "shell/dynamic_application_loader.h"
#include "shell/external_application_listener.h"
#include "shell/filename_util.h"
@@ -127,6 +128,12 @@ bool ConfigureURLMappings(base::CommandLine* command_line, Context* context) {
context->ResolveShellFileURL("file:network_service.mojo"));
// Command line URL mapping.
+ std::vector<URLResolver::OriginMapping> origin_mappings =
+ URLResolver::GetOriginMappings(command_line->argv());
+ for (const auto& origin_mapping : origin_mappings)
+ resolver->AddOriginMapping(GURL(origin_mapping.origin),
+ GURL(origin_mapping.base_url));
+
if (command_line->HasSwitch(switches::kURLMappings)) {
const std::string mappings =
command_line->GetSwitchValueASCII(switches::kURLMappings);
@@ -274,7 +281,7 @@ GURL Context::ResolveURL(const GURL& url) {
}
GURL Context::ResolveMappings(const GURL& url) {
- return url_resolver_.ApplyURLMappings(url);
+ return url_resolver_.ApplyMappings(url);
}
void Context::Run(const GURL& url) {
« services/console/console.cc ('K') | « services/console/console.cc ('k') | shell/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698