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 // Window message source implementation. | 5 // Window message source implementation. |
6 #include "ceee/ie/plugin/bho/window_message_source.h" | 6 #include "ceee/ie/plugin/bho/window_message_source.h" |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "ceee/common/window_utils.h" | 11 #include "ceee/common/window_utils.h" |
12 #include "ceee/common/windows_constants.h" | 12 #include "ceee/common/windows_constants.h" |
13 #include "ceee/ie/common/ceee_module_util.h" | 13 #include "ceee/ie/common/ceee_module_util.h" |
14 | 14 |
15 WindowMessageSource::MessageSourceMap WindowMessageSource::message_source_map_; | 15 WindowMessageSource::MessageSourceMap WindowMessageSource::message_source_map_; |
16 Lock WindowMessageSource::lock_; | 16 base::Lock WindowMessageSource::lock_; |
17 | 17 |
18 WindowMessageSource::WindowMessageSource() | 18 WindowMessageSource::WindowMessageSource() |
19 : create_thread_id_(::GetCurrentThreadId()), | 19 : create_thread_id_(::GetCurrentThreadId()), |
20 get_message_hook_(NULL), | 20 get_message_hook_(NULL), |
21 call_wnd_proc_ret_hook_(NULL) { | 21 call_wnd_proc_ret_hook_(NULL) { |
22 } | 22 } |
23 | 23 |
24 WindowMessageSource::~WindowMessageSource() { | 24 WindowMessageSource::~WindowMessageSource() { |
25 DCHECK(get_message_hook_ == NULL); | 25 DCHECK(get_message_hook_ == NULL); |
26 DCHECK(call_wnd_proc_ret_hook_ == NULL); | 26 DCHECK(call_wnd_proc_ret_hook_ == NULL); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 base::AutoLock auto_lock(lock_); | 211 base::AutoLock auto_lock(lock_); |
212 MessageSourceMap::const_iterator iter = message_source_map_.find(thread_id); | 212 MessageSourceMap::const_iterator iter = message_source_map_.find(thread_id); |
213 return iter == message_source_map_.end() ? NULL : iter->second; | 213 return iter == message_source_map_.end() ? NULL : iter->second; |
214 } | 214 } |
215 | 215 |
216 // static | 216 // static |
217 void WindowMessageSource::RemoveEntryFromMap(DWORD thread_id) { | 217 void WindowMessageSource::RemoveEntryFromMap(DWORD thread_id) { |
218 base::AutoLock auto_lock(lock_); | 218 base::AutoLock auto_lock(lock_); |
219 message_source_map_.erase(thread_id); | 219 message_source_map_.erase(thread_id); |
220 } | 220 } |
OLD | NEW |