tizen 2.4 release
[framework/web/wrt-plugins-common.git] / src / xwalk-module / XW_Extension_Permissions.h
1 // Copyright (c) 2014 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.
4
5 #ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_PERMISSIONS_H_
6 #define XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_PERMISSIONS_H_
7
8 // NOTE: This file and interfaces marked as internal are not considered stable
9 // and can be modified in incompatible ways between Crosswalk versions.
10
11 #ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_H_
12 #error "You should include XW_Extension.h before this file"
13 #endif
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #define XW_INTERNAL_PERMISSIONS_INTERFACE_1 \
20     "XW_Internal_PermissionsInterface_1"
21 #define XW_INTERNAL_PERMISSIONS_INTERFACE \
22     XW_INTERNAL_PERMISSIONS_INTERFACE_1
23
24 //
25 // XW_INTERNAL_PERMISSIONS_INTERFACE: provides a way for extensions
26 // check if they have the proper permissions for certain APIs.
27 //
28
29 struct XW_Internal_PermissionsInterface_1 {
30   int (*CheckAPIAccessControl)(XW_Extension extension, const char* api_name);
31   int (*RegisterPermissions)(XW_Extension extension, const char* perm_table);
32 };
33
34 typedef struct XW_Internal_PermissionsInterface_1
35     XW_Internal_PermissionsInterface;
36
37 #ifdef __cplusplus
38 }  // extern "C"
39 #endif
40
41 #endif  // XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_PERMISSIONS_H_