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

Side by Side Diff: net/base/platform_mime_util_win.cc

Issue 1897033002: Reland 'Convert //net and //chromecast to std::unordered_*' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix TestDownloadRequestHandler Created 4 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 unified diff | Download patch
« no previous file with comments | « net/base/platform_mime_util_mac.mm ('k') | net/base/priority_queue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/platform_mime_util.h" 5 #include "net/base/platform_mime_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/win/registry.h" 10 #include "base/win/registry.h"
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 // Strip off the leading dot, this should always be the case. 36 // Strip off the leading dot, this should always be the case.
37 if (!ext->empty() && ext->at(0) == L'.') 37 if (!ext->empty() && ext->at(0) == L'.')
38 ext->erase(ext->begin()); 38 ext->erase(ext->begin());
39 39
40 return true; 40 return true;
41 } 41 }
42 42
43 void PlatformMimeUtil::GetPlatformExtensionsForMimeType( 43 void PlatformMimeUtil::GetPlatformExtensionsForMimeType(
44 const std::string& mime_type, 44 const std::string& mime_type,
45 base::hash_set<base::FilePath::StringType>* extensions) const { 45 std::unordered_set<base::FilePath::StringType>* extensions) const {
46 // Multiple extensions could have the given mime type specified as their types 46 // Multiple extensions could have the given mime type specified as their types
47 // in their 'HKCR\.<extension>\Content Type' keys. Iterating all the HKCR 47 // in their 'HKCR\.<extension>\Content Type' keys. Iterating all the HKCR
48 // entries, though, is wildly impractical. Cheat by returning just the 48 // entries, though, is wildly impractical. Cheat by returning just the
49 // preferred extension. 49 // preferred extension.
50 base::FilePath::StringType ext; 50 base::FilePath::StringType ext;
51 if (GetPreferredExtensionForMimeType(mime_type, &ext)) 51 if (GetPreferredExtensionForMimeType(mime_type, &ext))
52 extensions->insert(ext); 52 extensions->insert(ext);
53 } 53 }
54 54
55 } // namespace net 55 } // namespace net
OLDNEW
« no previous file with comments | « net/base/platform_mime_util_mac.mm ('k') | net/base/priority_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698