| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // IPC messages for push messaging. | |
| 6 // Multiply-included message file, hence no include guard. | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include "content/public/common/push_messaging_status.h" | |
| 11 #include "content/public/common/push_subscription_options.h" | |
| 12 #include "ipc/ipc_message_macros.h" | |
| 13 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushError
.h" | |
| 14 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushPermi
ssionStatus.h" | |
| 15 #include "url/gurl.h" | |
| 16 | |
| 17 #define IPC_MESSAGE_START PushMessagingMsgStart | |
| 18 | |
| 19 IPC_ENUM_TRAITS_MAX_VALUE(content::PushRegistrationStatus, | |
| 20 content::PUSH_REGISTRATION_STATUS_LAST) | |
| 21 | |
| 22 IPC_ENUM_TRAITS_MAX_VALUE(content::PushGetRegistrationStatus, | |
| 23 content::PUSH_GETREGISTRATION_STATUS_LAST) | |
| 24 | |
| 25 IPC_ENUM_TRAITS_MAX_VALUE( | |
| 26 blink::WebPushPermissionStatus, | |
| 27 blink::WebPushPermissionStatus::WebPushPermissionStatusLast) | |
| 28 | |
| 29 IPC_ENUM_TRAITS_MAX_VALUE( | |
| 30 blink::WebPushError::ErrorType, | |
| 31 blink::WebPushError::ErrorType::ErrorTypeLast) | |
| 32 | |
| 33 IPC_STRUCT_TRAITS_BEGIN(content::PushSubscriptionOptions) | |
| 34 IPC_STRUCT_TRAITS_MEMBER(user_visible_only) | |
| 35 IPC_STRUCT_TRAITS_MEMBER(sender_info) | |
| 36 IPC_STRUCT_TRAITS_END() | |
| 37 | |
| 38 // Messages sent from the browser to the child process. | |
| 39 | |
| 40 IPC_MESSAGE_ROUTED5(PushMessagingMsg_SubscribeFromDocumentSuccess, | |
| 41 int32_t /* request_id */, | |
| 42 GURL /* push_endpoint */, | |
| 43 content::PushSubscriptionOptions /* options */, | |
| 44 std::vector<uint8_t> /* p256dh */, | |
| 45 std::vector<uint8_t> /* auth */) | |
| 46 | |
| 47 IPC_MESSAGE_CONTROL5(PushMessagingMsg_SubscribeFromWorkerSuccess, | |
| 48 int32_t /* request_id */, | |
| 49 GURL /* push_endpoint */, | |
| 50 content::PushSubscriptionOptions /* options */, | |
| 51 std::vector<uint8_t> /* p256dh */, | |
| 52 std::vector<uint8_t> /* auth */) | |
| 53 | |
| 54 IPC_MESSAGE_ROUTED2(PushMessagingMsg_SubscribeFromDocumentError, | |
| 55 int32_t /* request_id */, | |
| 56 content::PushRegistrationStatus /* status */) | |
| 57 | |
| 58 IPC_MESSAGE_CONTROL2(PushMessagingMsg_SubscribeFromWorkerError, | |
| 59 int32_t /* request_id */, | |
| 60 content::PushRegistrationStatus /* status */) | |
| 61 | |
| 62 IPC_MESSAGE_CONTROL2(PushMessagingMsg_UnsubscribeSuccess, | |
| 63 int32_t /* request_id */, | |
| 64 bool /* did_unsubscribe */) | |
| 65 | |
| 66 IPC_MESSAGE_CONTROL3(PushMessagingMsg_UnsubscribeError, | |
| 67 int32_t /* request_id */, | |
| 68 blink::WebPushError::ErrorType /* error_type */, | |
| 69 std::string /* error_message */) | |
| 70 | |
| 71 IPC_MESSAGE_CONTROL5(PushMessagingMsg_GetSubscriptionSuccess, | |
| 72 int32_t /* request_id */, | |
| 73 GURL /* push_endpoint */, | |
| 74 content::PushSubscriptionOptions /* options */, | |
| 75 std::vector<uint8_t> /* p256dh */, | |
| 76 std::vector<uint8_t> /* auth */) | |
| 77 | |
| 78 IPC_MESSAGE_CONTROL2(PushMessagingMsg_GetSubscriptionError, | |
| 79 int32_t /* request_id */, | |
| 80 content::PushGetRegistrationStatus /* status */) | |
| 81 | |
| 82 IPC_MESSAGE_CONTROL2(PushMessagingMsg_GetPermissionStatusSuccess, | |
| 83 int32_t /* request_id */, | |
| 84 blink::WebPushPermissionStatus /* status */) | |
| 85 | |
| 86 IPC_MESSAGE_CONTROL2(PushMessagingMsg_GetPermissionStatusError, | |
| 87 int32_t /* request_id */, | |
| 88 blink::WebPushError::ErrorType /* error_type */) | |
| 89 | |
| 90 // Messages sent from the child process to the browser. | |
| 91 | |
| 92 // |render_frame_id| should be ChildProcessHost::kInvalidUniqueID for requests | |
| 93 // from a Service Worker. | |
| 94 IPC_MESSAGE_CONTROL4(PushMessagingHostMsg_Subscribe, | |
| 95 int32_t /* render_frame_id */, | |
| 96 int32_t /* request_id */, | |
| 97 int64_t /* service_worker_registration_id */, | |
| 98 content::PushSubscriptionOptions /* options */) | |
| 99 | |
| 100 IPC_MESSAGE_CONTROL2(PushMessagingHostMsg_Unsubscribe, | |
| 101 int32_t /* request_id */, | |
| 102 int64_t /* service_worker_registration_id */) | |
| 103 | |
| 104 IPC_MESSAGE_CONTROL2(PushMessagingHostMsg_GetSubscription, | |
| 105 int32_t /* request_id */, | |
| 106 int64_t /* service_worker_registration_id */) | |
| 107 | |
| 108 IPC_MESSAGE_CONTROL3(PushMessagingHostMsg_GetPermissionStatus, | |
| 109 int32_t /* request_id */, | |
| 110 int64_t /* service_worker_registration_id */, | |
| 111 bool /* user_visible */) | |
| OLD | NEW |