OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_frame/bind_status_callback_impl.h" | 5 #include "chrome_frame/bind_status_callback_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
11 | 11 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 Release(); | 59 Release(); |
60 | 60 |
61 return hr; | 61 return hr; |
62 } | 62 } |
63 | 63 |
64 // IServiceProvider | 64 // IServiceProvider |
65 HRESULT BSCBImpl::QueryService(REFGUID service, REFIID iid, void** object) { | 65 HRESULT BSCBImpl::QueryService(REFGUID service, REFIID iid, void** object) { |
66 HRESULT hr = E_NOINTERFACE; | 66 HRESULT hr = E_NOINTERFACE; |
67 if (delegate_) { | 67 if (delegate_) { |
68 ScopedComPtr<IServiceProvider> svc; | 68 base::win::ScopedComPtr<IServiceProvider> svc; |
69 svc.QueryFrom(delegate_); | 69 svc.QueryFrom(delegate_); |
70 if (svc) { | 70 if (svc) { |
71 hr = svc->QueryService(service, iid, object); | 71 hr = svc->QueryService(service, iid, object); |
72 } | 72 } |
73 } | 73 } |
74 return hr; | 74 return hr; |
75 } | 75 } |
76 | 76 |
77 // IBindStatusCallback | 77 // IBindStatusCallback |
78 HRESULT BSCBImpl::OnStartBinding(DWORD reserved, IBinding* binding) { | 78 HRESULT BSCBImpl::OnStartBinding(DWORD reserved, IBinding* binding) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 return hr; | 152 return hr; |
153 } | 153 } |
154 | 154 |
155 // IBindStatusCallbackEx | 155 // IBindStatusCallbackEx |
156 HRESULT BSCBImpl::GetBindInfoEx(DWORD* bindf, BINDINFO* bind_info, | 156 HRESULT BSCBImpl::GetBindInfoEx(DWORD* bindf, BINDINFO* bind_info, |
157 DWORD* bindf2, DWORD* reserved) { | 157 DWORD* bindf2, DWORD* reserved) { |
158 DVLOG(1) << __FUNCTION__ << me() | 158 DVLOG(1) << __FUNCTION__ << me() |
159 << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId()); | 159 << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId()); |
160 HRESULT hr = S_OK; | 160 HRESULT hr = S_OK; |
161 if (delegate_) { | 161 if (delegate_) { |
162 ScopedComPtr<IBindStatusCallbackEx> bscbex; | 162 base::win::ScopedComPtr<IBindStatusCallbackEx> bscbex; |
163 bscbex.QueryFrom(delegate_); | 163 bscbex.QueryFrom(delegate_); |
164 if (bscbex) | 164 if (bscbex) |
165 hr = bscbex->GetBindInfoEx(bindf, bind_info, bindf2, reserved); | 165 hr = bscbex->GetBindInfoEx(bindf, bind_info, bindf2, reserved); |
166 } | 166 } |
167 return hr; | 167 return hr; |
168 } | 168 } |
169 | 169 |
170 HRESULT BSCBImpl::BeginningTransaction(LPCWSTR url, LPCWSTR headers, | 170 HRESULT BSCBImpl::BeginningTransaction(LPCWSTR url, LPCWSTR headers, |
171 DWORD reserved, | 171 DWORD reserved, |
172 LPWSTR* additional_headers) { | 172 LPWSTR* additional_headers) { |
173 DVLOG(1) << __FUNCTION__ << me() | 173 DVLOG(1) << __FUNCTION__ << me() |
174 << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId()); | 174 << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId()); |
175 | 175 |
176 HRESULT hr = S_OK; | 176 HRESULT hr = S_OK; |
177 if (delegate_) { | 177 if (delegate_) { |
178 ScopedComPtr<IHttpNegotiate> http_negotiate; | 178 base::win::ScopedComPtr<IHttpNegotiate> http_negotiate; |
179 http_negotiate.QueryFrom(delegate_); | 179 http_negotiate.QueryFrom(delegate_); |
180 if (http_negotiate) { | 180 if (http_negotiate) { |
181 hr = http_negotiate->BeginningTransaction(url, headers, reserved, | 181 hr = http_negotiate->BeginningTransaction(url, headers, reserved, |
182 additional_headers); | 182 additional_headers); |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 DLOG_IF(ERROR, FAILED(hr)) << __FUNCTION__; | 186 DLOG_IF(ERROR, FAILED(hr)) << __FUNCTION__; |
187 return hr; | 187 return hr; |
188 } | 188 } |
189 | 189 |
190 HRESULT BSCBImpl::OnResponse(DWORD response_code, LPCWSTR response_headers, | 190 HRESULT BSCBImpl::OnResponse(DWORD response_code, LPCWSTR response_headers, |
191 LPCWSTR request_headers, | 191 LPCWSTR request_headers, |
192 LPWSTR* additional_headers) { | 192 LPWSTR* additional_headers) { |
193 DVLOG(1) << __FUNCTION__ << me() | 193 DVLOG(1) << __FUNCTION__ << me() |
194 << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId()); | 194 << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId()); |
195 | 195 |
196 HRESULT hr = S_OK; | 196 HRESULT hr = S_OK; |
197 if (delegate_) { | 197 if (delegate_) { |
198 ScopedComPtr<IHttpNegotiate> http_negotiate; | 198 base::win::ScopedComPtr<IHttpNegotiate> http_negotiate; |
199 http_negotiate.QueryFrom(delegate_); | 199 http_negotiate.QueryFrom(delegate_); |
200 if (http_negotiate) { | 200 if (http_negotiate) { |
201 hr = http_negotiate->OnResponse(response_code, response_headers, | 201 hr = http_negotiate->OnResponse(response_code, response_headers, |
202 request_headers, additional_headers); | 202 request_headers, additional_headers); |
203 } | 203 } |
204 } | 204 } |
205 return hr; | 205 return hr; |
206 } | 206 } |
207 | 207 |
208 HRESULT BSCBImpl::GetRootSecurityId(BYTE* security_id, DWORD* security_id_size, | 208 HRESULT BSCBImpl::GetRootSecurityId(BYTE* security_id, DWORD* security_id_size, |
209 DWORD_PTR reserved) { | 209 DWORD_PTR reserved) { |
210 HRESULT hr = S_OK; | 210 HRESULT hr = S_OK; |
211 if (delegate_) { | 211 if (delegate_) { |
212 ScopedComPtr<IHttpNegotiate2> http_negotiate; | 212 base::win::ScopedComPtr<IHttpNegotiate2> http_negotiate; |
213 http_negotiate.QueryFrom(delegate_); | 213 http_negotiate.QueryFrom(delegate_); |
214 if (http_negotiate) { | 214 if (http_negotiate) { |
215 hr = http_negotiate->GetRootSecurityId(security_id, security_id_size, | 215 hr = http_negotiate->GetRootSecurityId(security_id, security_id_size, |
216 reserved); | 216 reserved); |
217 } | 217 } |
218 } | 218 } |
219 return hr; | 219 return hr; |
220 } | 220 } |
221 | 221 |
222 HRESULT BSCBImpl::GetSerializedClientCertContext(BYTE** cert, | 222 HRESULT BSCBImpl::GetSerializedClientCertContext(BYTE** cert, |
223 DWORD* cert_size) { | 223 DWORD* cert_size) { |
224 HRESULT hr = S_OK; | 224 HRESULT hr = S_OK; |
225 if (delegate_) { | 225 if (delegate_) { |
226 ScopedComPtr<IHttpNegotiate3> http_negotiate; | 226 base::win::ScopedComPtr<IHttpNegotiate3> http_negotiate; |
227 http_negotiate.QueryFrom(delegate_); | 227 http_negotiate.QueryFrom(delegate_); |
228 if (http_negotiate) { | 228 if (http_negotiate) { |
229 return http_negotiate->GetSerializedClientCertContext(cert, cert_size); | 229 return http_negotiate->GetSerializedClientCertContext(cert, cert_size); |
230 } | 230 } |
231 } | 231 } |
232 return hr; | 232 return hr; |
233 } | 233 } |
OLD | NEW |