blob: 4094b1b96ec7a41a3475525b5985b008602a67ed [file] [log] [blame]
[email protected]586871b2014-07-22 17:05:111// Copyright 2014 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 CONTENT_RENDERER_QUEUE_MESSAGE_SWAP_PROMISE_H_
6#define CONTENT_RENDERER_QUEUE_MESSAGE_SWAP_PROMISE_H_
7
8#include "base/memory/ref_counted.h"
9#include "base/memory/scoped_ptr.h"
10#include "cc/base/swap_promise.h"
11
12namespace IPC {
13class SyncMessageFilter;
14}
15
16namespace content {
17
18class FrameSwapMessageQueue;
19
20class QueueMessageSwapPromise : public cc::SwapPromise {
21 public:
22 QueueMessageSwapPromise(scoped_refptr<IPC::SyncMessageFilter> message_sender,
23 scoped_refptr<FrameSwapMessageQueue> message_queue,
24 int source_frame_number);
25
dcheng6d18e402014-10-21 12:32:5226 ~QueueMessageSwapPromise() override;
[email protected]586871b2014-07-22 17:05:1127
dcheng6d18e402014-10-21 12:32:5228 void DidSwap(cc::CompositorFrameMetadata* metadata) override;
[email protected]586871b2014-07-22 17:05:1129
dcheng6d18e402014-10-21 12:32:5230 void DidNotSwap(DidNotSwapReason reason) override;
[email protected]586871b2014-07-22 17:05:1131
dcheng6d18e402014-10-21 12:32:5232 int64 TraceId() const override;
[email protected]dab0a422014-08-13 16:09:4633
[email protected]586871b2014-07-22 17:05:1134 private:
35 void PromiseCompleted();
36
37 scoped_refptr<IPC::SyncMessageFilter> message_sender_;
38 scoped_refptr<content::FrameSwapMessageQueue> message_queue_;
39 int source_frame_number_;
40#if DCHECK_IS_ON
41 bool completed_;
42#endif
43};
44
45} // namespace content
46
47#endif // CONTENT_RENDERER_QUEUE_MESSAGE_SWAP_PROMISE_H_