blob: e23cd9d51591bd25f096aac80f037512cc6ace62 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_GLOBALS_H_
#define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_GLOBALS_H_
#include "ppapi/c/dev/ppb_memory_dev.h"
#include "ppapi/c/dev/ppp_find_dev.h"
#include "ppapi/c/dev/ppp_printing_dev.h"
#include "ppapi/c/dev/ppp_scrollbar_dev.h"
#include "ppapi/c/dev/ppp_selection_dev.h"
#include "ppapi/c/dev/ppp_widget_dev.h"
#include "ppapi/c/dev/ppp_zoom_dev.h"
#include "ppapi/c/pp_module.h"
#include "ppapi/c/ppb.h"
#include "ppapi/c/ppb_core.h"
#include "ppapi/c/ppb_var.h"
#include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/c/ppb_websocket.h"
#include "ppapi/c/ppp_input_event.h"
#include "ppapi/c/ppp_instance.h"
#include "ppapi/c/ppp_messaging.h"
#include "ppapi/c/ppp_mouse_lock.h"
#include "native_client/src/shared/ppapi_proxy/ppp_instance_combined.h"
#include "native_client/src/untrusted/irt/irt_ppapi.h"
struct NaClSrpcChannel;
namespace ppapi_proxy {
// The main SRPC channel is that used to handle foreground (main thread)
// RPC traffic.
NaClSrpcChannel* GetMainSrpcChannel();
void SetMainSrpcChannel(NaClSrpcChannel* channel);
// The upcall SRPC channel is that used to handle other threads' RPC traffic.
NaClSrpcChannel* GetUpcallSrpcChannel();
void SetUpcallSrpcChannel(NaClSrpcChannel* channel);
// Save the plugin's module_id, which is used for storage allocation tracking.
void SetModuleIdForSrpcChannel(NaClSrpcChannel* channel, PP_Module module_id);
// Forget the plugin's module_id.
void UnsetModuleIdForSrpcChannel(NaClSrpcChannel* channel);
// Save the plugin's module_id.
PP_Module LookupModuleIdForSrpcChannel(NaClSrpcChannel* channel);
// Support for getting PPB_ browser interfaces.
// Safe version CHECK's for NULL.
const void* GetBrowserInterface(const char* interface_name);
const void* GetBrowserInterfaceSafe(const char* interface_name);
// Functions marked "shared" are to be provided by both the browser and the
// plugin side of the proxy, so they can be used by the shared proxy code
// under both trusted and untrusted compilation.
const PPB_Core* PPBCoreInterface(); // shared
const PPB_Memory_Dev* PPBMemoryInterface(); // shared
const PPB_Var* PPBVarInterface(); // shared
const PPB_VarArrayBuffer* PPBVarArrayBufferInterface(); // shared
const PPB_WebSocket* PPBWebSocketInterface();
// Support for getting PPP_ plugin interfaces.
// Safe version CHECK's for NULL.
// Since no PppRpcServer function will be called if the interface is NULL,
// safe version is used to define interface getters below.
const void* GetPluginInterface(const char* interface_name);
const void* GetPluginInterfaceSafe(const char* interface_name);
const PPP_Find_Dev* PPPFindInterface();
const PPP_InputEvent* PPPInputEventInterface();
PPP_Instance_Combined* PPPInstanceInterface();
const PPP_Messaging* PPPMessagingInterface();
const PPP_MouseLock* PPPMouseLockInterface();
const PPP_Printing_Dev* PPPPrintingInterface();
const PPP_Scrollbar_Dev* PPPScrollbarInterface();
const PPP_Selection_Dev* PPPSelectionInterface();
const PPP_Widget_Dev* PPPWidgetInterface();
const PPP_Zoom_Dev* PPPZoomInterface();
// Get thread creation/join functions.
const struct PP_ThreadFunctions* GetThreadCreator();
// PPAPI constants used in the proxy.
extern const PP_Resource kInvalidResourceId;
// The following function TotalSharedMemorySizeInBytes, is copied & similar
// to the one in audio_util.cc. This function includes optional fields
// stored at the end of the audio buffer.
inline size_t TotalAudioSharedMemorySizeInBytes(size_t audio_buffer_size) {
// Include optional field that communicates the number of bytes written.
return audio_buffer_size + sizeof(uint32_t);
}
} // namespace ppapi_proxy
#endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_GLOBALS_H_
|