1 /* Copyright (c) 2012 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.
7 * This file defines the PPB_Instance_Private interface implemented by the
8 * browser and containing pointers to functions available only to trusted plugin
19 * The <code>PP_ExternalPluginResult </code> enum contains result codes from
20 * launching an external plugin.
23 enum PP_ExternalPluginResult
{
24 /** Successful external plugin call */
25 PP_EXTERNAL_PLUGIN_OK
= 0,
26 /** Unspecified external plugin error */
27 PP_EXTERNAL_PLUGIN_FAILED
= 1,
28 /** Error creating the module */
29 PP_EXTERNAL_PLUGIN_ERROR_MODULE
= 2,
30 /** Error creating and initializing the instance */
31 PP_EXTERNAL_PLUGIN_ERROR_INSTANCE
= 3
36 * The PPB_Instance_Private interface contains functions available only to
37 * trusted plugin instances.
40 interface PPB_Instance_Private
{
42 * GetWindowObject is a pointer to a function that determines
43 * the DOM window containing this module instance.
45 * @param[in] instance A PP_Instance whose WindowObject should be retrieved.
46 * @return A PP_Var containing window object on success.
48 PP_Var GetWindowObject
([in] PP_Instance instance
);
51 * GetOwnerElementObject is a pointer to a function that determines
52 * the DOM element containing this module instance.
54 * @param[in] instance A PP_Instance whose WindowObject should be retrieved.
55 * @return A PP_Var containing DOM element on success.
57 PP_Var GetOwnerElementObject
([in] PP_Instance instance
);
60 * ExecuteScript is a pointer to a function that executes the given
61 * script in the context of the frame containing the module.
63 * The exception, if any, will be returned in *exception. As with the PPB_Var
64 * interface, the exception parameter, if non-NULL, must be initialized
65 * to a "void" var or the function will immediately return. On success,
66 * the exception parameter will be set to a "void" var. On failure, the
67 * return value will be a "void" var.
69 * @param[in] script A string containing the JavaScript to execute.
70 * @param[in/out] exception PP_Var containing the exception. Initialize
71 * this to NULL if you don't want exception info; initialize this to a void
72 * exception if want exception info.
74 * @return The result of the script execution, or a "void" var
75 * if execution failed.
77 PP_Var ExecuteScript
([in] PP_Instance instance
,
79 [out] PP_Var exception
);