Index: mojo/services/network/network_service_impl.cc |
diff --git a/mojo/services/network/network_service_impl.cc b/mojo/services/network/network_service_impl.cc |
index 661f7e0cf6f910523c69c04cf840e0633c2e89a6..1b77db3fca2318b2e6b465acaa02d1a52daa2709 100644 |
--- a/mojo/services/network/network_service_impl.cc |
+++ b/mojo/services/network/network_service_impl.cc |
@@ -12,6 +12,7 @@ |
#include "mojo/services/network/udp_socket_impl.h" |
#include "mojo/services/network/url_loader_impl.h" |
#include "mojo/services/network/web_socket_impl.h" |
+#include "net/base/mime_util.h" |
namespace mojo { |
@@ -78,4 +79,13 @@ void NetworkServiceImpl::CreateHttpServer( |
app_refcount_->Clone(), callback); |
} |
+void NetworkServiceImpl::GetMimeTypeFromFile( |
+ const mojo::String& file_path, |
+ const GetMimeTypeFromFileCallback& callback) { |
+ std::string mime; |
+ net::GetMimeTypeFromFile( |
+ base::FilePath::FromUTF8Unsafe(file_path.To<std::string>()), &mime); |
+ callback.Run(mime); |
+} |
+ |
} // namespace mojo |