| 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 // 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 DCHECK(result == WAIT_OBJECT_0); | 68 DCHECK(result == WAIT_OBJECT_0); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 // static | 72 // static |
| 73 ExecutorsManager* ExecutorsManager::GetInstance() { | 73 ExecutorsManager* ExecutorsManager::GetInstance() { |
| 74 return Singleton<ExecutorsManager, ExecutorsManager::SingletonTraits>::get(); | 74 return Singleton<ExecutorsManager, ExecutorsManager::SingletonTraits>::get(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool ExecutorsManager::IsKnownWindow(HWND window) { | 77 bool ExecutorsManager::IsKnownWindow(HWND window) { |
| 78 return Singleton<ExecutorsManager, ExecutorsManager::SingletonTraits>::get()-> | 78 return GetInstance()->IsKnownWindowImpl(window); |
| 79 IsKnownWindowImpl(window); | |
| 80 } | 79 } |
| 81 | 80 |
| 82 bool ExecutorsManager::IsKnownWindowImpl(HWND window) { | 81 bool ExecutorsManager::IsKnownWindowImpl(HWND window) { |
| 83 AutoLock lock(lock_); | 82 AutoLock lock(lock_); |
| 84 return handle_map_.find(window) != handle_map_.end() || | 83 return handle_map_.find(window) != handle_map_.end() || |
| 85 frame_window_families_.find(window) != frame_window_families_.end(); | 84 frame_window_families_.find(window) != frame_window_families_.end(); |
| 86 } | 85 } |
| 87 | 86 |
| 88 HWND ExecutorsManager::FindTabChild(HWND window) { | 87 HWND ExecutorsManager::FindTabChild(HWND window) { |
| 89 return Singleton<ExecutorsManager, ExecutorsManager::SingletonTraits>::get()-> | 88 return GetInstance()->FindTabChildImpl(window); |
| 90 FindTabChildImpl(window); | |
| 91 } | 89 } |
| 92 | 90 |
| 93 HWND ExecutorsManager::FindTabChildImpl(HWND window) { | 91 HWND ExecutorsManager::FindTabChildImpl(HWND window) { |
| 94 if (!common_api::CommonApiResult::IsIeFrameClass(window)) | 92 if (!common_api::CommonApiResult::IsIeFrameClass(window)) |
| 95 return NULL; | 93 return NULL; |
| 96 | 94 |
| 97 AutoLock lock(lock_); | 95 AutoLock lock(lock_); |
| 98 FrameTabsMap::iterator it = frame_window_families_.find(window); | 96 FrameTabsMap::iterator it = frame_window_families_.find(window); |
| 99 if (it == frame_window_families_.end()) | 97 if (it == frame_window_families_.end()) |
| 100 return NULL; | 98 return NULL; |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 } else { | 661 } else { |
| 664 DCHECK(result == WAIT_FAILED); | 662 DCHECK(result == WAIT_FAILED); |
| 665 LOG(ERROR) << "ExecutorsManager::ThreadProc " << com::LogWe(); | 663 LOG(ERROR) << "ExecutorsManager::ThreadProc " << com::LogWe(); |
| 666 break; | 664 break; |
| 667 } | 665 } |
| 668 } | 666 } |
| 669 // Merci... Bonsoir... | 667 // Merci... Bonsoir... |
| 670 ::CoUninitialize(); | 668 ::CoUninitialize(); |
| 671 return 1; | 669 return 1; |
| 672 } | 670 } |
| OLD | NEW |