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 // ICeeeBroker implementation | 5 // ICeeeBroker implementation |
6 | 6 |
7 #include "ceee/ie/broker/broker.h" | 7 #include "ceee/ie/broker/broker.h" |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ceee/ie/broker/api_dispatcher.h" | 10 #include "ceee/ie/broker/api_dispatcher.h" |
11 #include "ceee/ie/broker/chrome_postman.h" | 11 #include "ceee/ie/broker/chrome_postman.h" |
12 #include "ceee/ie/broker/executors_manager.h" | 12 #include "ceee/ie/broker/executors_manager.h" |
13 #include "ceee/ie/common/ceee_module_util.h" | 13 #include "ceee/ie/common/ceee_module_util.h" |
14 | 14 |
15 | 15 |
16 HRESULT CeeeBroker::FinalConstruct() { | 16 HRESULT CeeeBroker::FinalConstruct() { |
17 // So that we get a pointer to the ExecutorsManager and let tests override it. | 17 // So that we get a pointer to the ExecutorsManager and let tests override it. |
18 executors_manager_ = Singleton<ExecutorsManager, | 18 executors_manager_ = Singleton<ExecutorsManager, |
19 ExecutorsManager::SingletonTraits>::get(); | 19 ExecutorsManager::SingletonTraits>::get(); |
20 api_dispatcher_ = ProductionApiDispatcher::get(); | 20 api_dispatcher_ = ProductionApiDispatcher::get(); |
21 return S_OK; | 21 return S_OK; |
22 } | 22 } |
23 | 23 |
24 void CeeeBroker::OnAddConnection(bool first_lock) { | 24 void CeeeBroker::OnAddConnection(bool first_lock) { |
Sigurður Ásgeirsson
2010/11/11 19:30:35
Do we still need this?
Vitaly Buka corp
2010/11/11 23:12:10
Done.
| |
25 if (first_lock) | |
26 ceee_module_util::LockModule(); | |
27 } | 25 } |
28 | 26 |
29 void CeeeBroker::OnReleaseConnection(bool last_unlock, | 27 void CeeeBroker::OnReleaseConnection(bool last_unlock, |
30 bool last_unlock_releases) { | 28 bool last_unlock_releases) { |
31 if (last_unlock) | |
32 ceee_module_util::UnlockModule(); | |
33 IExternalConnectionImpl<CeeeBroker>::OnReleaseConnection( | 29 IExternalConnectionImpl<CeeeBroker>::OnReleaseConnection( |
34 last_unlock, last_unlock_releases); | 30 last_unlock, last_unlock_releases); |
35 } | 31 } |
36 | 32 |
37 STDMETHODIMP CeeeBroker::Execute(BSTR function, BSTR* response) { | 33 STDMETHODIMP CeeeBroker::Execute(BSTR function, BSTR* response) { |
38 // This is DEPRECATED and we should use ChromePostman (see FireEvent). | 34 // This is DEPRECATED and we should use ChromePostman (see FireEvent). |
39 api_dispatcher_->HandleApiRequest(function, response); | 35 api_dispatcher_->HandleApiRequest(function, response); |
40 return S_OK; | 36 return S_OK; |
41 } | 37 } |
42 | 38 |
(...skipping 20 matching lines...) Expand all Loading... | |
63 } | 59 } |
64 | 60 |
65 STDMETHODIMP CeeeBroker::SetTabIdForHandle(long tab_id, | 61 STDMETHODIMP CeeeBroker::SetTabIdForHandle(long tab_id, |
66 CeeeWindowHandle handle) { | 62 CeeeWindowHandle handle) { |
67 // TODO(mad@chromium.org): Add security check here. | 63 // TODO(mad@chromium.org): Add security check here. |
68 DCHECK(tab_id != kInvalidChromeSessionId && | 64 DCHECK(tab_id != kInvalidChromeSessionId && |
69 handle != reinterpret_cast<CeeeWindowHandle>(INVALID_HANDLE_VALUE)); | 65 handle != reinterpret_cast<CeeeWindowHandle>(INVALID_HANDLE_VALUE)); |
70 executors_manager_->SetTabIdForHandle(tab_id, reinterpret_cast<HWND>(handle)); | 66 executors_manager_->SetTabIdForHandle(tab_id, reinterpret_cast<HWND>(handle)); |
71 return S_OK; | 67 return S_OK; |
72 } | 68 } |
OLD | NEW |