Move the IsSupported* mime functions out of //net and into //components/mime_util
Fundamentally, the question of "Is mime type X supported" is a question
about what the embedder supports. There's a variety of platform-specific
logic already encompassed in this code, particularly around media types
(which are not yet extracted), while handling for items such as images
are just "assumed" that the embedder will support them, because Blink
supports them.
Since these aren't questions about the //net stack's support, nor are
these functions actually used by //net, uplift these to //components.
The media team will extract the remaining functions related to audio,
video, and codec support up out of //net and into //media, at which
point, //net will no longer worry about these.
Note that this is more of a manual move - it intentionally does not
correct some of the "obvious" misuses - to facilitate //media owning
the media move.
BUG=318217
TBR=jochen
Review URL: https://codereview.chromium.org/1110833003
Cr-Commit-Position: refs/heads/master@{#327640}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 6228fbf..5cb758e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -18,6 +18,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
+#include "components/mime_util/mime_util.h"
#include "content/browser/accessibility/accessibility_mode_helper.h"
#include "content/browser/accessibility/browser_accessibility_state_impl.h"
#include "content/browser/bad_message.h"
@@ -91,7 +92,6 @@
#include "content/public/common/url_constants.h"
#include "content/public/common/url_utils.h"
#include "content/public/common/web_preferences.h"
-#include "net/base/mime_util.h"
#include "net/base/net_util.h"
#include "net/http/http_cache.h"
#include "net/http/http_transaction_factory.h"
@@ -2224,7 +2224,7 @@
contents_mime_type_ == "application/xhtml+xml" ||
contents_mime_type_ == "text/plain" ||
contents_mime_type_ == "text/css" ||
- net::IsSupportedJavascriptMimeType(contents_mime_type_.c_str());
+ mime_util::IsSupportedJavascriptMimeType(contents_mime_type_);
}
void WebContentsImpl::OnSavePage() {