| OLD | NEW |
| 1 // Copyright (c) 2009 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 #ifndef CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ | 5 #ifndef CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ |
| 6 #define CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ | 6 #define CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlwin.h> | 9 #include <atlwin.h> |
| 10 #include <queue> | 10 #include <queue> |
| 11 #include <string> | 11 #include <string> |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 TaskMarshallerThroughWindowsMessages() {} | 142 TaskMarshallerThroughWindowsMessages() {} |
| 143 virtual void PostTask(const tracked_objects::Location& from_here, | 143 virtual void PostTask(const tracked_objects::Location& from_here, |
| 144 Task* task) { | 144 Task* task) { |
| 145 task->SetBirthPlace(from_here); | 145 task->SetBirthPlace(from_here); |
| 146 T* this_ptr = static_cast<T*>(this); | 146 T* this_ptr = static_cast<T*>(this); |
| 147 if (this_ptr->IsWindow()) { | 147 if (this_ptr->IsWindow()) { |
| 148 this_ptr->AddRef(); | 148 this_ptr->AddRef(); |
| 149 PushTask(task); | 149 PushTask(task); |
| 150 this_ptr->PostMessage(MSG_EXECUTE_TASK, reinterpret_cast<WPARAM>(task)); | 150 this_ptr->PostMessage(MSG_EXECUTE_TASK, reinterpret_cast<WPARAM>(task)); |
| 151 } else { | 151 } else { |
| 152 DLOG(INFO) << "Dropping MSG_EXECUTE_TASK message for destroyed window."; | 152 DVLOG(1) << "Dropping MSG_EXECUTE_TASK message for destroyed window."; |
| 153 delete task; | 153 delete task; |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 protected: | 157 protected: |
| 158 ~TaskMarshallerThroughWindowsMessages() { | 158 ~TaskMarshallerThroughWindowsMessages() { |
| 159 DeleteAllPendingTasks(); | 159 DeleteAllPendingTasks(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void DeleteAllPendingTasks() { | 162 void DeleteAllPendingTasks() { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 } | 205 } |
| 206 | 206 |
| 207 return false; | 207 return false; |
| 208 } | 208 } |
| 209 | 209 |
| 210 Lock lock_; | 210 Lock lock_; |
| 211 std::queue<Task*> pending_tasks_; | 211 std::queue<Task*> pending_tasks_; |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 #endif // CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ | 214 #endif // CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ |
| OLD | NEW |