summaryrefslogtreecommitdiffstats
path: root/net/base/mime_util.cc
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-10 02:55:27 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-10 02:55:27 +0000
commit4c1b9d4ed541c28e0f7e8b99025f37f4d210c90e (patch)
tree61dc9bdef50b2e7c5d96a4e3915d65a460cda8f4 /net/base/mime_util.cc
parentf57f28bc5f898518083c10a05f779e31275b7b31 (diff)
downloadchromium_src-4c1b9d4ed541c28e0f7e8b99025f37f4d210c90e.zip
chromium_src-4c1b9d4ed541c28e0f7e8b99025f37f4d210c90e.tar.gz
chromium_src-4c1b9d4ed541c28e0f7e8b99025f37f4d210c90e.tar.bz2
Add a stubbed-out platform_mime_util_mac.mm
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@636 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/mime_util.cc')
-rw-r--r--net/base/mime_util.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index 0221fc8..9e98145 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -27,12 +27,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <hash_set>
-#include <string.h>
+#include <string>
#include "net/base/mime_util.h"
#include "net/base/platform_mime_util.h"
+#include "base/hash_tables.h"
#include "base/logging.h"
#include "base/singleton.h"
#include "base/string_util.h"
@@ -71,7 +71,7 @@ private:
// For faster lookup, keep hash sets.
void InitializeMimeTypeMaps();
- typedef stdext::hash_set<std::string> MimeMappings;
+ typedef base::hash_set<std::string> MimeMappings;
MimeMappings image_map_;
MimeMappings non_image_map_;
MimeMappings javascript_map_;
@@ -124,7 +124,8 @@ static const char* FindMimeType(const MimeInfo* mappings,
const char* extensions = mappings[i].extensions;
for (;;) {
size_t end_pos = strcspn(extensions, ",");
- if (end_pos == ext_len && _strnicmp(extensions, ext, ext_len) == 0)
+ if (end_pos == ext_len &&
+ base::strncasecmp(extensions, ext, ext_len) == 0)
return mappings[i].mime_type;
extensions += end_pos;
if (!*extensions)
@@ -168,6 +169,8 @@ bool MimeUtil::GetMimeTypeFromExtension(const wstring& ext,
bool MimeUtil::GetMimeTypeFromFile(const wstring& file_path,
string* result) const {
+ // TODO(ericroman): this doesn't work properly with paths like
+ // /home/foo/.ssh/known_hosts
wstring::size_type dot = file_path.find_last_of('.');
if (dot == wstring::npos)
return false;