blob: 8a403d4b2c2e997d9c9f790747bec6a79af67226 [file] [log] [blame]
kmarshall86b0cb882015-12-04 18:01:381// Copyright 2015 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 BLIMP_COMMON_CREATE_BLIMP_MESSAGE_H_
6#define BLIMP_COMMON_CREATE_BLIMP_MESSAGE_H_
7
avi0f2f93dd2015-12-20 16:31:118#include <stdint.h>
9
haibinlu9fa00952015-12-09 01:43:2110#include <string>
11
kmarshall86b0cb882015-12-04 18:01:3812#include "base/memory/scoped_ptr.h"
13#include "blimp/common/blimp_common_export.h"
14
15namespace blimp {
16
17class BlimpMessage;
18class CompositorMessage;
haibinlu81eee132015-12-17 21:29:4419class TabControlMessage;
kmarshall86b0cb882015-12-04 18:01:3820class InputMessage;
dtrainor3652c2262015-12-09 22:15:3521class NavigationMessage;
kmarshall86b0cb882015-12-04 18:01:3822class RenderWidgetMessage;
dtrainor9ff61e92015-12-10 02:17:4923class SizeMessage;
haibinlu9fa00952015-12-09 01:43:2124class StartConnectionMessage;
kmarshall86b0cb882015-12-04 18:01:3825
26// Suite of helper methods to simplify the repetitive task of creating
27// new BlimpMessages, initializing them, and extracting type-specific
28// inner messages.
29//
30//
31// Every specialization of CreateBlimpMessage returns an initialized
32// BlimpMessage object. In addition, a pointer to the type-specific inner
33// message is returned via the initial double-pointer parameter.
34//
35// Additional initialization arguments may be taken depending on the
36// message type.
37
38BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage(
39 CompositorMessage** compositor_message,
40 int target_tab_id);
41
42BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage(
haibinlu81eee132015-12-17 21:29:4443 TabControlMessage** control_message);
dtrainor3652c2262015-12-09 22:15:3544
45BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage(
kmarshall86b0cb882015-12-04 18:01:3846 InputMessage** input_message);
47
48BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage(
dtrainor3652c2262015-12-09 22:15:3549 NavigationMessage** navigation_message,
50 int target_tab_id);
51
52BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage(
kmarshall86b0cb882015-12-04 18:01:3853 RenderWidgetMessage** render_widget_message,
54 int target_tab_id);
55
dtrainor9ff61e92015-12-10 02:17:4956BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage(
57 SizeMessage** size_message);
58
haibinlu9fa00952015-12-09 01:43:2159BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateStartConnectionMessage(
60 const std::string& client_token,
61 int protocol_version);
62
wez3ce23ac2015-12-10 23:39:4363BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateCheckpointAckMessage(
avi0f2f93dd2015-12-20 16:31:1164 int64_t checkpoint_id);
wez3ce23ac2015-12-10 23:39:4365
kmarshall86b0cb882015-12-04 18:01:3866} // namespace blimp
67
68#endif // BLIMP_COMMON_CREATE_BLIMP_MESSAGE_H_