Chromium Code Reviews

Side by Side Diff: ceee/ie/broker/executors_manager.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.
Jump to:
View unified diff | | 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 // ExecutorsManager implementation. 5 // ExecutorsManager implementation.
6 6
7 #include "ceee/ie/broker/executors_manager.h" 7 #include "ceee/ie/broker/executors_manager.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ceee/ie/broker/broker_module_util.h" 10 #include "ceee/ie/broker/broker_module_util.h"
(...skipping 51 matching lines...)
62 0, 0)); 62 0, 0));
63 DCHECK(thread_ != NULL); 63 DCHECK(thread_ != NULL);
64 64
65 // Make sure the thread is ready before continuing 65 // Make sure the thread is ready before continuing
66 DWORD result = WaitForSingleObject(thread_start_data.thread_started_gate, 66 DWORD result = WaitForSingleObject(thread_start_data.thread_started_gate,
67 kTimeOut); 67 kTimeOut);
68 DCHECK(result == WAIT_OBJECT_0); 68 DCHECK(result == WAIT_OBJECT_0);
69 } 69 }
70 } 70 }
71 71
72 // static
73 ExecutorsManager* ExecutorsManager::GetInstance() {
74 return Singleton<ExecutorsManager, ExecutorsManager::SingletonTraits>::get();
75 }
76
72 bool ExecutorsManager::IsKnownWindow(HWND window) { 77 bool ExecutorsManager::IsKnownWindow(HWND window) {
73 return Singleton<ExecutorsManager, ExecutorsManager::SingletonTraits>::get()-> 78 return Singleton<ExecutorsManager, ExecutorsManager::SingletonTraits>::get()->
74 IsKnownWindowImpl(window); 79 IsKnownWindowImpl(window);
75 } 80 }
76 81
77 bool ExecutorsManager::IsKnownWindowImpl(HWND window) { 82 bool ExecutorsManager::IsKnownWindowImpl(HWND window) {
78 AutoLock lock(lock_); 83 AutoLock lock(lock_);
79 return handle_map_.find(window) != handle_map_.end() || 84 return handle_map_.find(window) != handle_map_.end() ||
80 frame_window_families_.find(window) != frame_window_families_.end(); 85 frame_window_families_.find(window) != frame_window_families_.end();
81 } 86 }
(...skipping 576 matching lines...)
658 } else { 663 } else {
659 DCHECK(result == WAIT_FAILED); 664 DCHECK(result == WAIT_FAILED);
660 LOG(ERROR) << "ExecutorsManager::ThreadProc " << com::LogWe(); 665 LOG(ERROR) << "ExecutorsManager::ThreadProc " << com::LogWe();
661 break; 666 break;
662 } 667 }
663 } 668 }
664 // Merci... Bonsoir... 669 // Merci... Bonsoir...
665 ::CoUninitialize(); 670 ::CoUninitialize();
666 return 1; 671 return 1;
667 } 672 }
OLDNEW

Powered by Google App Engine