1/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * vim: sw=4 ts=8 et :
3 */
4/* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7
8include protocol PPluginInstance;
9
10namespace mozilla {
11namespace plugins {
12
13/**
14 * This protocol exists to allow us to correctly destroy background
15 * surfaces.  The browser owns the surfaces, but shares a "reference"
16 * with the plugin.  The browser needs to notify the plugin when the
17 * background is going to be destroyed, but it can't rely on the
18 * plugin to destroy it because the plugin may crash at any time.  So
19 * the plugin instance relinquishes destruction of the its old
20 * background to actors of this protocol, which can deal with crashy
21 * corner cases more easily than the instance.
22 */
23protocol PPluginBackgroundDestroyer {
24    manager PPluginInstance;
25
26    // The ctor message for this protocol serves double-duty as
27    // notification that that the background is stale.
28
29parent:
30    async __delete__();
31};
32
33}  // namespace plugins
34}  // namespace mozilla
35