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_context_info.h" | 5 #include "chrome_frame/bind_context_info.h" |
6 #include "chrome_frame/utils.h" | 6 #include "chrome_frame/utils.h" |
7 | 7 |
8 // This is non const due to API expectations | 8 // This is non const due to API expectations |
9 static wchar_t* kBindContextInfo = L"_CHROMEFRAME_BIND_CONTEXT_INFO_"; | 9 static wchar_t* kBindContextInfo = L"_CHROMEFRAME_BIND_CONTEXT_INFO_"; |
10 | 10 |
11 // BindContextInfo member definitions. | 11 // BindContextInfo member definitions. |
(...skipping 20 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 HRESULT BindContextInfo::FromBindContext(IBindCtx* bind_context, | 34 HRESULT BindContextInfo::FromBindContext(IBindCtx* bind_context, |
35 BindContextInfo** info) { | 35 BindContextInfo** info) { |
36 DCHECK(info); | 36 DCHECK(info); |
37 if (!bind_context) { | 37 if (!bind_context) { |
38 NOTREACHED(); | 38 NOTREACHED(); |
39 return E_POINTER; | 39 return E_POINTER; |
40 } | 40 } |
41 | 41 |
42 ScopedComPtr<IUnknown> context; | 42 base::win::ScopedComPtr<IUnknown> context; |
43 HRESULT hr = bind_context->GetObjectParam(kBindContextInfo, | 43 HRESULT hr = bind_context->GetObjectParam(kBindContextInfo, |
44 context.Receive()); | 44 context.Receive()); |
45 if (context) { | 45 if (context) { |
46 ScopedComPtr<IBindContextInfoInternal> internal; | 46 base::win::ScopedComPtr<IBindContextInfoInternal> internal; |
47 hr = internal.QueryFrom(context); | 47 hr = internal.QueryFrom(context); |
48 if (SUCCEEDED(hr)) { | 48 if (SUCCEEDED(hr)) { |
49 hr = internal->GetCppObject(reinterpret_cast<void**>(info)); | 49 hr = internal->GetCppObject(reinterpret_cast<void**>(info)); |
50 DCHECK_EQ(hr, S_OK); | 50 DCHECK_EQ(hr, S_OK); |
51 DLOG_IF(ERROR, *info != static_cast<BindContextInfo*>(internal.get())) | 51 DLOG_IF(ERROR, *info != static_cast<BindContextInfo*>(internal.get())) |
52 << "marshalling took place!"; | 52 << "marshalling took place!"; |
53 } | 53 } |
54 } else { | 54 } else { |
55 DCHECK(FAILED(hr)); | 55 DCHECK(FAILED(hr)); |
56 CComObject<BindContextInfo>* bind_context_info = NULL; | 56 CComObject<BindContextInfo>* bind_context_info = NULL; |
(...skipping 21 matching lines...) Expand all Loading... |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 std::wstring BindContextInfo::GetUrl() { | 81 std::wstring BindContextInfo::GetUrl() { |
82 if (has_prot_data()) { | 82 if (has_prot_data()) { |
83 return prot_data_->url(); | 83 return prot_data_->url(); |
84 } | 84 } |
85 return std::wstring(); | 85 return std::wstring(); |
86 } | 86 } |
87 | 87 |
OLD | NEW |