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

Unified Diff: net/base/platform_mime_util_win.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: net/base/platform_mime_util_win.cc
diff --git a/net/base/platform_mime_util_win.cc b/net/base/platform_mime_util_win.cc
index fcac48faab53e3c10e0b12555a2c42edf720e444..9aaf609575872c41fdc6a79a01508bd3907d7cd0 100644
--- a/net/base/platform_mime_util_win.cc
+++ b/net/base/platform_mime_util_win.cc
@@ -12,12 +12,13 @@
namespace net {
bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
- const base::FilePath::StringType& ext, std::string* result) const {
+ const base::FilePath::StringType& ext,
+ std::string* result) const {
// check windows registry for file extension's mime type (registry key
// names are not case-sensitive).
std::wstring value, key = L"." + ext;
- base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(
- L"Content Type", &value);
+ base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ)
+ .ReadValue(L"Content Type", &value);
if (!value.empty()) {
*result = base::WideToUTF8(value);
return true;
@@ -26,11 +27,12 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
}
bool PlatformMimeUtil::GetPreferredExtensionForMimeType(
- const std::string& mime_type, base::FilePath::StringType* ext) const {
- std::wstring key(
- L"MIME\\Database\\Content Type\\" + base::UTF8ToWide(mime_type));
- if (base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(
- L"Extension", ext) != ERROR_SUCCESS) {
+ const std::string& mime_type,
+ base::FilePath::StringType* ext) const {
+ std::wstring key(L"MIME\\Database\\Content Type\\" +
+ base::UTF8ToWide(mime_type));
+ if (base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ)
+ .ReadValue(L"Extension", ext) != ERROR_SUCCESS) {
return false;
}
// Strip off the leading dot, this should always be the case.

Powered by Google App Engine
This is Rietveld 408576698