| 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 "content/renderer/gpu/frame_swap_message_queue.h" | 7 #include "content/renderer/gpu/frame_swap_message_queue.h" |
| 8 #include "ipc/ipc_sync_message_filter.h" | 8 #include "ipc/ipc_sync_message_filter.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 DCHECK(message_queue_.get()); | 25 DCHECK(message_queue_.get()); |
| 26 } | 26 } |
| 27 | 27 |
| 28 QueueMessageSwapPromise::~QueueMessageSwapPromise() { | 28 QueueMessageSwapPromise::~QueueMessageSwapPromise() { |
| 29 // The promise should have either been kept or broken before it's deleted. | 29 // The promise should have either been kept or broken before it's deleted. |
| 30 #if DCHECK_IS_ON() | 30 #if DCHECK_IS_ON() |
| 31 DCHECK(completed_); | 31 DCHECK(completed_); |
| 32 #endif | 32 #endif |
| 33 } | 33 } |
| 34 | 34 |
| 35 void QueueMessageSwapPromise::DidActivate() { |
| 36 #if DCHECK_IS_ON() |
| 37 DCHECK(!completed_); |
| 38 #endif |
| 39 message_queue_->DidActivate(source_frame_number_); |
| 40 // The OutputSurface will take care of the Drain+Send. |
| 41 } |
| 42 |
| 35 void QueueMessageSwapPromise::DidSwap(cc::CompositorFrameMetadata* metadata) { | 43 void QueueMessageSwapPromise::DidSwap(cc::CompositorFrameMetadata* metadata) { |
| 36 #if DCHECK_IS_ON() | 44 #if DCHECK_IS_ON() |
| 37 DCHECK(!completed_); | 45 DCHECK(!completed_); |
| 38 #endif | 46 #endif |
| 39 message_queue_->DidSwap(source_frame_number_); | 47 message_queue_->DidSwap(source_frame_number_); |
| 40 // The OutputSurface will take care of the Drain+Send. | 48 // The OutputSurface will take care of the Drain+Send. |
| 41 PromiseCompleted(); | 49 PromiseCompleted(); |
| 42 } | 50 } |
| 43 | 51 |
| 44 void QueueMessageSwapPromise::DidNotSwap(DidNotSwapReason reason) { | 52 void QueueMessageSwapPromise::DidNotSwap(DidNotSwapReason reason) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 60 #if DCHECK_IS_ON() | 68 #if DCHECK_IS_ON() |
| 61 completed_ = true; | 69 completed_ = true; |
| 62 #endif | 70 #endif |
| 63 } | 71 } |
| 64 | 72 |
| 65 int64 QueueMessageSwapPromise::TraceId() const { | 73 int64 QueueMessageSwapPromise::TraceId() const { |
| 66 return 0; | 74 return 0; |
| 67 } | 75 } |
| 68 | 76 |
| 69 } // namespace content | 77 } // namespace content |
| OLD | NEW |