OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/renderer/gpu/queue_message_swap_promise.h" | 5 #include "content/renderer/gpu/queue_message_swap_promise.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
9 #include "content/public/renderer/render_thread.h" | 9 #include "content/public/renderer/render_thread.h" |
10 #include "content/renderer/gpu/frame_swap_message_queue.h" | 10 #include "content/renderer/gpu/frame_swap_message_queue.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 PromiseCompleted(); | 52 PromiseCompleted(); |
53 } | 53 } |
54 | 54 |
55 void QueueMessageSwapPromise::DidSwap() {} | 55 void QueueMessageSwapPromise::DidSwap() {} |
56 | 56 |
57 cc::SwapPromise::DidNotSwapAction QueueMessageSwapPromise::DidNotSwap( | 57 cc::SwapPromise::DidNotSwapAction QueueMessageSwapPromise::DidNotSwap( |
58 DidNotSwapReason reason) { | 58 DidNotSwapReason reason) { |
59 #if DCHECK_IS_ON() | 59 #if DCHECK_IS_ON() |
60 DCHECK(!completed_); | 60 DCHECK(!completed_); |
61 #endif | 61 #endif |
| 62 // TODO(eseckler): Deliver messages with next ViewHostMsg_BeginFrameDidNotSwap |
| 63 // or ViewHostMsg_SwapCompositorFrame instead of sending them here directly. |
62 std::vector<std::unique_ptr<IPC::Message>> messages; | 64 std::vector<std::unique_ptr<IPC::Message>> messages; |
63 message_queue_->DidNotSwap(source_frame_number_, reason, &messages); | 65 message_queue_->DidNotSwap(source_frame_number_, reason, &messages); |
64 for (auto& msg : messages) { | 66 for (auto& msg : messages) { |
65 message_sender_->Send(msg.release()); | 67 message_sender_->Send(msg.release()); |
66 } | 68 } |
67 PromiseCompleted(); | 69 PromiseCompleted(); |
68 return DidNotSwapAction::BREAK_PROMISE; | 70 return DidNotSwapAction::BREAK_PROMISE; |
69 } | 71 } |
70 | 72 |
71 void QueueMessageSwapPromise::PromiseCompleted() { | 73 void QueueMessageSwapPromise::PromiseCompleted() { |
72 #if DCHECK_IS_ON() | 74 #if DCHECK_IS_ON() |
73 completed_ = true; | 75 completed_ = true; |
74 #endif | 76 #endif |
75 } | 77 } |
76 | 78 |
77 int64_t QueueMessageSwapPromise::TraceId() const { | 79 int64_t QueueMessageSwapPromise::TraceId() const { |
78 return 0; | 80 return 0; |
79 } | 81 } |
80 | 82 |
81 } // namespace content | 83 } // namespace content |
OLD | NEW |