kmarshall | 86b0cb88 | 2015-12-04 18:01:38 | [diff] [blame] | 1 | // 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 | |
avi | 0f2f93dd | 2015-12-20 16:31:11 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
haibinlu | 9fa0095 | 2015-12-09 01:43:21 | [diff] [blame] | 10 | #include <string> |
| 11 | |
kmarshall | 86b0cb88 | 2015-12-04 18:01:38 | [diff] [blame] | 12 | #include "base/memory/scoped_ptr.h" |
| 13 | #include "blimp/common/blimp_common_export.h" |
| 14 | |
| 15 | namespace blimp { |
| 16 | |
| 17 | class BlimpMessage; |
| 18 | class CompositorMessage; |
haibinlu | 81eee13 | 2015-12-17 21:29:44 | [diff] [blame] | 19 | class TabControlMessage; |
kmarshall | 86b0cb88 | 2015-12-04 18:01:38 | [diff] [blame] | 20 | class InputMessage; |
dtrainor | 3652c226 | 2015-12-09 22:15:35 | [diff] [blame] | 21 | class NavigationMessage; |
kmarshall | 86b0cb88 | 2015-12-04 18:01:38 | [diff] [blame] | 22 | class RenderWidgetMessage; |
dtrainor | 9ff61e9 | 2015-12-10 02:17:49 | [diff] [blame] | 23 | class SizeMessage; |
haibinlu | 9fa0095 | 2015-12-09 01:43:21 | [diff] [blame] | 24 | class StartConnectionMessage; |
kmarshall | 86b0cb88 | 2015-12-04 18:01:38 | [diff] [blame] | 25 | |
| 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 | |
| 38 | BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage( |
| 39 | CompositorMessage** compositor_message, |
| 40 | int target_tab_id); |
| 41 | |
| 42 | BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage( |
haibinlu | 81eee13 | 2015-12-17 21:29:44 | [diff] [blame] | 43 | TabControlMessage** control_message); |
dtrainor | 3652c226 | 2015-12-09 22:15:35 | [diff] [blame] | 44 | |
| 45 | BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage( |
kmarshall | 86b0cb88 | 2015-12-04 18:01:38 | [diff] [blame] | 46 | InputMessage** input_message); |
| 47 | |
| 48 | BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage( |
dtrainor | 3652c226 | 2015-12-09 22:15:35 | [diff] [blame] | 49 | NavigationMessage** navigation_message, |
| 50 | int target_tab_id); |
| 51 | |
| 52 | BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage( |
kmarshall | 86b0cb88 | 2015-12-04 18:01:38 | [diff] [blame] | 53 | RenderWidgetMessage** render_widget_message, |
| 54 | int target_tab_id); |
| 55 | |
dtrainor | 9ff61e9 | 2015-12-10 02:17:49 | [diff] [blame] | 56 | BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateBlimpMessage( |
| 57 | SizeMessage** size_message); |
| 58 | |
haibinlu | 9fa0095 | 2015-12-09 01:43:21 | [diff] [blame] | 59 | BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateStartConnectionMessage( |
| 60 | const std::string& client_token, |
| 61 | int protocol_version); |
| 62 | |
wez | 3ce23ac | 2015-12-10 23:39:43 | [diff] [blame] | 63 | BLIMP_COMMON_EXPORT scoped_ptr<BlimpMessage> CreateCheckpointAckMessage( |
avi | 0f2f93dd | 2015-12-20 16:31:11 | [diff] [blame] | 64 | int64_t checkpoint_id); |
wez | 3ce23ac | 2015-12-10 23:39:43 | [diff] [blame] | 65 | |
kmarshall | 86b0cb88 | 2015-12-04 18:01:38 | [diff] [blame] | 66 | } // namespace blimp |
| 67 | |
| 68 | #endif // BLIMP_COMMON_CREATE_BLIMP_MESSAGE_H_ |