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

Unified Diff: mojo/shell/application_manager.cc

Issue 1274433003: Add GetMimeTypeFromFile to Mojo's network service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix string usage and NativeApplicationLoaderTest. Created 5 years, 4 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/application_manager.h ('k') | mojo/shell/local_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/application_manager.cc
diff --git a/mojo/shell/application_manager.cc b/mojo/shell/application_manager.cc
index f71990b6a37775ae8357cde9e61aec4d5173649b..17de9de08a4ae9f42e48c67c27fbf0e05ec0963d 100644
--- a/mojo/shell/application_manager.cc
+++ b/mojo/shell/application_manager.cc
@@ -134,8 +134,13 @@ void ApplicationManager::ConnectToApplication(
}
if (resolved_url.SchemeIsFile()) {
+ // LocalFetcher uses the network service to infer MIME types from URLs.
+ // Skip this for mojo URLs to avoid recursively loading the network service.
+ if (!network_service_ && !requested_gurl.SchemeIs("mojo"))
+ ConnectToService(GURL("mojo:network_service"), &network_service_);
new LocalFetcher(
- resolved_url, GetBaseURLAndQuery(resolved_url, nullptr),
+ network_service_.get(), resolved_url,
+ GetBaseURLAndQuery(resolved_url, nullptr),
base::Bind(callback, NativeApplicationCleanup::DONT_DELETE));
return;
}
« no previous file with comments | « mojo/shell/application_manager.h ('k') | mojo/shell/local_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698