Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_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 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 } | 40 } |
| 41 | 41 |
| 42 ScopedComPtr<IUnknown> context; | 42 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 ScopedComPtr<IBindContextInfoInternal> internal; |
| 47 hr = internal.QueryFrom(context); | 47 hr = internal.QueryFrom(context); |
| 48 DCHECK(SUCCEEDED(hr)); | 48 DCHECK(SUCCEEDED(hr)); |
| 49 if (SUCCEEDED(hr)) { | 49 if (SUCCEEDED(hr)) { |
| 50 BindContextInfo* ret = NULL; | 50 BindContextInfo* ret = NULL; |
|
stoyan
2010/05/19 18:54:49
Well, now ret variable is unused.
I though the DLO
| |
| 51 hr = internal->GetCppObject(reinterpret_cast<void**>(info)); | 51 hr = internal->GetCppObject(reinterpret_cast<void**>(info)); |
| 52 DCHECK_EQ(hr, S_OK); | 52 DCHECK_EQ(hr, S_OK); |
| 53 DLOG_IF(ERROR, reinterpret_cast<void*>(ret) != | |
| 54 reinterpret_cast<void*>(internal.get())) | |
| 55 << "marshalling took place!"; | |
| 56 } | 53 } |
| 57 } else { | 54 } else { |
| 58 DCHECK(FAILED(hr)); | 55 DCHECK(FAILED(hr)); |
| 59 CComObject<BindContextInfo>* bind_context_info = NULL; | 56 CComObject<BindContextInfo>* bind_context_info = NULL; |
| 60 hr = CComObject<BindContextInfo>::CreateInstance(&bind_context_info); | 57 hr = CComObject<BindContextInfo>::CreateInstance(&bind_context_info); |
| 61 DCHECK(bind_context_info != NULL); | 58 DCHECK(bind_context_info != NULL); |
| 62 if (bind_context_info) { | 59 if (bind_context_info) { |
| 63 bind_context_info->AddRef(); | 60 bind_context_info->AddRef(); |
| 64 hr = bind_context_info->Initialize(bind_context); | 61 hr = bind_context_info->Initialize(bind_context); |
| 65 if (FAILED(hr)) { | 62 if (FAILED(hr)) { |
| 66 bind_context_info->Release(); | 63 bind_context_info->Release(); |
| 67 } else { | 64 } else { |
| 68 *info = bind_context_info; | 65 *info = bind_context_info; |
| 69 } | 66 } |
| 70 } | 67 } |
| 71 } | 68 } |
| 72 | 69 |
| 73 return hr; | 70 return hr; |
| 74 } | 71 } |
| 75 | 72 |
| 76 void BindContextInfo::SetToSwitch(IStream* cache) { | 73 void BindContextInfo::SetToSwitch(IStream* cache) { |
| 77 is_switching_ = true; | 74 is_switching_ = true; |
| 78 if (!no_cache_) { | 75 if (!no_cache_) { |
| 79 cache_ = cache; | 76 cache_ = cache; |
| 80 RewindStream(cache_); | 77 RewindStream(cache_); |
| 81 } | 78 } |
| 82 } | 79 } |
| 83 | 80 |
| OLD | NEW |