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

Side by Side Diff: chrome/browser/extensions/external_registry_extension_loader_win.cc

Issue 6090006: Regkey functions return error code instead of bool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/extensions/external_registry_extension_loader_win.h" 5 #include "chrome/browser/extensions/external_registry_extension_loader_win.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 42 CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
43 scoped_ptr<DictionaryValue> prefs(new DictionaryValue); 43 scoped_ptr<DictionaryValue> prefs(new DictionaryValue);
44 44
45 base::win::RegistryKeyIterator iterator( 45 base::win::RegistryKeyIterator iterator(
46 kRegRoot, ASCIIToWide(kRegistryExtensions).c_str()); 46 kRegRoot, ASCIIToWide(kRegistryExtensions).c_str());
47 while (iterator.Valid()) { 47 while (iterator.Valid()) {
48 base::win::RegKey key; 48 base::win::RegKey key;
49 std::wstring key_path = ASCIIToWide(kRegistryExtensions); 49 std::wstring key_path = ASCIIToWide(kRegistryExtensions);
50 key_path.append(L"\\"); 50 key_path.append(L"\\");
51 key_path.append(iterator.Name()); 51 key_path.append(iterator.Name());
52 if (key.Open(kRegRoot, key_path.c_str(), KEY_READ)) { 52 if (key.Open(kRegRoot, key_path.c_str(), KEY_READ) == ERROR_SUCCESS) {
53 std::wstring extension_path; 53 std::wstring extension_path;
54 if (key.ReadValue(kRegistryExtensionPath, &extension_path)) { 54 if (key.ReadValue(kRegistryExtensionPath, &extension_path)
55 == ERROR_SUCCESS) {
55 std::wstring extension_version; 56 std::wstring extension_version;
56 if (key.ReadValue(kRegistryExtensionVersion, &extension_version)) { 57 if (key.ReadValue(kRegistryExtensionVersion, &extension_version)
58 == ERROR_SUCCESS) {
57 std::string id = WideToASCII(iterator.Name()); 59 std::string id = WideToASCII(iterator.Name());
58 StringToLowerASCII(&id); 60 StringToLowerASCII(&id);
59 61
60 if (!Extension::IdIsValid(id)) { 62 if (!Extension::IdIsValid(id)) {
61 LOG(ERROR) << "Invalid id value " << id 63 LOG(ERROR) << "Invalid id value " << id
62 << " for key " << key_path << " ."; 64 << " for key " << key_path << " .";
63 ++iterator; 65 ++iterator;
64 continue; 66 continue;
65 } 67 }
66 68
(...skipping 27 matching lines...) Expand all
94 ++iterator; 96 ++iterator;
95 } 97 }
96 98
97 prefs_.reset(prefs.release()); 99 prefs_.reset(prefs.release());
98 BrowserThread::PostTask( 100 BrowserThread::PostTask(
99 BrowserThread::UI, FROM_HERE, 101 BrowserThread::UI, FROM_HERE,
100 NewRunnableMethod( 102 NewRunnableMethod(
101 this, 103 this,
102 &ExternalRegistryExtensionLoader::LoadFinished)); 104 &ExternalRegistryExtensionLoader::LoadFinished));
103 } 105 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_rlz_apitest.cc ('k') | chrome/browser/first_run/first_run_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698