OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TASK_MARSHALLER_H_ | 5 #ifndef CHROME_FRAME_TASK_MARSHALLER_H_ |
6 #define CHROME_FRAME_TASK_MARSHALLER_H_ | 6 #define CHROME_FRAME_TASK_MARSHALLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 #include <deque> | 10 #include <deque> |
11 #include <queue> | 11 #include <queue> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/pending_task.h" | 14 #include "base/pending_task.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 | 18 |
19 class Task; | 19 class Task; |
| 20 |
20 namespace tracked_objects { | 21 namespace tracked_objects { |
21 class Location; | 22 class Location; |
22 } | 23 } |
23 | 24 |
24 // TaskMarshallerThroughMessageQueue is similar to base::MessageLoopForUI | 25 // TaskMarshallerThroughMessageQueue is similar to base::MessageLoopForUI |
25 // in cases where we do not control the thread lifetime and message retrieval | 26 // in cases where we do not control the thread lifetime and message retrieval |
26 // and dispatching. It uses a HWND to ::PostMessage to it as a signal that | 27 // and dispatching. It uses a HWND to ::PostMessage to it as a signal that |
27 // the task queue is not empty. | 28 // the task queue is not empty. |
28 class TaskMarshallerThroughMessageQueue : public base::NonThreadSafe { | 29 class TaskMarshallerThroughMessageQueue : public base::NonThreadSafe { |
29 public: | 30 public: |
30 TaskMarshallerThroughMessageQueue(); | 31 TaskMarshallerThroughMessageQueue(); |
31 virtual ~TaskMarshallerThroughMessageQueue(); | 32 virtual ~TaskMarshallerThroughMessageQueue(); |
(...skipping 26 matching lines...) Expand all Loading... |
58 | 59 |
59 // Lock accesses to |pending_tasks_|. | 60 // Lock accesses to |pending_tasks_|. |
60 base::Lock lock_; | 61 base::Lock lock_; |
61 | 62 |
62 // ::PostMessage parameters. | 63 // ::PostMessage parameters. |
63 HWND wnd_; | 64 HWND wnd_; |
64 UINT msg_; | 65 UINT msg_; |
65 }; | 66 }; |
66 | 67 |
67 #endif // CHROME_FRAME_TASK_MARSHALLER_H_ | 68 #endif // CHROME_FRAME_TASK_MARSHALLER_H_ |
OLD | NEW |