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

Side by Side Diff: ceee/ie/plugin/toolband/toolband_proxy.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
« no previous file with comments | « ceee/ie/common/ie_util_unittest.cc ('k') | ceee/installer_dll/installer_helper.cc » ('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) 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 #include "ceee/ie/plugin/toolband/toolband_proxy.h" 4 #include "ceee/ie/plugin/toolband/toolband_proxy.h"
5 5
6 #include <atlbase.h> 6 #include <atlbase.h>
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/win/registry.h" 9 #include "base/win/registry.h"
10 #include "ceee/common/com_utils.h" 10 #include "ceee/common/com_utils.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 #ifndef NDEBUG 45 #ifndef NDEBUG
46 void CheckAsyncIidRegistered(const IID& iid, const IID& async_iid) { 46 void CheckAsyncIidRegistered(const IID& iid, const IID& async_iid) {
47 std::wstring iid_str; 47 std::wstring iid_str;
48 bool success = com::GuidToString(iid, &iid_str); 48 bool success = com::GuidToString(iid, &iid_str);
49 DCHECK(success); 49 DCHECK(success);
50 std::wstring key_name = base::StringPrintf( 50 std::wstring key_name = base::StringPrintf(
51 L"Interface\\%ls\\AsynchronousInterface", iid_str.c_str()); 51 L"Interface\\%ls\\AsynchronousInterface", iid_str.c_str());
52 52
53 base::win::RegKey key; 53 base::win::RegKey key;
54 if (key.Open(HKEY_CLASSES_ROOT, key_name.c_str(), KEY_READ)) { 54 if (key.Open(HKEY_CLASSES_ROOT, key_name.c_str(), KEY_READ) ==
55 ERROR_SUCCESS) {
55 // It's registered, the rest of this block is debug checking that 56 // It's registered, the rest of this block is debug checking that
56 // the correct IID is indeed registered for the async interface. 57 // the correct IID is indeed registered for the async interface.
57 std::wstring async_iid_str; 58 std::wstring async_iid_str;
58 DCHECK(key.ReadValue(NULL, &async_iid_str)); 59 DCHECK_EQ(ERROR_SUCCESS, key.ReadValue(NULL, &async_iid_str));
59 IID read_async_iid; 60 IID read_async_iid;
60 DCHECK(SUCCEEDED(::IIDFromString(async_iid_str.c_str(), &read_async_iid))); 61 DCHECK(SUCCEEDED(::IIDFromString(async_iid_str.c_str(), &read_async_iid)));
61 DCHECK(read_async_iid == async_iid); 62 DCHECK(read_async_iid == async_iid);
62 } else { 63 } else {
63 LOG(WARNING) << "Sync->Async IID not registered. Key=" << key_name; 64 LOG(WARNING) << "Sync->Async IID not registered. Key=" << key_name;
64 } 65 }
65 } 66 }
66 #endif // NDEBUG 67 #endif // NDEBUG
67 68
68 } // namespace 69 } // namespace
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 if (FAILED(hr)) { 142 if (FAILED(hr)) {
142 LOG(ERROR) << "Failed to register async interface for " << 143 LOG(ERROR) << "Failed to register async interface for " <<
143 info.name << com::LogHr(hr); 144 info.name << com::LogHr(hr);
144 return false; 145 return false;
145 } 146 }
146 } 147 }
147 } 148 }
148 149
149 return true; 150 return true;
150 } 151 }
OLDNEW
« no previous file with comments | « ceee/ie/common/ie_util_unittest.cc ('k') | ceee/installer_dll/installer_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698