• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 */
5
6/**
7 * This file defines the PPB_Instance_Private interface implemented by the
8 * browser and containing pointers to functions available only to trusted plugin
9 * instances.
10 */
11
12[generate_thunk]
13
14label Chrome {
15  M13 = 0.1
16};
17
18/**
19 * The <code>PP_ExternalPluginResult </code> enum contains result codes from
20 * launching an external plugin.
21 */
22[assert_size(4)]
23enum 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
32};
33
34
35/**
36 * The PPB_Instance_Private interface contains functions available only to
37 * trusted plugin instances.
38 *
39 */
40interface PPB_Instance_Private {
41  /**
42   * GetWindowObject is a pointer to a function that determines
43   * the DOM window containing this module instance.
44   *
45   * @param[in] instance A PP_Instance whose WindowObject should be retrieved.
46   * @return A PP_Var containing window object on success.
47   */
48  PP_Var GetWindowObject([in] PP_Instance instance);
49
50  /**
51   * GetOwnerElementObject is a pointer to a function that determines
52   * the DOM element containing this module instance.
53   *
54   * @param[in] instance A PP_Instance whose WindowObject should be retrieved.
55   * @return A PP_Var containing DOM element on success.
56   */
57  PP_Var GetOwnerElementObject([in] PP_Instance instance);
58
59  /**
60   * ExecuteScript is a pointer to a function that executes the given
61   * script in the context of the frame containing the module.
62   *
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.
68   *
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.
73   *
74   * @return The result of the script execution, or a "void" var
75   * if execution failed.
76   */
77  PP_Var ExecuteScript([in] PP_Instance instance,
78                       [in] PP_Var script,
79                       [out] PP_Var exception);
80};
81