1 // Copyright (c) 2013 Intel Corporation. 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.
5 #ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_SYNCMESSAGE_H_
6 #define XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_SYNCMESSAGE_H_
8 // NOTE: This file and interfaces marked as internal are not considered stable
9 // and can be modified in incompatible ways between Crosswalk versions.
11 #ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_H_
12 #error "You should include XW_Extension.h before this file"
20 // XW_INTERNAL_SYNC_MESSAGING_INTERFACE: allow JavaScript code to send a
21 // synchronous message to extension code and block until response is
22 // available. The response is made available by calling the SetSyncReply
23 // function, that can be done from outside the context of the SyncMessage
27 #define XW_INTERNAL_SYNC_MESSAGING_INTERFACE_1 \
28 "XW_InternalSyncMessagingInterface_1"
29 #define XW_INTERNAL_SYNC_MESSAGING_INTERFACE \
30 XW_INTERNAL_SYNC_MESSAGING_INTERFACE_1
32 typedef void (*XW_HandleSyncMessageCallback)(XW_Instance instance,
35 struct XW_Internal_SyncMessagingInterface_1 {
36 void (*Register)(XW_Extension extension,
37 XW_HandleSyncMessageCallback handle_sync_message);
38 void (*SetSyncReply)(XW_Instance instance, const char* reply);
41 typedef struct XW_Internal_SyncMessagingInterface_1
42 XW_Internal_SyncMessagingInterface;
48 #endif // XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_SYNCMESSAGE_H_