summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 02:13:43 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 02:13:43 +0000
commit87e70062789c3695762c0ddaca1a759e8834398a (patch)
tree613a0a5fb74bc0ca8417976788fcce2666753d23 /net/base
parentb5ff342a5aca83396114933152ad5d644f536375 (diff)
downloadchromium_src-87e70062789c3695762c0ddaca1a759e8834398a.zip
chromium_src-87e70062789c3695762c0ddaca1a759e8834398a.tar.gz
chromium_src-87e70062789c3695762c0ddaca1a759e8834398a.tar.bz2
Cleanup Registry API: part 3.
- Remove the default arguments from the constructor. - Add a empty constructor to handle the case of the default arguments were used. BUG=44644 TEST=trybots Review URL: http://codereview.chromium.org/3172009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56123 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/platform_mime_util_win.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/base/platform_mime_util_win.cc b/net/base/platform_mime_util_win.cc
index 26d924b..bffb81a 100644
--- a/net/base/platform_mime_util_win.cc
+++ b/net/base/platform_mime_util_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -16,7 +16,8 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
// check windows registry for file extension's mime type (registry key
// names are not case-sensitive).
std::wstring value, key = L"." + ext;
- RegKey(HKEY_CLASSES_ROOT, key.c_str()).ReadValue(L"Content Type", &value);
+ RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(L"Content Type",
+ &value);
if (!value.empty()) {
*result = WideToUTF8(value);
return true;
@@ -27,9 +28,10 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
bool PlatformMimeUtil::GetPreferredExtensionForMimeType(
const std::string& mime_type, FilePath::StringType* ext) const {
std::wstring key(L"MIME\\Database\\Content Type\\" + UTF8ToWide(mime_type));
- if (!RegKey(HKEY_CLASSES_ROOT, key.c_str()).ReadValue(L"Extension", ext))
+ if (!RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(L"Extension",
+ ext)) {
return false;
-
+ }
// Strip off the leading dot, this should always be the case.
if (!ext->empty() && ext->at(0) == L'.')
ext->erase(ext->begin());