OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_RENDERER_RENDERER_HIGH_PRIORITY_TASK_QUEUE_H_ |
| 6 #define CHROME_RENDERER_RENDERER_HIGH_PRIORITY_TASK_QUEUE_H_ |
| 7 |
| 8 #include "base/base_export.h" |
| 9 #include "base/basictypes.h" |
| 10 #include "base/callback_forward.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/message_loop/incoming_task_queue.h" |
| 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/message_loop/message_pump_default.h" |
| 16 #include "base/time/time.h" |
| 17 |
| 18 namespace tracked_objects { |
| 19 class Location; |
| 20 } // namespace tracked_objects |
| 21 |
| 22 namespace content { |
| 23 |
| 24 class MessagePumpHighPriority : public base::MessagePumpDefault { |
| 25 public: |
| 26 MessagePumpHighPriority(); |
| 27 virtual ~MessagePumpHighPriority(); |
| 28 |
| 29 private: |
| 30 |
| 31 }; |
| 32 |
| 33 class MessageLoopRendererMainThread : public base::MessageLoop { |
| 34 public: |
| 35 MessageLoopRendererMainThread(); |
| 36 |
| 37 virtual void ReloadAllWorkQueues() OVERRIDE; |
| 38 virtual base::TaskQueue& GetNextWorkQueue() OVERRIDE; |
| 39 virtual bool HasWorkAvailable() const OVERRIDE; |
| 40 |
| 41 private: |
| 42 void ReloadHighPriorityWorkQueue(); |
| 43 |
| 44 scoped_refptr<base::internal::IncomingTaskQueue> |
| 45 high_priority_incoming_task_queue_; |
| 46 scoped_refptr<base::internal::MessageLoopProxyImpl> |
| 47 high_priority_message_loop_proxy_; |
| 48 base::TaskQueue high_priority_work_queue_; |
| 49 }; |
| 50 |
| 51 class RendererHighPriorityTaskQueue { |
| 52 public: |
| 53 static bool PostTask(const tracked_objects::Location& from_here, |
| 54 const base::Closure& task); |
| 55 private: |
| 56 RendererHighPriorityTaskQueue() {} |
| 57 DISALLOW_COPY_AND_ASSIGN(RendererHighPriorityTaskQueue); |
| 58 }; |
| 59 |
| 60 } // namespace content |
| 61 |
| 62 #endif // CHROME_RENDERER_RENDERER_MAIN_PLATFORM_DELEGATE_H_ |
OLD | NEW |