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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 void QueueMessageSwapPromise::DidSwap(cc::CompositorFrameMetadata* metadata) { | 60 void QueueMessageSwapPromise::DidSwap(cc::CompositorFrameMetadata* metadata) { |
61 #if DCHECK_IS_ON() | 61 #if DCHECK_IS_ON() |
62 DCHECK(!completed_); | 62 DCHECK(!completed_); |
63 #endif | 63 #endif |
64 message_queue_->DidSwap(source_frame_number_); | 64 message_queue_->DidSwap(source_frame_number_); |
65 // The OutputSurface will take care of the Drain+Send. | 65 // The OutputSurface will take care of the Drain+Send. |
66 PromiseCompleted(); | 66 PromiseCompleted(); |
67 } | 67 } |
68 | 68 |
69 void QueueMessageSwapPromise::DidNotSwap(DidNotSwapReason reason) { | 69 cc::SwapPromise::DidNotSwapAction QueueMessageSwapPromise::DidNotSwap( |
| 70 DidNotSwapReason reason) { |
70 #if DCHECK_IS_ON() | 71 #if DCHECK_IS_ON() |
71 DCHECK(!completed_); | 72 DCHECK(!completed_); |
72 #endif | 73 #endif |
73 std::vector<std::unique_ptr<IPC::Message>> messages; | 74 std::vector<std::unique_ptr<IPC::Message>> messages; |
74 message_queue_->DidNotSwap(source_frame_number_, reason, &messages); | 75 message_queue_->DidNotSwap(source_frame_number_, reason, &messages); |
75 for (auto& msg : messages) { | 76 for (auto& msg : messages) { |
76 message_sender_->Send(msg.release()); | 77 message_sender_->Send(msg.release()); |
77 } | 78 } |
78 PromiseCompleted(); | 79 PromiseCompleted(); |
| 80 return DidNotSwapAction::BREAK_PROMISE; |
79 } | 81 } |
80 | 82 |
81 void QueueMessageSwapPromise::PromiseCompleted() { | 83 void QueueMessageSwapPromise::PromiseCompleted() { |
82 #if DCHECK_IS_ON() | 84 #if DCHECK_IS_ON() |
83 completed_ = true; | 85 completed_ = true; |
84 #endif | 86 #endif |
85 } | 87 } |
86 | 88 |
87 int64_t QueueMessageSwapPromise::TraceId() const { | 89 int64_t QueueMessageSwapPromise::TraceId() const { |
88 return 0; | 90 return 0; |
89 } | 91 } |
90 | 92 |
91 } // namespace content | 93 } // namespace content |
OLD | NEW |