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

Unified Diff: trunk/src/apps/launcher.cc

Issue 240313002: Revert 264167 "Sniff MIME type for files which have unknown exte..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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 | « no previous file | trunk/src/chrome/browser/apps/app_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/apps/launcher.cc
===================================================================
--- trunk/src/apps/launcher.cc (revision 264191)
+++ trunk/src/apps/launcher.cc (working copy)
@@ -29,8 +29,6 @@
#include "extensions/common/extension.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_handlers/kiosk_mode_info.h"
-#include "net/base/filename_util.h"
-#include "net/base/mime_sniffer.h"
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
#include "url/gurl.h"
@@ -183,21 +181,8 @@
}
std::string mime_type;
- if (!net::GetMimeTypeFromFile(file_path_, &mime_type)) {
- // If MIME type of the file can't be determined by its path,
- // try to sniff it by its content.
- std::vector<char> content(net::kMaxBytesToSniff);
- int bytes_read = base::ReadFile(file_path_, &content[0], content.size());
- if (bytes_read >= 0) {
- net::SniffMimeType(&content[0],
- bytes_read,
- net::FilePathToFileURL(file_path_),
- std::string(), // type_hint (passes no hint)
- &mime_type);
- }
- if (mime_type.empty())
- mime_type = kFallbackMimeType;
- }
+ if (!net::GetMimeTypeFromFile(file_path_, &mime_type))
+ mime_type = kFallbackMimeType;
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
&PlatformAppPathLauncher::LaunchWithMimeType, this, mime_type));
« no previous file with comments | « no previous file | trunk/src/chrome/browser/apps/app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698