OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/update_client/background_downloader_win.h" | 5 #include "components/update_client/background_downloader_win.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 #include <atlcom.h> | 8 #include <atlcom.h> |
| 9 #include <objbase.h> |
9 #include <stddef.h> | 10 #include <stddef.h> |
10 | 11 |
11 #include <stdint.h> | 12 #include <stdint.h> |
12 #include <functional> | 13 #include <functional> |
13 #include <iomanip> | 14 #include <iomanip> |
14 #include <limits> | 15 #include <limits> |
15 #include <memory> | 16 #include <memory> |
16 #include <utility> | 17 #include <utility> |
17 #include <vector> | 18 #include <vector> |
18 | 19 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 HRESULT GetGit(ScopedComPtr<IGlobalInterfaceTable>* git) { | 134 HRESULT GetGit(ScopedComPtr<IGlobalInterfaceTable>* git) { |
134 return git->CreateInstance(CLSID_StdGlobalInterfaceTable, NULL, | 135 return git->CreateInstance(CLSID_StdGlobalInterfaceTable, NULL, |
135 CLSCTX_INPROC_SERVER); | 136 CLSCTX_INPROC_SERVER); |
136 } | 137 } |
137 | 138 |
138 // Retrieves an interface pointer from the process GIT for a given |cookie|. | 139 // Retrieves an interface pointer from the process GIT for a given |cookie|. |
139 template <typename T> | 140 template <typename T> |
140 HRESULT GetInterfaceFromGit(const ScopedComPtr<IGlobalInterfaceTable>& git, | 141 HRESULT GetInterfaceFromGit(const ScopedComPtr<IGlobalInterfaceTable>& git, |
141 DWORD cookie, | 142 DWORD cookie, |
142 ScopedComPtr<T>* p) { | 143 ScopedComPtr<T>* p) { |
143 return git->GetInterfaceFromGlobal(cookie, __uuidof(T), p->ReceiveVoid()); | 144 return git->GetInterfaceFromGlobal(cookie, IID_PPV_ARGS(p)); |
144 } | 145 } |
145 | 146 |
146 // Registers an interface pointer in GIT and returns its corresponding |cookie|. | 147 // Registers an interface pointer in GIT and returns its corresponding |cookie|. |
147 template <typename T> | 148 template <typename T> |
148 HRESULT RegisterInterfaceInGit(const ScopedComPtr<IGlobalInterfaceTable>& git, | 149 HRESULT RegisterInterfaceInGit(const ScopedComPtr<IGlobalInterfaceTable>& git, |
149 const ScopedComPtr<T>& p, | 150 const ScopedComPtr<T>& p, |
150 DWORD* cookie) { | 151 DWORD* cookie) { |
151 return git->RegisterInterfaceInGlobal(p.Get(), __uuidof(T), cookie); | 152 return git->RegisterInterfaceInGlobal(p.Get(), __uuidof(T), cookie); |
152 } | 153 } |
153 | 154 |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 | 876 |
876 for (auto cookie : cookies) { | 877 for (auto cookie : cookies) { |
877 // TODO(sorin): check the result of the call, see crbug.com/644857. | 878 // TODO(sorin): check the result of the call, see crbug.com/644857. |
878 git->RevokeInterfaceFromGlobal(cookie); | 879 git->RevokeInterfaceFromGlobal(cookie); |
879 } | 880 } |
880 | 881 |
881 return S_OK; | 882 return S_OK; |
882 } | 883 } |
883 | 884 |
884 } // namespace update_client | 885 } // namespace update_client |
OLD | NEW |