Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: ceee/ie/broker/broker.cc

Issue 5581008: Add a new GetInstance() method for singleton classes, take 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "ceee/common/com_utils.h" 11 #include "ceee/common/com_utils.h"
12 #include "ceee/ie/broker/api_dispatcher.h" 12 #include "ceee/ie/broker/api_dispatcher.h"
13 #include "ceee/ie/broker/chrome_postman.h" 13 #include "ceee/ie/broker/chrome_postman.h"
14 #include "ceee/ie/broker/executors_manager.h" 14 #include "ceee/ie/broker/executors_manager.h"
15 #include "ceee/ie/common/ceee_module_util.h" 15 #include "ceee/ie/common/ceee_module_util.h"
16 16
17 HRESULT CeeeBroker::FinalConstruct() { 17 HRESULT CeeeBroker::FinalConstruct() {
18 // So that we get a pointer to the ExecutorsManager and let tests override it. 18 // So that we get a pointer to the ExecutorsManager and let tests override it.
19 executors_manager_ = Singleton<ExecutorsManager, 19 executors_manager_ = ExecutorsManager::GetInstance();
20 ExecutorsManager::SingletonTraits>::get(); 20 api_dispatcher_ = ProductionApiDispatcher::GetInstance();
21 api_dispatcher_ = ProductionApiDispatcher::get();
22 return S_OK; 21 return S_OK;
23 } 22 }
24 23
25 void CeeeBroker::OnAddConnection(bool first_lock) { 24 void CeeeBroker::OnAddConnection(bool first_lock) {
26 if (first_lock) 25 if (first_lock)
27 ceee_module_util::LockModule(); 26 ceee_module_util::LockModule();
28 } 27 }
29 28
30 void CeeeBroker::OnReleaseConnection(bool last_unlock, 29 void CeeeBroker::OnReleaseConnection(bool last_unlock,
31 bool last_unlock_releases) { 30 bool last_unlock_releases) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 76
78 STDMETHODIMP CeeeBroker::SetTabToolBandIdForHandle(long tool_band_id, 77 STDMETHODIMP CeeeBroker::SetTabToolBandIdForHandle(long tool_band_id,
79 CeeeWindowHandle handle) { 78 CeeeWindowHandle handle) {
80 // TODO(mad@chromium.org): Add security check here. 79 // TODO(mad@chromium.org): Add security check here.
81 DCHECK(tool_band_id != kInvalidChromeSessionId && 80 DCHECK(tool_band_id != kInvalidChromeSessionId &&
82 handle != reinterpret_cast<CeeeWindowHandle>(INVALID_HANDLE_VALUE)); 81 handle != reinterpret_cast<CeeeWindowHandle>(INVALID_HANDLE_VALUE));
83 executors_manager_->SetTabToolBandIdForHandle( 82 executors_manager_->SetTabToolBandIdForHandle(
84 static_cast<int>(tool_band_id), reinterpret_cast<HWND>(handle)); 83 static_cast<int>(tool_band_id), reinterpret_cast<HWND>(handle));
85 return S_OK; 84 return S_OK;
86 } 85 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698